/* ============================================================
   Open Source Claude Cowork — comparison hub
   Design language lifted from Kortix/Suna apps/web:
   ink monochrome identity · surface-lift hierarchy (never opacity
   on type) · hairline borders · one signal blue (#0099ff, links/
   focus only, never a fill) · Roobert-style grotesque + mono ·
   10px radius · 100-500ms motion with (0.2,0,0,1) ease.
   ============================================================ */

/* ---- Fonts are loaded via <link> in the HTML head:
     General Sans (Fontshare) + JetBrains Mono (Google Fonts) ---- */

:root {
  /* --- Type scale (fluid) --- */
  --text-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.79rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.91rem + 0.2vw, 1rem);
  --text-lg:   clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-2xl:  clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  --text-3xl:  clamp(1.875rem, 1.3rem + 2.6vw, 3rem);
  --text-hero: clamp(2.25rem, 1.4rem + 4vw, 3.75rem);

  /* --- Spacing (4px system) --- */
  --space-1:  0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4:  1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8:  2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;  --space-24: 6rem;

  /* --- Radius --- */
  --radius: 0.625rem;
  --radius-sm: 0.4375rem;
  --radius-full: 9999px;

  /* --- Motion --- */
  --duration-fast: 120ms;
  --duration-normal: 180ms;
  --duration-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* --- Fonts --- */
  --font-body: 'General Sans', -apple-system, 'Segoe UI', Inter, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---- Palette: DARK (default — Suna ships dark) ---- */
:root,
[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #090909;
  --base: #0c0c0c;
  --surface: #141414;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --ink: #ffffff;
  --ink-strong: #ffffff;
  --ink-muted: #999999;
  --ink-faint: #5c5c5c;
  --hairline: #262626;
  --hairline-soft: #1a1a1a;
  --signal: #0099ff;
  --signal-weak: rgba(0, 153, 255, 0.12);
  --ok: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --hover: rgba(255, 255, 255, 0.06);
  --active: rgba(255, 255, 255, 0.10);
  --selection: rgba(0, 153, 255, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  --glass-bg: rgba(9, 9, 9, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --code-bg: #0c0c0c;
  --code-border: #262626;
}

/* ---- Palette: LIGHT ---- */
[data-theme='light'] {
  color-scheme: light;
  --canvas: #ffffff;
  --base: #ffffff;
  --surface: #fcfcfc;
  --surface-1: #f4f4f4;
  --surface-2: #ececec;
  --surface-3: #e4e4e4;
  --ink: #000000;
  --ink-strong: #000000;
  --ink-muted: #666666;
  --ink-faint: #9a9a9a;
  --hairline: #e2e2e2;
  --hairline-soft: #eeeeee;
  --signal: #0077cc;
  --signal-weak: rgba(0, 119, 204, 0.1);
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #b3261e;
  --hover: rgba(0, 0, 0, 0.045);
  --active: rgba(0, 0, 0, 0.075);
  --selection: rgba(0, 119, 204, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px -12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --code-bg: #f6f6f6;
  --code-border: #e2e2e2;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--space-16) + var(--space-4));
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, var(--signal-weak), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,0.03), transparent 55%);
}

::selection { background: var(--selection); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

img, picture, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; font-weight: 650; letter-spacing: -0.02em; }
p, li { text-wrap: pretty; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd { font-family: var(--font-mono); }
code { font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--code-bg); border: 1px solid var(--code-border); }
pre { overflow-x: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--content-wide); margin: 0 auto; padding-inline: var(--space-6); }

/* ---- Motion: interactive transitions ---- */
a, button, [role='button'], input, summary {
  transition: color var(--duration-normal) var(--ease),
              background-color var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease),
              opacity var(--duration-normal) var(--ease);
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.7s var(--ease-spring),
              transform 0.7s var(--ease-spring),
              filter 0.7s var(--ease-spring);
  will-change: opacity, transform, filter;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

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

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--canvas);
}
.brand .logo svg { width: 16px; height: 16px; }
.brand .tld { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); color: var(--ink-faint); }

.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--hairline); background: var(--hover); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--canvas); }
.btn-primary:hover { background: var(--ink); opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink-muted); background: var(--hover); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24)) var(--space-16);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: var(--space-5);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-weak);
}
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: var(--space-6);
  max-width: 16ch;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--ink) 20%, var(--ink-muted) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  max-width: 44ch;
  line-height: 1.55;
  margin-bottom: var(--space-8);
}
.hero .cta-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hero .meta {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* ---- Terminal demo (echo of Suna's cli-demo) ---- */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--hairline-soft);
}
.terminal-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal-head .dot.r { background: #ff5f57; }
.terminal-head .dot.y { background: #febc2e; }
.terminal-head .dot.g { background: #28c840; }
.terminal-head .title {
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}
.terminal-body {
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.terminal-body .line { white-space: pre-wrap; }
.terminal-body .prompt { color: var(--signal); }
.terminal-body .cmd { color: var(--ink); }
.terminal-body .out { color: var(--ink-muted); }
.terminal-body .ok { color: var(--ok); }
.terminal-body .dim { color: var(--ink-faint); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--signal);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
  border-top: 1px solid var(--hairline-soft);
}
.section-head { max-width: 46em; margin-bottom: var(--space-12); }
.section-head h2 {
  font-size: var(--text-3xl);
  font-weight: 660;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.section-head .sub { font-size: var(--text-lg); color: var(--ink-muted); }
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: var(--space-3);
}

/* ---- Comparison table ---- */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.table-scroll { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 720px; }
table.cmp thead th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-muted);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0;
}
table.cmp thead th.hl {
  color: var(--ink);
  font-weight: 700;
}
table.cmp thead th.hl::after {
  content: '← open';
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--signal);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}
table.cmp tbody td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
  line-height: 1.5;
}
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover { background: var(--hover); }
table.cmp td.dim {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  white-space: nowrap;
  padding-top: var(--space-5);
}
table.cmp td small { display: block; color: var(--ink-muted); font-weight: 400; margin-top: 2px; font-family: var(--font-body); }
.flag-open, .flag-partial, .flag-closed { font-weight: 600; }
.flag-open { color: var(--ok); }
.flag-partial { color: var(--warn); }
.flag-closed { color: var(--bad); }
.footnote { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-4); }

/* ---- Platform cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-5); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: transform var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--ink-muted);
  box-shadow: var(--shadow-md);
}
.card .tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  background: var(--surface-1);
}
.card h3 { font-size: var(--text-xl); font-weight: 650; letter-spacing: -0.02em; }
.card .site {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--signal);
  margin-bottom: var(--space-1);
}
.card p { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.6; }
.card ul { list-style: none; display: grid; gap: var(--space-2); }
.card li {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-left: var(--space-5);
  position: relative;
}
.card li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--signal);
  opacity: 0.7;
}

/* ---- Callouts ---- */
.callout {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  margin-top: var(--space-6);
}
.callout .ic {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--signal-weak);
  color: var(--signal);
}
.callout p { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.65; }
.callout strong { color: var(--ink); }

/* ---- Steps ---- */
ol.steps { list-style: none; counter-reset: step; display: grid; gap: var(--space-5); max-width: 56em; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: calc(var(--space-10) + var(--space-2));
  font-size: var(--text-base);
  color: var(--ink-muted);
  line-height: 1.6;
}
ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--signal);
  width: var(--space-10); height: var(--space-10);
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
ol.steps li strong { color: var(--ink); }

/* ---- FAQ ---- */
details.faq {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .chev {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  color: var(--ink-muted);
  transition: transform var(--duration-normal) var(--ease);
}
details.faq[open] summary .chev { transform: rotate(45deg); color: var(--signal); border-color: var(--signal); }
details.faq .faq-body { padding: 0 var(--space-6) var(--space-6); }
details.faq .faq-body p { font-size: var(--text-base); color: var(--ink-muted); line-height: 1.65; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-12) var(--space-16);
  background: var(--base);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.site-footer .brand { margin-bottom: var(--space-4); }
.site-footer p { font-size: var(--text-sm); color: var(--ink-muted); }
.disclaimer { font-size: var(--text-xs); color: var(--ink-faint); max-width: 56em; margin-top: var(--space-4); line-height: 1.6; }
.footer-src { font-size: var(--text-xs); color: var(--ink-faint); }
.footer-src a { color: var(--ink-muted); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: var(--space-4); }
  .footer-grid { flex-direction: column; }
}
