/* ============================================================
   TongdaAI website — shared styles
   Direction: modern-minimal (Linear/Vercel/Notion posture)
   Brand: TongdaAI 蓝色龙虾  primary #1E6FE8
   ============================================================ */

:root {
  /* light tokens */
  --bg:        #ffffff;
  --bg-soft:   #f7f9fc;
  --surface:   #ffffff;
  --fg:        #0a0e1a;
  --fg-soft:   #2a3247;
  --muted:     #5b6478;
  --border:    #e4e9f2;
  --border-strong: #c8d1e0;
  --accent:    #1e6fe8;
  --accent-hover: #0b3fb2;
  --accent-soft: #e8f0fe;
  --cyan:      #00b8d4;
  --success:   #10b981;
  --shadow-sm: 0 1px 2px rgba(10, 14, 26, .04);
  --shadow-md: 0 4px 16px rgba(10, 14, 26, .06);
  --shadow-lg: 0 24px 64px -16px rgba(30, 111, 232, .15);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --container: 1200px;
  --nav-h: 64px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:        #0a0e1a;
  --bg-soft:   #0f1422;
  --surface:   #11172a;
  --fg:        #f5f7fa;
  --fg-soft:   #d5dceb;
  --muted:     #a0aec5;
  --border:    #1a2233;
  --border-strong: #2a3450;
  --accent:    #4a93ff;
  --accent-hover: #6cb8ff;
  --accent-soft: #122550;
  --cyan:      #22d3ee;
  --success:   #34d399;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 64px -16px rgba(74,147,255,.25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:        #0a0e1a;
    --bg-soft:   #0f1422;
    --surface:   #11172a;
    --fg:        #f5f7fa;
    --fg-soft:   #d5dceb;
    --muted:     #a0aec5;
    --border:    #1a2233;
    --border-strong: #2a3450;
    --accent:    #4a93ff;
    --accent-hover: #6cb8ff;
    --accent-soft: #122550;
    --cyan:      #22d3ee;
    --success:   #34d399;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 64px -16px rgba(74,147,255,.25);
    color-scheme: dark;
  }
}

/* ------- reset / base ------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  letter-spacing: -0.005em;
  font-feature-settings: "cv11", "ss01", "ss03";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* lang visibility */
:root[data-lang="zh"] [data-en] { display: none !important; }
:root[data-lang="en"] [data-zh] { display: none !important; }
:root:not([data-lang]) [data-en] { display: none !important; } /* default zh */

/* ------- type scale ------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 16px;
}
h1, h2, h3, h4 { color: var(--fg); margin: 0 0 16px; letter-spacing: -0.02em; }
.h-display {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}
.h-section {
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}
.h-card {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}
.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 64ch;
  text-wrap: pretty;
}
p { color: var(--fg-soft); }
.numeric { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ------- layout ------- */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ------- nav ------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 20px;
  max-width: var(--container); margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; flex-shrink: 0; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a {
  padding: 7px 10px; border-radius: 6px;
  font-size: 13.5px; color: var(--muted); transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--fg); background: var(--bg-soft); }
.nav-links a.is-active { color: var(--fg); font-weight: 500; }
.nav-utils { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); transition: all .15s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); background: var(--bg-soft); }
.lang-toggle {
  font-family: var(--font-mono); font-size: 12px; padding: 0 10px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 4px;
}
.lang-toggle:hover { color: var(--fg); border-color: var(--border-strong); }
.lang-toggle b { color: var(--fg); font-weight: 500; }

/* ------- mobile nav drawer ------- */
/* desktop: .nav-drawer is layout-transparent; its children participate in nav-inner flex */
.nav-drawer { display: contents; }
.menu-btn {
  display: none; /* shown ≤820px */
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--fg);
  margin-left: auto;
  position: relative; z-index: 65; /* above drawer (60) so X stays clickable when open */
  transition: background .15s, border-color .15s;
}
.menu-btn:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.menu-btn svg { width: 18px; height: 18px; }
.menu-btn .icon-close { display: none; }
:root[data-nav="open"] .menu-btn .icon-open { display: none; }
:root[data-nav="open"] .menu-btn .icon-close { display: block; }
.nav-backdrop { display: none; }

@media (max-width: 820px) {
  .nav-inner { gap: 12px; }
  .menu-btn { display: inline-flex; }

  /* drawer slides in from right; lives on top of page.
     Sized to viewport (100dvh) and laid out so the menu fills naturally,
     utils pinned to the bottom — no scrollbar at any breakpoint. */
  .nav-drawer {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: calc(var(--nav-h) + 10px) 20px 18px;
    transform: translateX(100%);
    transition: transform .28s ease;
    z-index: 60;
    overflow: hidden;
    box-shadow: -16px 0 40px rgba(10,14,26,.18);
  }
  :root[data-nav="open"] .nav-drawer { transform: translateX(0); }

  /* nav-links: natural compact height — items do NOT stretch to fill drawer */
  .nav-drawer .nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
  }
  .nav-drawer .nav-links a {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--fg-soft);
    display: flex;
    align-items: center;
    height: 36px;
    flex: 0 0 auto;
  }
  .nav-drawer .nav-links a:hover,
  .nav-drawer .nav-links a.is-active { background: var(--bg-soft); color: var(--fg); }

  /* nav-utils: horizontal row pinned to bottom via margin-top:auto */
  .nav-drawer .nav-utils {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: auto;
    flex: 0 0 auto;
  }
  .nav-drawer .nav-utils .lang-toggle,
  .nav-drawer .nav-utils .icon-btn {
    height: 38px; width: 38px;
    flex: 0 0 auto;
  }
  .nav-drawer .nav-utils .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 13.5px;
    padding: 10px 12px;
  }

  /* backdrop */
  .nav-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(10, 14, 26, .42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 55;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  :root[data-nav="open"] .nav-backdrop { opacity: 1; pointer-events: auto; }
  :root[data-nav="open"] { overflow: hidden; }
}

/* ------- buttons ------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  border: 1px solid transparent; transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: var(--surface); color: var(--fg); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-soft); }
.btn-ghost {
  background: transparent; color: var(--fg); border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 10px; }
.btn .arrow-out { width: 13px; height: 13px; opacity: .9; }
.btn .arrow-down { width: 14px; height: 14px; }

/* ------- card ------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--border-strong); }
.card-mini { padding: 20px; border-radius: var(--radius-sm); }
.card-feature {
  display: flex; flex-direction: column; gap: 16px;
}
.card-feature .glyph {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--accent-soft);
  color: var(--accent);
}
.card-feature .glyph svg { width: 20px; height: 20px; }

/* ------- badges + pills ------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.pill-success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ------- footer ------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 72px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 48px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 32px 28px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
.footer h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 18px; font-weight: 500;
  font-family: var(--font-mono);
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { font-size: 14px; color: var(--fg-soft); transition: color .15s; }
.footer ul a:hover { color: var(--accent); }
.footer-bot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); margin-top: 56px; padding-top: 24px;
  font-size: 13px; color: var(--muted);
}
@media (max-width: 600px) { .footer-bot { flex-direction: column; gap: 12px; } }

/* ------- hero ------- */
.hero { padding: clamp(56px, 8vw, 96px) 0 0; position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 0%, var(--bg) 90%);
}
.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 30%, transparent 70%);
  opacity: .5;
}
.hero-inner { text-align: center; max-width: 920px; margin: 0 auto; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-left: auto; margin-right: auto; margin-bottom: 36px; }
.hero-ctas { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
  margin-top: 28px; font-size: 13px; color: var(--muted);
  font-family: var(--font-mono);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* product mock */
.product-mock {
  margin: 64px auto 0; max-width: 1080px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; }
.window-dots span:nth-child(1) { background: #ff5f57; }
.window-dots span:nth-child(2) { background: #febc2e; }
.window-dots span:nth-child(3) { background: #28c840; }
.window-title { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-left: 8px; }

.mock-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 460px;
}
.mock-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px;
}
.mock-sidebar .item {
  padding: 8px 10px; border-radius: 6px; color: var(--fg-soft);
  display: flex; align-items: center; gap: 8px;
}
.mock-sidebar .item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.mock-sidebar .item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.mock-sidebar .item.active .dot { background: var(--accent); }
.mock-sidebar .group-label { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 4px; }

.mock-main { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; min-width: 0; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { background: var(--bg-soft); color: var(--fg-soft); border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.msg.assistant .tool-call {
  margin-top: 10px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: flex-start; gap: 6px;
  flex-wrap: wrap; min-width: 0;
  overflow-wrap: anywhere; word-break: break-word;
}
.msg.assistant .tool-call > svg,
.msg.assistant .tool-call > span:not(.typing) { flex-shrink: 0; }
.msg.assistant .tool-call .check { color: var(--success); margin-top: 2px; }

.typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 700px) {
  .mock-body { grid-template-columns: 1fr; }
  .mock-sidebar { display: none; }
}

/* ------- scenario carousel ------- */
.scenario-rail {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  margin: 0 -24px; padding-left: 24px; padding-right: 24px;
  scrollbar-width: thin;
}
.scenario-rail::-webkit-scrollbar { height: 6px; }
.scenario-rail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.scenario-card {
  scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.scenario-thumb {
  aspect-ratio: 16/9;
  background:
    radial-gradient(60% 80% at 30% 20%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  position: relative;
}
.scenario-thumb .emoji { font-size: 40px; filter: grayscale(.2); }
.scenario-card .body { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.scenario-card h3 { font-size: 16px; margin: 0; }
.scenario-card p { font-size: 13px; color: var(--muted); margin: 0; }
.scenario-tag { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ------- IM matrix ------- */
.im-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.im-cell {
  background: var(--surface);
  padding: 28px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; color: var(--fg-soft); transition: background .15s;
}
.im-cell:hover { background: var(--bg-soft); }
.im-cell img { width: 36px; height: 36px; object-fit: contain; }
.im-cell .name-zh, .im-cell .name-en { font-family: var(--font-mono); font-size: 12px; }

/* ------- architecture diagram ------- */
.arch-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
@media (max-width: 900px) { .arch-block { grid-template-columns: 1fr; gap: 32px; } }
.arch-img { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.arch-img img { width: 100%; height: auto; }

/* native architecture diagram (replaces .arch-img PNGs) */
.arch-diagram {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-body);
}
.arch-group {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 14px 14px;
}
.arch-group-label {
  position: absolute;
  top: -10px; left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.arch-group-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 18%, transparent);
}
.arch-row {
  display: grid;
  gap: 8px;
}
.arch-row + .arch-row { margin-top: 8px; }
.arch-row.row-1 { grid-template-columns: 1fr; }
.arch-row.row-2 { grid-template-columns: 1fr 1fr; }
.arch-row.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.arch-node {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
  transition: border-color 160ms ease, transform 160ms ease;
}
.arch-node:hover {
  border-color: color-mix(in oklch, var(--accent) 38%, var(--border));
}
.arch-node .arch-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.arch-node .arch-title::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}
.arch-node .arch-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.arch-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}
.arch-bridge {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px 0;
}
.arch-bridge::before,
.arch-bridge::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  height: 16px;
  background: var(--border);
  transform: translateX(-50%);
}
.arch-bridge::before { top: 0; }
.arch-bridge::after { bottom: 0; }
.arch-bridge-node {
  background: var(--surface);
  border: 1px dashed color-mix(in oklch, var(--accent) 32%, var(--border));
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--fg);
}
.arch-bridge-tag {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .arch-group { padding: 22px 12px 12px; border-radius: 12px; }
  .arch-group-label { left: 14px; font-size: 10px; padding: 2px 8px; }
  .arch-node { padding: 9px 11px; border-radius: 9px; }
  .arch-node .arch-title { font-size: 13px; }
  .arch-node .arch-sub { font-size: 11px; }
  .arch-bridge { padding: 18px 0; }
  .arch-bridge-tag { display: none; }
}
@media (max-width: 480px) {
  .arch-row.row-3,
  .arch-row.row-2 { grid-template-columns: 1fr; }
  .arch-group { padding: 20px 10px 10px; }
  .arch-group-label { left: 12px; }
  .arch-tag { display: none; }
}
.steps { display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; gap: 16px; }
.step-num {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.step h3 { font-size: 17px; margin-bottom: 4px; }
.step p { font-size: 14px; margin: 0; color: var(--muted); }

/* ------- trust band ------- */
.trust-band {
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap; justify-content: center;
  padding: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-band img { height: 22px; opacity: .7; filter: grayscale(1); }
.trust-band .pill { font-size: 12px; }

/* ------- CTA banner ------- */
.cta-banner {
  background:
    radial-gradient(80% 100% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%),
    var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: clamp(48px, 7vw, 80px) 40px;
  text-align: center;
}
.cta-banner h2 { font-size: clamp(28px, 3.6vw, 44px); margin-bottom: 28px; }

/* ------- page header (non-home pages) ------- */
.page-header { padding: clamp(48px, 6vw, 80px) 0 clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--border); }
.page-header .lead { margin-top: 18px; }

/* ------- tables / dl ------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.spec-table th { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.spec-table td.numeric { font-family: var(--font-mono); }

/* ------- code blocks ------- */
.code {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
  color: var(--fg-soft); overflow-x: auto;
}
.code .k { color: var(--accent); }
.code .s { color: var(--success); }
.code .c { color: var(--muted); }

/* ------- utility ------- */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-mono { font-family: var(--font-mono); }
.center { text-align: center; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }

/* Section divider */
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ============================================================
   Page-specific accents
   ============================================================ */

/* download page */
.os-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .os-grid { grid-template-columns: 1fr; } }
.os-card { padding: 32px; text-align: left; }
.os-card.is-detected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.os-card .os-glyph { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-soft); margin-bottom: 16px; }
.os-card h3 { font-size: 18px; margin-bottom: 4px; }
.os-card .os-arch { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.os-card .btn { width: 100%; justify-content: center; margin-bottom: 12px; }
.os-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

/* feature deep-dive */
.feat-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
  padding: 80px 0; border-bottom: 1px solid var(--border);
}
.feat-block:last-child { border-bottom: 0; }
.feat-block.is-reverse .feat-text { order: 2; }
@media (max-width: 900px) {
  .feat-block { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .feat-block.is-reverse .feat-text { order: initial; }
}
.feat-block .eyebrow { margin-bottom: 12px; }
.feat-block h2 { font-size: clamp(28px, 3vw, 36px); margin-bottom: 16px; }
.feat-block .lead { font-size: 17px; margin-bottom: 24px; }
.feat-block .bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.feat-block .bullets li { display: flex; gap: 12px; font-size: 14px; color: var(--fg-soft); }
.feat-block .bullets li::before { content: "→"; color: var(--accent); flex-shrink: 0; }

.feat-visual {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; min-height: 320px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-md);
}

/* terminal-mock for Cowork */
.term {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  background: #0a0e1a; color: #d5dceb;
  border-radius: 8px; padding: 16px 18px;
  min-height: 280px;
}
.term .prompt { color: #4a93ff; }
.term .out { color: #a0aec5; }
.term .ok { color: #34d399; }
.term .warn { color: #fbbf24; }
.term .cursor { display: inline-block; width: 8px; height: 14px; background: #f5f7fa; vertical-align: text-bottom; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* approval card for permission gating */
.approval-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 16px;
}
.approval-card .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.approval-card .label { font-family: var(--font-mono); color: var(--muted); }
.approval-card .value { color: var(--fg); }
.approval-card .actions { display: flex; gap: 8px; margin-top: 12px; }
.approval-card .actions button {
  flex: 1; padding: 8px; border-radius: 6px; font-size: 13px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg);
}
.approval-card .actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* skill chips */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); font-family: var(--font-mono); font-size: 12px; color: var(--fg-soft);
}
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

/* use-case card */
.uc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 20px;
}
.uc-card .uc-head { display: flex; align-items: center; gap: 12px; }
.uc-card .uc-emoji { font-size: 28px; }
.uc-card h3 { font-size: 20px; margin: 0; }
.uc-card .uc-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.uc-card .ba-row { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 12px; align-items: stretch; }
.uc-card .ba-col {
  padding: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft);
  font-size: 13px; line-height: 1.55; color: var(--fg-soft);
}
.uc-card .ba-col .label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.uc-card .ba-arrow { display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 20px; }

/* api / pricing */
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .tier-grid { grid-template-columns: 1fr; } }
.tier { padding: 32px; }
.tier.is-featured { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.tier h3 { font-size: 18px; margin-bottom: 4px; }
.tier .price { font-size: 36px; font-weight: 700; letter-spacing: -0.025em; margin: 16px 0 4px; }
.tier .price .unit { font-size: 14px; font-weight: 400; color: var(--muted); }
.tier .desc { font-size: 13px; color: var(--muted); margin-bottom: 20px; min-height: 36px; }
.tier ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.tier ul li { font-size: 13px; color: var(--fg-soft); display: flex; gap: 8px; }
.tier ul li::before { content: "✓"; color: var(--success); }
.tier .btn { width: 100%; justify-content: center; }

/* enterprise contact form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.field input, .field textarea, .field select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; color: var(--fg); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 96px; }
.field.span-2 { grid-column: 1 / -1; }

/* api banner */
.api-banner {
  border: 1px solid var(--accent); border-radius: var(--radius-lg);
  padding: 40px;
  background:
    radial-gradient(60% 100% at 100% 50%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%),
    var(--surface);
  display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: center;
}
@media (max-width: 800px) { .api-banner { grid-template-columns: 1fr; } }
.api-banner h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; }
.api-banner p { margin: 0 0 8px; color: var(--fg-soft); }

/* docs link list */
.doc-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.doc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
  transition: background .15s;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--bg-soft); }
.doc-row h4 { font-size: 16px; margin: 0 0 4px; font-weight: 500; }
.doc-row p { margin: 0; font-size: 13px; color: var(--muted); }
.doc-row .arrow-out { color: var(--muted); }

/* about — team grid */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 800px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.team-card { padding: 24px; text-align: center; }
.team-card .avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-mono); font-size: 18px; font-weight: 600;
}
.team-card .role { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.team-card h4 { margin: 0 0 4px; font-size: 15px; }

/* version history */
.version-row {
  display: grid; grid-template-columns: 100px 100px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.version-row:last-child { border-bottom: 0; }
.version-row .v { font-family: var(--font-mono); font-weight: 500; color: var(--fg); }
.version-row .d { font-family: var(--font-mono); color: var(--muted); }
.version-row .notes { color: var(--fg-soft); }
.version-row .actions { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .version-row { grid-template-columns: 1fr; gap: 4px; padding: 16px; }
  .version-row .actions { margin-top: 8px; }
}

/* ============================================================
   Mobile breakpoints — phones
   ============================================================ */

/* ≤640px — tablet portrait → small phones */
@media (max-width: 640px) {
  :root { --nav-h: 56px; }

  .wrap, .wrap-wide { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }

  .section          { padding: clamp(48px, 9vw, 80px) 0; }
  .section-tight    { padding: clamp(36px, 7vw, 56px) 0; }

  .h-display { font-size: clamp(34px, 9vw, 52px); line-height: 1.08; }
  .h-section { font-size: clamp(24px, 6vw, 34px); }
  .lead { font-size: 16px; }

  .hero-meta { gap: 10px 14px; font-size: 12px; }
  .hero-meta > span:nth-child(2),
  .hero-meta > span:nth-child(4) { display: none; } /* drop · separators */

  .hero-ctas { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  .product-mock { margin-top: 40px; border-radius: 10px; }
  .mock-body { min-height: 360px; }
  .mock-main { padding: 14px 14px; gap: 12px; }
  .msg { max-width: 96%; font-size: 13px; padding: 10px 12px; }
  .msg.assistant .tool-call { font-size: 11px; padding: 7px 8px; gap: 5px; }
  .window-title { display: none; }

  .card { padding: 22px; }
  .card-feature { gap: 12px; }
  .card-feature .glyph { width: 32px; height: 32px; }

  .trust-band { gap: 14px; padding: 24px 12px; }
  .pill { font-size: 10.5px; padding: 3px 8px; }

  .im-cell { padding: 20px 10px; }
  .im-cell img { width: 32px; height: 32px; }

  .feat-block { padding: 40px 0; gap: 28px; }
  .feat-block h2 { font-size: clamp(22px, 6vw, 30px); }
  .feat-block .lead { font-size: 16px; }
  .feat-visual { padding: 18px; min-height: 260px; }
  .term { font-size: 12px; padding: 14px; min-height: 220px; }

  .scenario-rail { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
  .scenario-rail { grid-auto-columns: minmax(260px, 78%); }

  .os-card { padding: 24px; }
  .tier { padding: 24px; }
  .tier .price { font-size: 32px; }

  .uc-card { padding: 22px; gap: 16px; }
  .uc-card .ba-row { grid-template-columns: 1fr; gap: 8px; }
  .uc-card .ba-arrow { transform: rotate(90deg); padding: 4px 0; }

  .api-banner { padding: 28px 22px; gap: 20px; }

  .doc-row { padding: 16px 18px; flex-wrap: wrap; }

  .cta-banner {
    padding: 40px 22px;
    border-radius: 14px;
  }
  .cta-banner h2 { font-size: clamp(22px, 6vw, 32px); }

  .footer { padding: 56px 0 28px; }
  .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 28px 22px; }
  .footer-grid > :first-child { grid-column: 1 / -1; max-width: 38ch; }

  .arch-block { gap: 28px; }
  .step h3 { font-size: 16px; }
  .step p { font-size: 13px; }
  .step-num { width: 28px; height: 28px; font-size: 12px; }
}

/* ≤480px — most phones in portrait */
@media (max-width: 480px) {
  .wrap, .wrap-wide { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }

  .brand span { font-size: 14px; }
  .brand img { width: 26px; height: 26px; }

  /* Hero h1: drop the manual <br> on narrow widths — let text-wrap balance instead */
  .h-display br { display: none; }
  .h-display { font-size: clamp(30px, 10vw, 46px); letter-spacing: -0.025em; }

  .pill { font-size: 10px; }
  .eyebrow { font-size: 11px; margin-bottom: 12px; }

  .product-mock { margin-top: 32px; }
  .mock-body { min-height: 320px; }
  .mock-main { padding: 12px 12px; gap: 10px; }
  .msg { font-size: 12.5px; padding: 10px 12px; max-width: 100%; }
  .msg.assistant .tool-call { font-size: 10.5px; padding: 6px 8px; }

  .im-matrix { grid-template-columns: repeat(2, 1fr); }
  .im-cell { padding: 18px 8px; gap: 8px; }

  .trust-band { gap: 10px; padding: 20px 12px; }

  .scenario-rail { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .scenario-rail { grid-auto-columns: minmax(240px, 84%); }
  .scenario-card .body { padding: 16px; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; }
  .footer-grid > :first-child { grid-column: 1 / -1; max-width: 34ch; }
  .footer h4 { margin-bottom: 12px; }
  .footer ul { gap: 8px; }
  .footer ul a { font-size: 13px; }

  .arch-img { padding: 8px; }
  .feat-visual { padding: 14px; min-height: 220px; }

  .cta-banner { padding: 32px 18px; }

  .os-card { padding: 20px; }
  .os-card .btn { font-size: 14px; padding: 11px 16px; }

  .tier { padding: 20px; }
  .tier ul { gap: 8px; }

  .uc-card { padding: 18px; }
  .uc-card h3 { font-size: 17px; }

  .doc-row { padding: 14px 16px; }
  .doc-row h4 { font-size: 15px; }

  .api-banner { padding: 24px 18px; }
  .api-banner h2 { font-size: clamp(20px, 6vw, 26px); }

  .spec-table { font-size: 13px; }
  .spec-table th, .spec-table td { padding: 10px 8px; }
  .spec-table th { font-size: 10px; }

  .footer { padding: 48px 0 24px; }
  .footer-bot { font-size: 12px; gap: 10px; }
}

/* ≤360px — old / small phones (iPhone SE 1st gen, etc.) */
@media (max-width: 360px) {
  .wrap, .wrap-wide { padding: 0 12px; }
  .nav-inner { padding: 0 12px; gap: 8px; }
  .brand span { display: none; }
  .h-display { font-size: 28px; }
  .lead { font-size: 15px; }
  .btn-lg { padding: 14px 18px; font-size: 15px; }
  .im-matrix { grid-template-columns: repeat(2, 1fr); }
  .im-cell { padding: 14px 6px; }
  .cta-banner { padding: 28px 14px; }
  .scenario-rail { grid-auto-columns: minmax(220px, 88%); }
}
