/* Cairn site — layout + components. Tokens live in tokens.css (from the design system).
   Ported from design/marketing.html; static, no JavaScript. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--c-bg-canvas);
  color: var(--c-fg-primary);
  font-family: var(--font-sans);
  font-size: var(--t-15);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Style guide 2.2: ligatures stay on even where letter-spacing is set (browsers drop
     optional ligatures under letter-spacing unless asked explicitly). */
  font-kerning: normal;
  font-feature-settings: "liga" 1, "kern" 1;
}

a { color: inherit; }

/* ── Layout ───────────────────────────────────────────── */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--s-8);
}
@media (max-width: 720px) {
  .wrap { padding: 0 var(--s-4); }
}

/* Hairline section break with a mono number, like a notebook */
.rule {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--s-3);
  align-items: center;
  margin: var(--s-20) 0 var(--s-12);
}
.rule .stones { width: 14px; height: 17px; color: var(--c-fg-tertiary); }
.rule .num {
  font-family: var(--font-mono);
  font-size: var(--t-12);
  letter-spacing: var(--tracking-wide);
  color: var(--c-fg-tertiary);
  text-transform: uppercase;
}
.rule .line { height: 1px; background: var(--c-line); }

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--c-line-soft);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--c-fg-primary);
}
.brand .mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-self: baseline;
  transform: translateY(3px); /* rest the bottom stone on the type baseline */
}
.brand .wordmark {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
}
.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav a {
  color: var(--c-fg-secondary);
  text-decoration: none;
  font-size: var(--t-13);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav a:hover { color: var(--c-fg-primary); }
@media (max-width: 720px) {
  .nav { gap: var(--s-4); }
  .nav .nav-wide { display: none; }
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: var(--s-24) 0 var(--s-16);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-12);
  align-items: center;
}
.hero-art { display: flex; align-items: center; justify-content: center; color: var(--c-fg-primary); opacity: 0.92; }
.hero-art svg { width: 100%; max-width: 320px; height: auto; }
/* After the base rules so it actually wins (the design file had this order reversed).
   On phones the stones stay, small and left-aligned under the copy. */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-8); padding: var(--s-16) 0 var(--s-8); }
  .hero-art { justify-content: flex-start; }
  .hero-art svg { max-width: 140px; }
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-12);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-fg-tertiary);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.hero-eyebrow .dot {
  width: 5px; height: 5px;
  background: var(--c-accent);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transform: translateY(-2px);
}
/* The italic is the design — no roman headline, no demoted lede. */
.hero h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.0125em;
  margin: var(--s-6) 0;
  max-width: 16ch;
  text-wrap: balance;
}
.hero h1 .roman { font-style: normal; color: var(--c-accent); }
.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--c-fg-secondary);
  line-height: 1.45;
  max-width: 34ch;
  margin: var(--s-2) 0 0;
  text-wrap: pretty;
}
.cta-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-10);
  flex-wrap: wrap;
}
/* The App Store link (was a pre-launch status pill until 2026-11-12). */
.status-pill {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: var(--s-2);
  background: var(--c-fg-primary);
  color: var(--c-bg-canvas);
  border-radius: var(--r-2);
  padding: 12px 20px;
  font-size: var(--t-15);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
a.status-pill:hover { background: var(--c-accent); }
.status-pill .meta { font-family: var(--font-mono); font-size: var(--t-12); opacity: 0.7; }
.cta-note { margin-top: var(--s-4); font-family: var(--font-mono); font-size: var(--t-12); color: var(--c-fg-tertiary); }
.cta-note .btn-ghost { font: inherit; }
.btn-ghost {
  color: var(--c-fg-secondary);
  text-decoration: none;
  font-size: var(--t-15);
  border-bottom: 1px dotted var(--c-fg-muted);
  padding-bottom: 1px;
  transition: all var(--dur-fast) var(--ease-out);
}
.btn-ghost:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }

/* The 01 Thesis section uses the tour-head pattern below (2026-11-12), like every other block. */
.label-mono {
  font-family: var(--font-mono);
  font-size: var(--t-12);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-fg-tertiary);
  padding-top: 6px;
}

/* ── Tour (real app screenshots) ──────────────────────── */
.tour { padding: 0 0 var(--s-4); }
.tour-head { max-width: 640px; margin: 0 0 var(--s-8); }
.tour-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 var(--s-3);
}
.tour-head p {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.55;
  color: var(--c-fg-secondary);
  margin: 0;
  text-wrap: pretty;
}
.tour-head p + p { margin-top: var(--s-3); }
.tour-head code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--c-bg-sunken);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-2);
  padding: 1px 5px;
}
.tour-head a { color: var(--c-accent); text-decoration-color: var(--c-accent-soft); text-underline-offset: 3px; }
.tour-head a:hover { text-decoration-color: var(--c-accent); }
.tour-shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: end; }
.tour-shots.pair { grid-template-columns: minmax(0, 1fr) 240px; }
.tour-shots figure { margin: 0; min-width: 0; }
.tour-shots figure.live { max-width: 580px; }
.tour-shots img.flat { filter: none; }
.tour-shots video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(10, 14, 28, 0.18);
}
.tour-shots img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 32px rgba(10, 14, 28, 0.28));
}
.tour-shots figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-fg-muted);
  margin-top: var(--s-3);
}
@media (max-width: 720px) {
  .tour-shots.pair { grid-template-columns: minmax(0, 1fr); }
  .tour-shots.pair figure.phone { max-width: 260px; margin: 0 auto; }
}

/* ── Quote ────────────────────────────────────────────── */
.quote { padding: var(--s-12) 0; text-align: center; }
.quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.quote blockquote em { font-style: italic; color: var(--c-fg-secondary); }
.quote .attribution { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: var(--tracking-wide); color: var(--c-fg-tertiary); margin-top: var(--s-6); text-transform: uppercase; }

/* ── Closing ──────────────────────────────────────────── */
.closing {
  padding: var(--s-12) 0 var(--s-16);
  border-top: 1px solid var(--c-line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-12);
  align-items: end;
}
@media (max-width: 720px) { .closing { grid-template-columns: 1fr; gap: var(--s-6); } }
.closing h2 { font-family: var(--font-display); font-size: clamp(36px, 5vw, 56px); font-weight: 400; line-height: 1.05; letter-spacing: -0.0125em; margin: 0; max-width: 14ch; }
.platforms { display: flex; flex-direction: column; gap: var(--s-3); font-size: var(--t-13); color: var(--c-fg-secondary); }
.platforms .row { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-line-soft); }
.platforms .name { font-family: var(--font-display); font-size: var(--t-15); color: var(--c-fg-primary); }
.platforms .meta { font-family: var(--font-mono); font-size: var(--t-12); color: var(--c-fg-muted); letter-spacing: 0.04em; text-transform: uppercase; text-align: right; }

/* ── Text pages (privacy, support) ────────────────────── */
.page { max-width: 680px; padding: var(--s-16) 0 var(--s-12); }
@media (max-width: 720px) { .page { padding-top: var(--s-10); } }
.page h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: var(--s-4) 0 var(--s-2);
}
.page .meta { font-family: var(--font-mono); font-size: var(--t-12); color: var(--c-fg-tertiary); margin: 0 0 var(--s-10); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1; }
/* A one-line description under the page title: serif italic, like the app's Quick Reference subline. */
.page .subtitle { font-family: var(--font-display); font-style: italic; font-size: var(--t-20); line-height: 1.4; color: var(--c-fg-secondary); margin: 0 0 var(--s-10); }
.page .summary {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.45;
  color: var(--c-fg-secondary);
  margin: 0 0 var(--s-10);
  padding-left: var(--s-5);
  border-left: 2px solid var(--c-accent);
}
.page h2 {
  font-family: var(--font-display);
  font-size: var(--t-24);
  font-weight: 400;
  line-height: 1.25;
  margin: var(--s-10) 0 var(--s-3);
}
/* Style guide D1: reading text is Newsreader, as in the app. Inter Tight stays for nav, buttons, tables. */
.page p, .page li, .page dd { font-family: var(--font-display); font-size: 18px; line-height: 1.6; color: var(--c-fg-secondary); }
.page strong, .tour-head strong { color: var(--c-fg-primary); font-weight: 600; }
/* Soft emphasis (style guide 2.5): italic, one step quieter. */
.page em, .tour-head em { font-style: italic; color: var(--c-fg-secondary); }
.page kbd { font-family: var(--font-sans); font-size: 0.8em; font-weight: 500; color: var(--c-fg-primary); border: 1px solid var(--c-line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--c-bg-surface); white-space: nowrap; }
.page p { margin: 0 0 var(--s-4); }
.page ul, .page ol { padding-left: 20px; margin: 0 0 var(--s-4); }
.page li { margin-bottom: var(--s-2); }
.page a { color: var(--c-accent); text-decoration-color: var(--c-accent-soft); text-underline-offset: 3px; }
.page a:hover { text-decoration-color: var(--c-accent); }
.page code { font-family: var(--font-mono); font-size: 0.86em; background: var(--c-bg-sunken); border: 1px solid var(--c-line-soft); border-radius: var(--r-2); padding: 1px 5px; }
.page .contact-card {
  margin: var(--s-6) 0 var(--s-8);
  padding: var(--s-5) var(--s-6);
  background: var(--c-bg-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
}
.page .contact-card .label-mono { padding: 0; margin-bottom: var(--s-1); }
.page .contact-card a { font-family: var(--font-display); font-size: var(--t-24); color: var(--c-fg-primary); text-decoration: none; }
.page .contact-card a:hover { color: var(--c-accent); }
.page dl.faq { margin: 0; }
.page dl.faq dt { font-family: var(--font-display); font-size: var(--t-20); font-weight: 400; line-height: 1.3; color: var(--c-fg-primary); margin: var(--s-8) 0 var(--s-2); }
.page dl.faq dd { margin: 0; }
.page h3 { font-family: var(--font-display); font-size: var(--t-20); font-weight: 400; line-height: 1.3; margin: var(--s-8) 0 var(--s-2); color: var(--c-fg-primary); }
.page .table-wrap { overflow-x: auto; margin: var(--s-4) 0 var(--s-6); border: 1px solid var(--c-line); border-radius: var(--r-3); background: var(--c-bg-surface); }
.page table { width: 100%; border-collapse: collapse; font-size: 15px; font-family: var(--font-sans); }
.page td { font-family: var(--font-sans); }
.page th, .page td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--c-line-soft); color: var(--c-fg-secondary); line-height: 1.5; }
.page th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-fg-tertiary); background: var(--c-bg-sunken); }
.page tr:last-child td { border-bottom: none; }
.page td:first-child { color: var(--c-fg-primary); white-space: nowrap; }
@media (max-width: 720px) { .page td:first-child { white-space: normal; } }
.page .callout { margin: var(--s-6) 0; padding: var(--s-4) var(--s-5); border: 1px solid var(--c-line); border-left: 2px solid var(--c-accent); border-radius: var(--r-2); background: var(--c-bg-surface); }
.page .callout p:last-child { margin-bottom: 0; }
/* Full sentences are never mono (style guide 2.1): asides and sign-offs are serif italic. */
.page .ai-note { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--c-fg-tertiary); }
.page .ai-note a { font-family: var(--font-mono); font-style: normal; font-size: 13px; color: var(--c-accent); }
.page .signoff { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--c-fg-tertiary); margin-top: var(--s-12); }

/* ── Footer ───────────────────────────────────────────── */
footer.site { border-top: 1px solid var(--c-line); padding: var(--s-8) 0 var(--s-12); margin-top: var(--s-8); }
footer.site .row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: var(--s-6); }
footer.site .cols { display: flex; flex-wrap: wrap; gap: var(--s-12); }
footer.site .col { display: flex; flex-direction: column; gap: var(--s-1); }
footer.site .col-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-fg-muted); margin-bottom: var(--s-2); }
footer.site a { color: var(--c-fg-secondary); text-decoration: none; font-size: var(--t-13); line-height: 1.7; }
footer.site a:hover { color: var(--c-fg-primary); }
footer.site .brand { color: var(--c-fg-secondary); }
footer.site .brand .mark { width: 18px; height: 18px; }
footer.site .brand .wordmark { font-size: var(--t-15); }
footer.site .small { margin-top: var(--s-12); font-family: var(--font-mono); font-size: var(--t-12); color: var(--c-fg-muted); font-variant-numeric: tabular-nums; }
footer.site .small .tagline { font-family: var(--font-display); font-style: italic; font-size: 14px; }

.page pre { font-family: var(--font-mono); font-size: 0.82em; background: var(--c-bg-sunken); border: 1px solid var(--c-line-soft); border-radius: var(--r-2); padding: 12px 14px; overflow-x: auto; white-space: pre; line-height: 1.5; }
.page pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ── Labels + meta (style guide 2.1–2.3, D3) ──────────────
   One label style everywhere: JetBrains Mono 500, 12px, capitals by styling, +0.08em,
   case-sensitive forms and slashed zero. Last in the file so it wins. */
.hero-eyebrow,
.rule .num,
.label-mono,
.quote .attribution,
.platforms .meta,
.tour-shots figcaption,
.page th,
footer.site .col-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-12);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  font-feature-settings: "case" 1, "zero" 1;
  font-variant-numeric: tabular-nums;
}
.status-pill .meta { font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1; }
