/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  --font-sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

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

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.18);

  --max-w: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Light theme (default) */
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --bg-frame: #fafafa;
  --surface: #ffffff;
  --surface-2: #f3f3f5;
  --border: #e6e6e9;
  --border-strong: #d4d4d8;
  --fg: #0b0b0c;
  --fg-muted: #5b5b62;
  --fg-subtle: #8a8a93;
  --accent: #2f5bff;
  --accent-fg: #ffffff;
  --accent-soft: rgba(47, 91, 255, 0.08);
  --judge: #1f8a4c;
  --judge-soft: rgba(31, 138, 76, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --bg-alt: #111113;
    --bg-frame: #0f0f11;
    --surface: #131316;
    --surface-2: #1a1a1d;
    --border: #232327;
    --border-strong: #2e2e34;
    --fg: #f5f5f7;
    --fg-muted: #a8a8b0;
    --fg-subtle: #70707a;
    --accent: #7c93ff;
    --accent-fg: #0b0b0c;
    --accent-soft: rgba(124, 147, 255, 0.12);
    --judge: #4ade80;
    --judge-soft: rgba(74, 222, 128, 0.12);
  }
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

/* ---------- Layout primitives ---------- */
main {
  display: block;
}

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
}

.band {
  width: 100%;
}

.band-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--fg));
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 3px;
  background: var(--bg);
}

.brand-name {
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.site-nav a:hover {
  color: var(--fg);
}

@media (max-width: 720px) {
  .site-nav {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn-lg {
  padding: 0.85rem 1.4rem;
  font-size: 1.05rem;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(4rem, 9vw, 7rem);
  text-align: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 auto 1.25rem;
  max-width: 22ch;
}

.hero h1 .accent {
  display: block;
  color: var(--fg-muted);
}

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--fg-muted);
  max-width: 56ch;
  margin: 0 auto 2rem;
}

.cta-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 4rem;
}

/* Hero product preview */
.hero-frame {
  margin: 0 auto;
  max-width: 980px;
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.frame-chrome {
  display: flex;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.frame-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.frame-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  min-height: 320px;
}

.pane {
  padding: 1.1rem 1.2rem;
  border-right: 1px solid var(--border);
  font-size: 0.88rem;
}
.pane:last-child {
  border-right: 0;
}

.pane-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 0.85rem;
}

.pane-tasks ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--fg-muted);
}
.pane-tasks li {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.pane-tasks li.active {
  background: var(--accent-soft);
  color: var(--fg);
  border-color: var(--accent-soft);
}

.pane-workspace pre {
  margin: 0;
  padding: 0.8rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  color: var(--fg);
}

.pane-chat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.msg {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  max-width: 90%;
  line-height: 1.4;
}
.msg-user {
  background: var(--surface-2);
  align-self: flex-end;
}
.msg-ai {
  background: var(--surface);
  border: 1px solid var(--border);
}
.msg-judge {
  background: var(--judge-soft);
  color: var(--fg);
  font-size: 0.82rem;
  border: 1px dashed var(--judge);
  align-self: flex-start;
}
.judge-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--judge);
  margin-right: 0.4rem;
}

@media (max-width: 820px) {
  .frame-body {
    grid-template-columns: 1fr;
  }
  .pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .pane:last-child {
    border-bottom: 0;
  }
}

/* ---------- Section headings ---------- */
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 2.5rem;
  max-width: 28ch;
}

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.steps li:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-subtle);
  letter-spacing: 0.08em;
}
.steps h3 {
  font-size: 1.15rem;
  margin: 0.5rem 0 0.5rem;
  font-weight: 600;
}
.steps p {
  margin: 0;
  color: var(--fg-muted);
}

/* ---------- Dimensions ---------- */
.dimension-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.dimension-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s var(--ease);
}
.dimension-grid article:hover {
  border-color: var(--border-strong);
}
.dimension-grid h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.dimension-grid p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 0.75rem;
}
.faq > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
}
.faq dt {
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.faq dd {
  margin: 0;
  color: var(--fg-muted);
}

/* ---------- CTA section ---------- */
.section-cta {
  text-align: center;
}
.section-cta h2 {
  margin-left: auto;
  margin-right: auto;
}
.section-cta .lede {
  margin-bottom: 2rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.site-footer .muted {
  color: var(--fg-subtle);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
