/* Atelier — marketing site (calm-paper tier).
   Tokens + type taken verbatim from the brand book (docs/brand.html) so the site
   is the same shop as the console: gesso paper, ONE cinnabar accent, Fraunces
   display (weight 560/400, optical sizing), Schibsted body, diffuse "light falls"
   shadow, the 4/7/10/14 radius family, hairline dividers. The fourteen laws
   (brand.md §10) govern every choice — above all Law 1 (one pigment, one place:
   cinnabar only on the primary action + links + a single rule) and Law 4 (light
   falls, nothing glows). */

:root {
  --paper:#F0EDE7; --card:#FCFAF7; --paper-2:#E8E5DF;
  --ink:#221F1B; --muted:#6B675F;
  --line:#E4E0D8; --line-strong:rgba(34,31,27,.16);
  --cinnabar:#B94430; --cinnabar-deep:#A83825;
  --on-accent:#FCFAF7;
  --mint:#0E8A5F; --coral:#C4432F; --amber:#B87400;
  --shadow: 0 1px 1px rgba(34,31,27,.04), 0 10px 28px -16px rgba(34,31,27,.28);
  --shadow-lift: 0 2px 3px rgba(34,31,27,.06), 0 16px 40px -18px rgba(34,31,27,.32);
  --r1:4px; --r2:7px; --r3:10px; --r4:14px;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:#191714; --card:#211E19; --paper-2:#26221C;
    --ink:#EAE7E2; --muted:#A29B91;
    --line:rgba(234,231,226,.13); --line-strong:rgba(234,231,226,.22);
    --cinnabar:#E0694E; --cinnabar-deep:#E0694E;
    --on-accent:#191714;
    --mint:#3FCF9B; --coral:#F0715C; --amber:#E0A23C;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px -16px rgba(0,0,0,.65);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 18px 46px -18px rgba(0,0,0,.72);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
  margin: 0;
}
h3 { font-weight: 540; }
p { margin: 0; max-width: 66ch; }

a { color: var(--cinnabar); text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cinnabar-deep); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); }
strong { font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 28px; }

/* one editorial accent device: a short cinnabar rule (the ONLY decorative cinnabar) */
.rule { display: inline-block; width: 26px; height: 2px; background: var(--cinnabar); border-radius: 2px; vertical-align: middle; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--cinnabar); color: var(--on-accent);
  padding: 10px 16px; border-radius: 0 0 var(--r2) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; border-radius: 3px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
/* Brand lockup: the master logo+wordmark lockup (theme-swapped light/dark) with
   a small-caps maker line "by AIncient Labs" set on the same line, to its right,
   separated by a hairline rule. */
.brand { display: inline-flex; flex-direction: row; align-items: center; gap: 13px; }
.brand-lockup { display: block; height: 30px; width: auto; }
.brand-lockup--dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand-lockup--light { display: none; }
  .brand-lockup--dark { display: block; }
}
.brand-name-sub {
  padding-left: 13px; border-left: 1px solid var(--line-strong);
  font-family: var(--sans); font-weight: 500; font-size: 11px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--ink); font-size: 15px; }
.nav a:hover { color: var(--cinnabar); }
.nav .nav-cta {
  color: var(--ink); font-size: 14px;
  border: 1px solid var(--line-strong);
  padding: 7px 14px; border-radius: var(--r2);
  background: var(--card); box-shadow: var(--shadow);
}
.nav .nav-cta:hover { border-color: var(--muted); color: var(--ink); }
@media (max-width: 560px) { .nav a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 11vw, 108px) 0 clamp(48px, 7vw, 76px); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 760px; }
.hero-title { font-size: clamp(40px, 7.4vw, 68px); letter-spacing: -.02em; margin-bottom: 26px; }
.hero-lede {
  font-family: var(--serif); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(20px, 2.6vw, 27px); line-height: 1.38; color: var(--ink);
  max-width: 34ch; margin-bottom: 20px; text-wrap: pretty;
}
.hero-sub { color: var(--muted); font-size: 17px; max-width: 56ch; margin-bottom: 36px; }

/* command block — a quiet terminal, not a glowing box */
.cmd {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 14px 14px 14px 18px;
  box-shadow: var(--shadow);
  max-width: 700px;
  overflow: hidden;
}
.cmd-prompt { color: var(--muted); font-family: var(--mono); user-select: none; }
.cmd code {
  flex: 1; min-width: 0;
  font-size: 14.5px; color: var(--ink); line-height: 1.45;
  /* Wrap at spaces instead of scrolling — no horizontal scrollbar. Fits on one
     line at the box's desktop width; wraps cleanly on narrow viewports. */
  white-space: normal; overflow-wrap: break-word; word-break: normal;
}
.cmd-copy {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--muted); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r1);
  padding: 6px 11px; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.cmd-copy:hover { border-color: var(--muted); color: var(--ink); }
.cmd-copy.is-copied { color: var(--cinnabar); border-color: var(--cinnabar); }
.cmd-copy.is-copied svg { display: none; }

.cmd-note { margin-top: 15px; font-size: 14px; color: var(--muted); }
.cmd-note .dot { opacity: .5; margin: 0 8px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 11px 22px; border-radius: var(--r2);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
/* the ONE cinnabar action (Law 7/8: one primary per view) */
.btn-primary { background: var(--cinnabar); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--cinnabar-deep); color: var(--on-accent); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: clamp(60px, 8vw, 84px) 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-title { font-size: clamp(27px, 4.2vw, 38px); margin-bottom: 16px; }
.section-lede { font-size: 19px; color: var(--muted); max-width: 60ch; }

/* feature cards — flat, hairline, mono tag instead of an icon chip */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r4);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--line-strong); }
.card .tag {
  display: block;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.card h3 { font-size: 21px; margin-bottom: 9px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* install steps — Fraunces numeral (ink, not cinnabar), flat card */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
  display: grid; grid-template-columns: 54px 1fr; gap: 22px; align-items: start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r4); padding: 26px 28px; box-shadow: var(--shadow);
}
.step-n {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: 40px; line-height: 1; color: var(--ink);
  opacity: .32;
}
.step h3 { font-size: 20px; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 15.5px; }
.step code {
  background: var(--paper-2); padding: 1px 6px; border-radius: var(--r1);
  font-size: .88em; color: var(--ink); border: 1px solid var(--line);
}
.cmd-inline { margin-top: 16px; max-width: 640px; }
.cmd-inline code { background: none; border: none; padding: 0 0 2px; }
.fine { margin-top: 11px; font-size: 13.5px; color: var(--muted); }
.fine a { color: var(--cinnabar); text-decoration: underline; text-decoration-color: var(--line-strong); }
.fine a:hover { text-decoration-color: currentColor; }

/* license note — a calm hairline note, no tinted box (Law 1/2) */
.note {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 34px; padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14.5px; line-height: 1.55;
}
.note .rule { position: relative; top: -3px; flex-shrink: 0; }
.note strong { color: var(--ink); }

/* thesis — a single Fraunces pull-quote, one cinnabar rule above it */
.thesis { padding: clamp(72px, 10vw, 104px) 0; border-bottom: 1px solid var(--line); }
.thesis-inner { max-width: 720px; }
.thesis .rule { margin-bottom: 26px; width: 34px; }
.thesis-line { font-family: var(--serif); font-weight: 500; font-optical-sizing: auto; font-size: clamp(28px, 4.8vw, 44px); line-height: 1.14; letter-spacing: -.015em; color: var(--ink); }
.thesis-sub { margin-top: 18px; color: var(--muted); font-size: 16px; }

/* ---------- footer ---------- */
.site-footer { padding: 54px 0 42px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.footer-tag { margin-top: 13px; color: var(--muted); font-size: 14.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { color: var(--ink); font-size: 15px; }
.footer-links a:hover { color: var(--cinnabar); }
.footer-legal {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
