/* exbye.work — design tokens & component primitives
 *
 * Neutral, information-dense visual system aligned with ai-news-refiner:
 * white canvas, fine borders, compact typography and restrained shadows.
 */

/* ───────── LIGHT (default — neutral canvas) ───────── */
:root,
:root[data-theme="light"] {
  /* Surfaces */
  --bg:        #ffffff;
  --bg-2:      #f8fafc;
  --surface:   #fbfbfc;
  --surface-2: #f4f4f5;
  --hover:     #f4f4f5;
  --inset:     #f8fafc;
  --border:    rgba(24, 24, 27, .10);
  --border-2:  rgba(24, 24, 27, .16);

  /* Text */
  --fg:    #18181b;
  --fg-2:  #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --sage:  #667085;

  /* Brand + semantics */
  --ok:        #18181b;
  --ok-bg:     #e4e4e7;
  --ok-text:   #0f766e;
  --sub:       #475569;
  --sub-bg:    #e2e8f0;
  --mine:      #a16207;
  --mine-bg:   #fef3c7;
  --danger:    #dc2626;
  --danger-bg: #fee2e2;

  /* Quiet card family: mostly neutral with small semantic differences */
  --card-teal:     #f3faf8;
  --card-teal-fg:  #0f766e;
  --card-amber:    #faf7ed;
  --card-amber-fg: #92400e;
  --card-sky:      #f4f8fb;
  --card-sky-fg:   #075985;
  --card-pink:     #faf6f8;
  --card-pink-fg:  #9f1239;
  --card-violet:   #f7f6fb;
  --card-violet-fg:#5b21b6;
  --card-emerald:  #f3faf6;
  --card-emerald-fg:#047857;
  --card-sage:     #f6f8f4;
  --card-sage-fg:  #4d5f48;

  /* Fine, utility-style shadows */
  --shadow-sm:  0 1px 2px rgba(24, 24, 27, .04);
  --shadow-md:  0 1px 3px rgba(24, 24, 27, .06), 0 1px 2px rgba(24, 24, 27, .04);
  --shadow-lg:  0 10px 24px -18px rgba(24, 24, 27, .24);
  --shadow-xl:  0 18px 36px -28px rgba(24, 24, 27, .30);
  --shadow-menu:  var(--shadow-lg);
  --shadow-toast: var(--shadow-lg);

  --header-bg: rgba(255, 255, 255, .86);
  --toast-bg:  #18181b;
  --toast-fg:  #ffffff;

  color-scheme: light;
}

/* ───────── DARK (parity — neutral canvas) ───────── */
:root[data-theme="dark"] {
  --bg:        #111113;
  --bg-2:      #18181b;
  --surface:   #1d1d20;
  --surface-2: #242428;
  --hover:     #27272a;
  --inset:     #18181b;
  --border:    rgba(255, 255, 255, .10);
  --border-2:  rgba(255, 255, 255, .16);

  --fg:    #f4f4f5;
  --fg-2:  #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --sage:  #a1a1aa;

  --ok:        #f4f4f5;
  --ok-bg:     rgba(244, 244, 245, .13);
  --ok-text:   #5eead4;
  --sub:       #cbd5e1;
  --sub-bg:    rgba(203, 213, 225, .13);
  --mine:      #facc15;
  --mine-bg:   rgba(250, 204, 21, .14);
  --danger:    #f87171;
  --danger-bg: rgba(248, 113, 113, .14);

  --card-teal:     rgba(20, 184, 166, .10);
  --card-teal-fg:  #99f6e4;
  --card-amber:    rgba(245, 158, 11, .10);
  --card-amber-fg: #fcd34d;
  --card-sky:      rgba(56, 189, 248, .10);
  --card-sky-fg:   #7dd3fc;
  --card-pink:     rgba(244, 114, 182, .10);
  --card-pink-fg:  #f9a8d4;
  --card-violet:   rgba(167, 139, 250, .10);
  --card-violet-fg:#c4b5fd;
  --card-emerald:  rgba(52, 211, 153, .10);
  --card-emerald-fg:#6ee7b7;
  --card-sage:     rgba(161, 161, 170, .10);
  --card-sage-fg:  #d4d4d8;

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, .28);
  --shadow-md:  0 1px 3px rgba(0, 0, 0, .36), 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-lg:  0 12px 26px -18px rgba(0, 0, 0, .72);
  --shadow-xl:  0 18px 42px -28px rgba(0, 0, 0, .82);
  --shadow-menu:  var(--shadow-lg);
  --shadow-toast: var(--shadow-lg);

  --header-bg: rgba(17, 17, 19, .86);
  --toast-bg:  #f4f4f5;
  --toast-fg:  #111113;

  color-scheme: dark;
}

/* ───────── Compatibility aliases (older inline styles keep working) ───────── */
:root {
  --bg-elev:     var(--surface);
  --bg-sunk:     var(--bg-2);
  --bg-alt:      var(--hover);
  --panel:       var(--surface);
  --fg-muted:    var(--fg-2);
  --fg-faint:    var(--muted);
  --fg-dim:      var(--faint);
  --line:        var(--border);
  --line-soft:   var(--border);
  --line-strong: var(--border-2);
  --line-bright: var(--border-2);
  --accent:      var(--ok);
  --accent-2:    var(--ok-bg);
  --accent-ink:  var(--surface);
  --grid-major:  transparent;
  --grid-minor:  transparent;
  --scan:        none;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-2xl: 16px;
}

/* ───────── Fonts & base ─────────
   思源黑体 / Source Han Sans / Noto Sans CJK SC
   Web 字重通过 fontsource (jsDelivr) 提供；优先使用系统中已安装的
   思源黑体 / Source Han Sans / Noto Sans CJK 本地副本以省去下载。 */
@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    local("Source Han Sans SC Regular"),
    local("Source Han Sans SC"),
    local("SourceHanSansSC-Regular"),
    local("Noto Sans CJK SC Regular"),
    local("NotoSansCJKsc-Regular"),
    local("Noto Sans SC Regular"),
    local("NotoSansSC-Regular"),
    url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-sc@5/files/noto-sans-sc-chinese-simplified-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src:
    local("Source Han Sans SC Medium"),
    local("SourceHanSansSC-Medium"),
    local("Noto Sans CJK SC Medium"),
    local("NotoSansCJKsc-Medium"),
    local("Noto Sans SC Medium"),
    local("NotoSansSC-Medium"),
    url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-sc@5/files/noto-sans-sc-chinese-simplified-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src:
    local("Source Han Sans SC Bold"),
    local("SourceHanSansSC-Bold"),
    local("Noto Sans CJK SC Bold"),
    local("NotoSansCJKsc-Bold"),
    local("Noto Sans SC Bold"),
    local("NotoSansSC-Bold"),
    url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-sc@5/files/noto-sans-sc-chinese-simplified-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src:
    local("Source Han Sans SC Bold"),
    local("SourceHanSansSC-Bold"),
    local("Noto Sans CJK SC Bold"),
    local("NotoSansCJKsc-Bold"),
    local("Noto Sans SC Bold"),
    local("NotoSansSC-Bold"),
    url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-sc@5/files/noto-sans-sc-chinese-simplified-700-normal.woff2") format("woff2");
}

:root {
  --f-sans: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans",
            "思源黑体", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont,
            "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei",
            system-ui, sans-serif;
  --f-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --f-display: var(--f-sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum", "ss01";
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: default; background: none; border: none; padding: 0; color: inherit; }
input, textarea, select { font: inherit; }
::selection { background: var(--ok); color: var(--surface); }
html[data-i18n-pending="1"] [data-i18n],
html[data-i18n-pending="1"] [data-i18n] *,
html[data-i18n-pending="1"] [data-i18n-placeholder]::placeholder {
  color: transparent !important;
}

/* ───────── Display & type ───────── */
.h-display {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 60px;
  line-height: 1.06;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--fg);
  max-width: 100%;
  overflow-wrap: break-word;
}
.h-display em {
  font-style: normal;
  color: var(--ok-text);
  background: linear-gradient(transparent 64%, color-mix(in oklab, var(--ok-text) 18%, transparent) 64%);
}
.h-section {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--fg);
}
.h-card {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-2);
  letter-spacing: 0;
  margin: 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-sans);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
}
.eyebrow .bar {
  display: inline-block;
  width: 22px; height: 2px;
  background: var(--ok);
  border-radius: 1px;
}
.caret { display: none; }
.mono {
  font-family: var(--f-mono);
  font-size: 13.5px;
  letter-spacing: 0;
  font-feature-settings: "tnum";
  text-transform: none;
}

/* ───────── Layout ───────── */
.section {
  padding: 52px 24px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.section.tight   { padding: 28px 24px; }
.section.compact { padding: 24px 20px; }
.section.wide { max-width: 1160px; }
.section.flush-top { padding-top: 20px; }

/* ───────── Nav ───────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 color-mix(in oklab, var(--border) 60%, transparent);
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600;
  letter-spacing: 0; color: var(--fg);
}
.nav-logo .dot {
  width: 9px; height: 9px; background: var(--ok);
  display: inline-block; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.nav-logo .tld { color: var(--muted); font-weight: 400; }
.nav-left  { display: flex; align-items: center; gap: 18px; }
.nav-links { display: flex; align-items: center; gap: 2px; font-size: 15px; }
.nav-links a {
  color: var(--fg-2); padding: 7px 10px; border-radius: var(--r-md);
  transition: background .15s, color .15s;
}
.nav-links a {
  position: relative;
}
.nav-links a.active { color: var(--fg); background: var(--hover); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 2px;
  height: 2px; border-radius: 1px;
  background: var(--ok);
}
.nav-links a:hover  { color: var(--fg); background: var(--hover); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--f-mono); font-size: 12.5px;
  color: var(--muted); background: var(--surface);
}
.pill .on  { color: var(--fg); }
.pill .sep { color: var(--faint); }
.pill:hover { border-color: var(--border-2); }
.pill[data-toggle],
.pill[role="button"],
a.pill {
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
}
.pill[data-toggle]:hover,
.pill[role="button"]:hover,
a.pill:hover {
  color: var(--fg);
  background: var(--hover);
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.pill[data-toggle]:active,
.pill[role="button"]:active,
a.pill:active {
  transform: translateY(1px);
}
.pill[data-toggle]:focus-visible,
.pill[role="button"]:focus-visible,
a.pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow-sm);
}

/* ───────── HUD / decorative strip — hidden in this system ───────── */
.hud-strip { display: none; }

/* ───────── Footer ───────── */
.foot {
  display: flex;
  align-items: flex-start;
  padding: 40px 24px 32px;
  max-width: 1120px; margin: 48px auto 0;
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--fg-2);
  gap: 24px 36px;
}
.foot::before { display: none; }
.foot-group {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 36px;
  min-width: 0;
}
.foot-group.right {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}
.foot .col {
  display: flex;
  flex: 0 1 220px;
  max-width: 280px;
  flex-direction: column;
  gap: 4px;
}
.foot .col-label {
  color: var(--sage); margin-bottom: 8px; font-size: 13px;
  font-weight: 500;
}
.foot .col.right { text-align: right; align-items: flex-end; }

/* ───────── Status indicator ───────── */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--fg-2);
}
.status .d {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); display: inline-block;
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.status.idle { color: var(--muted); }
.status.idle .d {
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--faint) 25%, transparent);
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 500;
  height: 38px;
  transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--hover); border-color: var(--border-2); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow-md);
}
.btn.primary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--fg) 96%, var(--bg)) 0%, var(--fg) 100%);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 600;
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in oklab, var(--bg) 18%, transparent);
}
.btn.primary:hover {
  background: var(--fg-2);
  border-color: var(--fg-2);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in oklab, var(--bg) 22%, transparent);
}
.btn.primary:active {
  background: color-mix(in oklab, var(--fg) 84%, var(--bg));
  border-color: color-mix(in oklab, var(--fg) 84%, var(--bg));
}
.btn.primary:focus-visible {
  box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow-lg), inset 0 1px 0 color-mix(in oklab, var(--bg) 22%, transparent);
}
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); box-shadow: none; }
.btn.dark {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
.btn.dark:hover { background: var(--fg-2); border-color: var(--fg-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: var(--r-md); }
.btn.lg { height: 42px; padding: 0 16px; font-size: 15px; border-radius: var(--r-md); }
.product-visit-btn {
  max-width: 100%;
  min-height: 42px;
  height: auto;
  padding-block: 8px;
  text-align: left;
  line-height: 1.35;
  vertical-align: top;
  overflow-wrap: anywhere;
  transform: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn.primary.product-visit-btn {
  background-color: var(--fg);
  background-image: none;
  border-color: var(--fg);
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in oklab, var(--bg) 18%, transparent);
}
.btn.primary.product-visit-btn:hover {
  background-color: color-mix(in oklab, var(--fg) 92%, var(--bg));
  border-color: color-mix(in oklab, var(--fg) 92%, var(--bg));
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in oklab, var(--bg) 18%, transparent);
  transform: none;
}
.btn.primary.product-visit-btn:active {
  background-color: color-mix(in oklab, var(--fg) 86%, var(--bg));
  border-color: color-mix(in oklab, var(--fg) 86%, var(--bg));
  box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in oklab, var(--bg) 14%, transparent);
  transform: none;
}
.btn.primary.product-visit-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow-md), inset 0 1px 0 color-mix(in oklab, var(--bg) 18%, transparent);
}

/* ───────── Form ───────── */
.label {
  display: block;
  font-size: 14px;
  color: var(--fg-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.label::before { display: none; }
.input, .ta {
  display: block; width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--fg);
  font-size: 15px;
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.input { height: 42px; }
.ta { padding: 12px 14px; line-height: 1.55; resize: vertical; min-height: 140px; }
.input:focus, .ta:focus {
  outline: none;
  border-color: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow-sm);
}

/* ───────── Arrow link ───────── */
.arrow-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg);
  font-size: 15px; font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-2);
  transition: gap .15s, border-color .15s, color .15s;
}
.arrow-link:hover { gap: 12px; border-color: var(--ok); color: var(--ok-text); border-bottom-width: 2px; padding-bottom: 3px; }
.arrow-link svg { width: 12px; height: 12px; }

/* ───────── Cards ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s, background .2s;
}
.card:hover {
  border-color: color-mix(in oklab, var(--ok) 30%, var(--border-2));
  box-shadow: var(--shadow-lg);
}
a.card { display: block; color: inherit; }
a.card:hover { transform: translateY(-2px); }

/* Pastel card variants */
.card-teal    { background: var(--card-teal);    color: var(--card-teal-fg); }
.card-amber   { background: var(--card-amber);   color: var(--card-amber-fg); }
.card-sky     { background: var(--card-sky);     color: var(--card-sky-fg); }
.card-pink    { background: var(--card-pink);    color: var(--card-pink-fg); }
.card-violet  { background: var(--card-violet);  color: var(--card-violet-fg); }
.card-emerald { background: var(--card-emerald); color: var(--card-emerald-fg); }
.card-sage    { background: var(--card-sage);    color: var(--card-sage-fg); }
.card-dark    { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.card-dark .lede,
.card-dark .h-card { color: var(--bg); }

/* ───────── Cover (image container) ───────── */
.cover {
  position: relative; width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: flex-end; padding: 12px;
  border-radius: var(--r-xl);
}
.cover::before, .cover::after { display: none; }
.cover .icon-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--surface) 86%, var(--bg));
  color: var(--fg);
  font-size: 26px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cover .icon-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}

/* Decorative corner crops — disabled */
.corners { position: relative; }
.corners::before, .corners::after { display: none; }
.crosshair { display: none; }
.wireframe { display: none; }

/* ───────── Section header ───────── */
.sec-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 22px;
  padding-left: 14px;
  position: relative;
  gap: 16px;
}
.sec-header::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--ok);
  border-radius: 2px;
}
.sec-header .left  { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sec-header .tag   {
  color: var(--sage); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.sec-header .title {
  color: var(--fg);
  font-size: 26px; font-weight: 600; letter-spacing: -0.012em;
}
.sec-header .tail  { color: var(--muted); font-size: 14px; }

/* ───────── Tile grid ───────── */
.tile-grid {
  display: grid; gap: 14px;
}
.cms-card-grid {
  grid-template-columns: repeat(var(--cms-cols, 3), minmax(0, 1fr));
}
.tile {
  position: relative; display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  min-height: 180px;
  box-shadow: var(--shadow-sm);
}
.tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--ok);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
  z-index: 2;
}
.tile:hover {
  border-color: color-mix(in oklab, var(--ok) 26%, var(--border-2));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.tile:hover::after { transform: scaleX(1); }
.tile .tile-bg { display: none; }
.tile .tile-top, .tile .tile-bot { position: relative; z-index: 1; }
.tile .tile-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 36px;
}
.tile .badge {
  font-family: var(--f-mono); font-size: 12.5px;
  background: var(--surface-2);
  padding: 4px 10px;
  color: var(--fg-2);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.tile h3 {
  font-family: var(--f-display); font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--fg);
}
.tile.big h3 { font-size: 24px; }
.tile p {
  margin: 0; color: var(--fg-2); font-size: 15.5px;
  line-height: 1.55; max-width: 420px;
}
.tile-meta {
  font-size: 14px; color: var(--muted);
  margin-bottom: 8px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
}
.tile-meta .sep { color: var(--faint); }
.tile-meta .url { color: var(--ok-text); font-family: var(--f-mono); font-size: 13.5px; }

/* ───────── Index list rows ───────── */
.idx-row {
  display: grid; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background .12s;
  border-radius: var(--r-md);
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
}
.idx-row:hover { background: var(--hover); }
.idx-row .arrow { color: var(--muted); }

/* ───────── Product narrative primitives ───────── */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, .96fr);
  gap: 40px;
  align-items: start;
}
.hero-copy { max-width: 720px; }
.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}
.system-panel {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border-radius: var(--r-2xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--card-teal) 58%, var(--surface)) 0%, var(--surface) 52%, color-mix(in oklab, var(--card-sage) 58%, var(--surface)) 100%);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.system-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(24, 24, 27, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 24, 27, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,.10));
  pointer-events: none;
}
:root[data-theme="dark"] .system-panel::before {
  background-image:
    linear-gradient(to right, rgba(248, 250, 252, .04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(248, 250, 252, .04) 1px, transparent 1px);
}
.system-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.signal-mark {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--fg);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}
.signal-mark svg {
  width: 23px;
  height: 23px;
}
.metric-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}
.metric {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .68);
  border-radius: var(--r-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .metric { background: rgba(29, 29, 32, .72); }
.metric b {
  display: block;
  font-size: 21px;
  line-height: 1;
  color: var(--fg);
  font-weight: 600;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.event-feed {
  position: relative;
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
.event {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .72);
  border-radius: var(--r-lg);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .event { background: rgba(29, 29, 32, .78); }
.event .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-bg);
}
.event strong {
  display: block;
  font-size: 14px;
  color: var(--fg);
}
.event small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.event code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--sage);
}
.mini-products {
  position: relative;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mini-product {
  min-height: 84px;
  border-radius: var(--r-lg);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mini-product b {
  font-size: 15.5px;
  color: inherit;
}
.mini-product span {
  font-size: 13px;
  color: inherit;
  opacity: .72;
}
.section-kicker {
  color: var(--sage);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.section-intro {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, .7fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}
.section-intro p {
  margin: 0;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
}
.product-showcase,
.matrix-grid {
  display: grid;
  gap: 14px;
}
.product-showcase.is-grid,
.matrix-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}
.product-showcase.is-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin-inline: auto;
}
.card.product-feature-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--fg);
}
.product-feature-media {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.product-feature-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.product-feature-placeholder {
  min-height: 100%;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: inherit;
}
.product-feature-placeholder .mark {
  width: 64px;
  height: 64px;
}
.product-feature-copy {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.product-feature-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.product-empty-card .tag {
  font-size: 13px;
  color: inherit;
  opacity: .72;
}
.product-feature-copy .mark,
.product-feature-placeholder .mark,
.product-empty-card .mark {
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  color: inherit;
  border: 1px solid var(--border);
  overflow: hidden;
}
.product-feature-copy .mark,
.product-empty-card .mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}
.product-feature-card .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.product-feature-card svg,
.product-empty-card svg {
  width: 18px;
  height: 18px;
}
.product-feature-card .h-card {
  color: var(--fg);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: 0;
}
.product-feature-card .product-subtitle {
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.48;
}
.product-feature-card .product-desc {
  margin: 0;
  color: var(--fg-2);
  font-size: 15.5px;
  line-height: 1.62;
  display: grid;
  gap: 9px;
}
.product-feature-card .product-desc p {
  margin: 0;
}
.product-feature-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--fg-2);
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.35;
}
.product-feature-footer strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  opacity: .72;
}
.product-feature-footer svg {
  width: 13px;
  height: 13px;
}
.product-empty-card {
  min-height: 230px;
  display: grid;
  gap: 20px;
  align-content: space-between;
}
.product-card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
}
.product-card.featured {
  grid-column: span 2;
  min-height: 360px;
}
.product-card.has-cover {
  min-height: 340px;
}
.product-card-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklab, currentColor 14%, transparent);
  background: rgba(255,255,255,.52);
}
.product-card-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.product-card .topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.product-card .tag {
  font-size: 13px;
  color: inherit;
  opacity: .72;
}
.product-card .mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.62);
  color: inherit;
  border: 1px solid rgba(255,255,255,.42);
}
.product-card svg {
  width: 18px;
  height: 18px;
}
.product-card .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.product-card p {
  margin: 8px 0 0;
  font-size: 15.5px;
  line-height: 1.58;
  color: inherit;
  opacity: .83;
}
.product-main {
  display: grid;
  gap: 8px;
}
.product-card .product-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: inherit;
  opacity: .72;
}
.product-card .product-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: inherit;
  opacity: .86;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.product-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in oklab, currentColor 18%, transparent);
  border-radius: 999px;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  opacity: .78;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  color: inherit;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.35;
  opacity: .74;
}
.product-footer span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-footer svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stack-card {
  min-height: 150px;
  display: grid;
  gap: 14px;
  align-content: space-between;
}
.stack-card svg {
  width: 18px;
  height: 18px;
}
.feature-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.feature-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--fg-2);
  font-size: 15px;
}
.feature-item .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-family: var(--f-mono);
  font-size: 13px;
}
.service-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 14px;
  align-items: stretch;
}
.service-panel .card-dark {
  min-height: 360px;
}
.quote-grid {
  display: grid;
  grid-template-columns: .82fr 1.36fr .82fr;
  gap: 14px;
  align-items: stretch;
}
.quote-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quote-card blockquote {
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.6;
}
.quote-card .person {
  margin-top: 20px;
  font-size: 14px;
  color: inherit;
  opacity: .72;
}
.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 24px;
  align-items: center;
}
.contact-band .channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.channel-pill {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--surface) 84%, var(--bg));
  padding: 12px 14px;
  color: var(--fg-2);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.channel-pill strong {
  display: block;
  color: var(--fg);
  margin-bottom: 4px;
  font-size: 15px;
}

/* ───────── Alert ───────── */
.alert {
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 15px;
  border-radius: var(--r-md);
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}
.alert.error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.alert.ok    { border-color: var(--ok);     background: var(--ok-bg);     color: var(--ok-text); }

/* ───────── Admin shell ───────── */
.admin-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.admin-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}
.admin-nav .left  { display: flex; align-items: center; gap: 18px; }
.admin-nav .tabs  { display: flex; gap: 4px; margin-left: 10px; }
.admin-nav .tabs a {
  padding: 7px 13px;
  border-radius: var(--r-md);
  font-size: 14.5px; color: var(--fg-2);
}
.admin-nav .tabs .tab-separator {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 8px;
  user-select: none;
}
.admin-nav .tabs a.active {
  background: var(--hover); color: var(--fg);
}
.admin-nav .right { display: flex; align-items: center; gap: 14px; }
.admin-foot {
  display: flex; justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 13.5px; color: var(--muted);
}

/* ───────── Scrollbar ───────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .nav, .foot, .section { padding-left: 18px; padding-right: 18px; }
  .nav-links { display: none; }
  .nav-left { gap: 12px; }
  .foot { gap: 22px 28px; }
  .foot-group { flex: 1 1 0; gap: 22px 28px; }
  .foot-group.right { flex: 1 1 0; }
  .foot .col { flex-basis: calc(50% - 14px); max-width: none; }
  .section { padding-top: 44px; padding-bottom: 44px; }
  .hero-grid,
  .section-intro,
  .service-panel,
  .contact-band {
    grid-template-columns: 1fr;
  }
  .system-panel { min-height: auto; }
  .matrix-grid,
  .stack-grid,
  .quote-grid {
    grid-template-columns: 1fr;
  }
  .product-feature-card {
    min-height: auto;
  }
  .product-feature-media {
    min-height: auto;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .product-feature-copy {
    padding: 22px;
  }
  .cms-card-grid,
  .cms-contact-channels {
    grid-template-columns: 1fr !important;
  }
  .product-card.featured { grid-column: span 1; }
  .h-display { font-size: 46px; }
  .h-section { font-size: 30px; }
}
@media (max-width: 600px) {
  .foot { flex-direction: column; }
  .foot-group,
  .foot-group.right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .foot .col { flex-basis: auto; width: 100%; }
  .foot .col.right { text-align: left; align-items: flex-start; }
  .section { padding-top: 34px; padding-bottom: 34px; }
  body { overflow-x: hidden; }
  .nav { padding-left: 16px; padding-right: 16px; }
  .nav-right a.pill { display: none; }
  .h-display { font-size: 36px; }
  .h-section { font-size: 26px; }
  .metric-row,
  .mini-products,
  .contact-band .channels {
    grid-template-columns: 1fr;
  }
  .system-panel { padding: 16px; border-radius: var(--r-xl); }
  .event { grid-template-columns: 8px 1fr; }
  .event code { display: none; }
}

/* ───────── Motion ───────── */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
