/* Antitheft web design system (scaffold).
   The antitheft desktop app's UI language, ported for the marketing page:
   tokens from antitheft/ui/src/pages/Home.css (the finalized glass look;
   the dark values are its true-neutral canvas, NOT the bluer shadcn set in
   index.css), Space Grotesk + JetBrains Mono, one accent (blue), status
   colours (good / warning / critical), light and dark. Each page adds only its
   own rules in its own stylesheet (next.css, ...), the same split the app uses.

   Layout: FULL WIDTH, no container. Sections are full-bleed and only carry
   an inline gutter (--gutter); content uses the whole width, so wide
   examples, animations and redrawn UI components have room.

   Radius rule (one scale, used everywhere): controls and chips 8-10,
   cards 16, window frame 12, dialogs 20.

   Components: .nav .wordmark .sec .h-hero .h-sec .lede .glass .card .btn
   .btn--primary .btn--ghost .iconbtn .chip (--good --warn --crit) .seg
   .codebox .window .titlebar .row (+ .actor .verdict) .emblem .reveal
   .sr-only .dev-theme .actor-logo .logo-chip .pill .ui-pic. */

:root {
  color-scheme: light dark;

  /* colour: light | dark */
  --accent: #2a63cf;
  --accent-2: light-dark(#1b47a3, #7fa4e8);
  --ink: light-dark(#10182c, #eef1f8);
  --muted: light-dark(#5b6478, #98999f);
  --line: light-dark(rgba(16, 24, 44, 0.10), rgba(255, 255, 255, 0.13));
  --panel: light-dark(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.055));
  --panel-hi: light-dark(rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.025));
  --glass-border: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.13));
  --glass-solid: light-dark(#f4f6fb, #16161a);
  --glass-hi: light-dark(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.09));
  --glass-drop: light-dark(rgba(24, 40, 84, 0.28), rgba(0, 0, 0, 0.8));
  --hover-tint: light-dark(rgba(16, 24, 44, 0.04), rgba(255, 255, 255, 0.06));
  --btn-fill: light-dark(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.04));
  --btn-fill-hover: light-dark(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.09));
  --good: light-dark(#159a6b, #4ee6b8);
  --warning: light-dark(#c98a1e, #e8b04e);
  --critical: light-dark(#d1453d, #ea6b62);
  --sheen-1: light-dark(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.09));
  --sheen-2: light-dark(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --lift-hi: light-dark(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.16));
  --lift-drop: light-dark(rgba(24, 40, 84, 0.38), rgba(2, 4, 12, 0.8));

  /* canvas: two accent blooms on cool paper; near-neutral bloom on zinc black */
  --canvas: light-dark(#eef1f7, #0a0a0c);
  --bloom-1: light-dark(rgba(42, 99, 207, 0.16), rgba(120, 135, 165, 0.05));
  --bloom-2: light-dark(rgba(42, 99, 207, 0.10), rgba(0, 0, 0, 0));
  --grain: 0.035;
  --emblem-opacity: 0.42;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-ctl: 10px;
  --r-chip: 8px;
  --r-card: 16px;
  --r-win: 12px;
  --r-dialog: 20px;
  --gutter: clamp(20px, 4vw, 72px);
  --nav-h: 46px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
/* Theme: follows the OS. html[data-theme] pins it; the dev switch (local
   hosts only, see next.js) always pins an explicit "light" or "dark", because
   removing the pin would just fall back to the OS. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --grain: 0.05; --emblem-opacity: 0.56; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grain: 0.05; --emblem-opacity: 0.56; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-display);
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Canvas and grain are fixed layers, never on a scrolling element. */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
body::before {
  z-index: -2;
  background:
    radial-gradient(820px 620px at 8% -8%, var(--bloom-1) 0%, transparent 60%),
    radial-gradient(700px 560px at 100% 105%, var(--bloom-2) 0%, transparent 60%),
    var(--canvas);
}
body::after {
  z-index: 60;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--font-mono); }

/* ---- type ------------------------------------------------------------ */

.h-hero {
  font-size: clamp(38px, 4.6vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h-sec {
  font-size: clamp(30px, 3.6vw, 60px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.em { color: var(--accent-2); }

/* ---- layout: full width, no container -------------------------------- */

.sec {
  padding-inline: var(--gutter);
  padding-block: clamp(72px, 9vw, 152px);
}
.sec--tight { padding-block: clamp(40px, 5vw, 80px); }

/* ---- glass ----------------------------------------------------------- */

.glass {
  background: linear-gradient(180deg, var(--panel), var(--panel-hi));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 24px 48px -27px var(--glass-drop);
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Liquid glass (.glass.lg): for what floats over the page, the bar and the theme switch. A light, mostly clear tint,
   little blur, a hairline edge and a soft shadow; in Chromium, liquid-glass.js adds the edge refraction (--lg-filter),
   so the page behind bends at the rounded rim. That bending is what reads as glass. No gradient fill, bevel line or
   inner glow: those fake volume. Elsewhere the plain blur stays. */
:root {
  --lg-tint: light-dark(rgba(255, 255, 255, 0.30), rgba(18, 18, 22, 0.28));
  --lg-edge: light-dark(rgba(16, 24, 44, 0.07), rgba(255, 255, 255, 0.07));
  --lg-drop: light-dark(rgba(24, 40, 84, 0.10), rgba(0, 0, 0, 0.40));
}
.glass.lg {
  background: var(--lg-tint);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--lg-edge), 0 10px 30px -12px var(--lg-drop);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
}
.glass.lg.lg-on {
  -webkit-backdrop-filter: var(--lg-filter) blur(4px) saturate(170%) brightness(1.04);
  backdrop-filter: var(--lg-filter) blur(4px) saturate(170%) brightness(1.04);
}
@media (prefers-reduced-transparency: reduce) {
  .glass.lg, .glass.lg.lg-on { background: var(--glass-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Card: glass that brightens on hover. The brighten is an opacity-faded
   overlay, never an animated backdrop-filter (that pops on WebKit). */
.card { position: relative; border-radius: var(--r-card); transition: box-shadow 0.2s ease; }
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--sheen-1), var(--sheen-2));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card > * { position: relative; z-index: 1; }
a.card:hover::before, .card--hover:hover::before { opacity: 1; }
a.card:hover, .card--hover:hover { box-shadow: inset 0 1px 0 var(--lift-hi), 0 22px 44px -20px var(--lift-drop); }

/* ---- nav (the app's titlebar, full width) ---------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-width: 0 0 1px 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.wordmark { display: flex; align-items: baseline; gap: 6px; }
.wordmark-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.wordmark-by { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.wordmark-by a { transition: color 0.15s ease; }
.wordmark-by a:hover { color: var(--accent-2); }
.nav-links { display: flex; align-items: center; gap: 6px; }

/* the app's top-bar button: a small bordered pill, pictogram then a mono label */
.ui-pic { display: block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.pill {
  height: 26px;
  min-width: 26px;
  padding: 0 9px 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.pill .ui-pic { font-size: 14px; }
.pill:hover { color: var(--ink); background: var(--hover-tint); }
.pill:active { transform: scale(0.97); }
.pill:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.pill--accent { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill--accent .ui-pic { color: var(--accent-2); }
.pill--accent:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
/* the theme pill shows the mode you are in, as the app's does */
.ic-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .ic-moon { display: none; }
  :root:not([data-theme="dark"]) .ic-sun { display: block; }
}
:root[data-theme="light"] .ic-moon { display: none; }
:root[data-theme="light"] .ic-sun { display: block; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }

/* ---- buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-ctl);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), filter 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border: 1px solid var(--line); background: var(--btn-fill); }
.btn--ghost:hover { border-color: var(--accent-2); background: var(--btn-fill-hover); }

.iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.iconbtn:hover { color: var(--ink); background: var(--hover-tint); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn svg { width: 16px; height: 16px; grid-area: 1 / 1; transition: opacity 0.25s ease, transform 0.35s var(--ease); }
/* Theme toggle shows the theme in effect: sun in light, moon in dark. */
.theme-moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
:root[data-theme="dark"] .theme-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
:root[data-theme="dark"] .theme-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
  :root:not([data-theme="light"]) .theme-moon { opacity: 1; transform: none; }
}

/* ---- chips: status, mono, flat --------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-chip);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
}
/* Status text mixes toward the ink so small text keeps AA contrast. */
.chip--good { color: color-mix(in srgb, var(--good) 70%, var(--ink)); background: color-mix(in srgb, var(--good) 14%, transparent); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.chip--warn { color: color-mix(in srgb, var(--warning) 70%, var(--ink)); background: color-mix(in srgb, var(--warning) 14%, transparent); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.chip--crit { color: color-mix(in srgb, var(--critical) 70%, var(--ink)); background: color-mix(in srgb, var(--critical) 14%, transparent); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }

/* ---- segmented control + code box ------------------------------------ */

.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--btn-fill); }
.seg button {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.seg img { width: 15px; height: 15px; object-fit: contain; }

.codebox {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 8px 0 18px;
  border-radius: var(--r-card);
  font-family: var(--font-mono);
  font-size: 13px;
}
.codebox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-family: inherit; }
.codebox code::-webkit-scrollbar { display: none; }
.codebox .prompt { color: var(--accent-2); user-select: none; margin-right: 8px; }
.codebox .iconbtn .icon-check { opacity: 0; transform: scale(0.5); color: var(--good); }
.codebox .is-copied .icon-copy { opacity: 0; transform: scale(0.5); }
.codebox .is-copied .icon-check { opacity: 1; transform: none; }

/* ---- window: the app's frame, for redrawn UI components --------------- */

.window { border-radius: var(--r-win); overflow: hidden; }
.titlebar {
  height: 46px;
  padding-inline: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.titlebar .mono { font-size: 11px; color: var(--muted); }

/* ---- row: the app's alert row ---------------------------------------- */

.row {
  display: grid;
  grid-template-columns: 70px 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.row:first-child { border-top: 0; }
.row time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.row .target { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.row .target b { font-weight: 600; color: var(--ink); }
.actor { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
/* Brand marks are drawn as masks, so one file reads in both themes. */
.actor-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: var(--ink);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  opacity: 0.85;
}

/* Real brand logos, in full colour, on a small white tile (like an app icon)
   so dark logos stay visible in both themes. */
.actor-logo {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 7px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 44, 0.1);
  object-fit: contain;
}
.logo-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 44, 0.1), 0 1px 2px rgba(16, 24, 44, 0.14);
}
.logo-chip img { width: 26px; height: 26px; object-fit: contain; }

/* ---- emblem: the app's card artwork, luminance mask over accent ------- */

.emblem {
  position: absolute;
  pointer-events: none;
  opacity: var(--emblem-opacity);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}

/* ---- motion ----------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- dev-only theme switch (created by next.js on local hosts) -------- */

.dev-theme {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  padding: 7px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--canvas);
  border: 1px dashed var(--line);
}
.dev-theme:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .nav-links .pill:not(.pill--accent) > span { display: none; }
  .nav-links .pill:not(.pill--accent) { padding: 0; }
}
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .row time { grid-column: 1; }
  .row .actor { grid-column: 1; }
  .row .target { grid-column: 1; }
  .row .chip { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* Visually hidden, still read by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
