/* ============================================================================
   ARA-Commons — shared design system
   ----------------------------------------------------------------------------
   One stylesheet, one identity, across every marketing surface (landing,
   paper page, decks). The language is "dusk scholarship": warm cream paper,
   deep violet-ink letterforms, a single peach accent, and earth-strata
   secondary tones lifted from the watercolour cover. Editorial restraint and
   generous whitespace; a literary serif for display, humanist sans for body,
   and monospace for the things only an agent reads — file paths, claim ids,
   the four layers of an artifact.

   This is ARA's own system. It is not a clone of any other site: the brace
   motif `{ }`, the palindrome wordmark, the /logic·/src·/trace·/evidence
   file-tree, and the strata rules are all load-bearing brand elements drawn
   from brand-source/brand-direction.md and marketing/strategy/positioning.md.
   ============================================================================ */

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  /* Paper & ink — the dusk-scholar base. Warm, never cold SV-blue. */
  --paper:        #fbf8f1;   /* default warm cream */
  --paper-raise:  #fffdf8;   /* cards, raised surfaces */
  --paper-sink:   #f2ebdd;   /* sunken bands, alternating sections */
  --paper-ink:    #1d1832;   /* inverted (dark) sections */

  --ink:          #1a1530;   /* near-black, violet undertone — all display text */
  --ink-2:        #433c5e;   /* secondary text */
  --ink-3:        rgba(26, 21, 48, 0.58);  /* tertiary / captions */
  --ink-on-dark:  #f3efe6;   /* text on dark sections */

  --line:         rgba(26, 21, 48, 0.13);  /* hairline rules */
  --line-2:       rgba(26, 21, 48, 0.24);  /* stronger rules */
  --line-on-dark: rgba(243, 239, 230, 0.16);

  /* Brand accent — the single point of warmth (the mark's peach square). */
  --peach:        #e8a878;
  --peach-deep:   #c8784a;

  /* Strata — secondary earth tones from the cover. Used sparingly, one at a
     time, never as a rainbow. Each maps loosely to a layer of the artifact. */
  --sage:    #6f7d57;   /* /logic   — the green ridge */
  --teal:    #557b77;   /* /src     — the teal band   */
  --slate:   #4d5a78;   /* /trace   — the deep blue   */
  --ochre:   #c0954b;   /* /evidence— the gold seam   */
  --clay:    #ad6a52;   /* warnings / the storytelling tax */
  --gold:    #c9a24e;   /* the constellation network */

  /* Type */
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --maxw:    1180px;
  --maxw-rd: 760px;                       /* reading measure */
  --gutter:  clamp(24px, 5.2vw, 84px);
  --radius:  14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & base ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--peach); color: var(--ink); }

/* The grain that keeps cream from going flat — a faint paper tooth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.18  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ── Layout primitives ─────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(72px, 11vh, 132px); position: relative; }
.section--sink { background: var(--paper-sink); }
.section--ink  { background: var(--paper-ink); color: var(--ink-on-dark); }
.section--ink h2, .section--ink h3 { color: var(--ink-on-dark); }

/* Strata rule — the thin horizon line that recurs like a geological seam. */
.rule { height: 1px; background: var(--line); border: 0; }
.rule--strong { background: var(--line-2); }

/* ── Type scale ────────────────────────────────────────────────────────── */
.display {
  font-weight: 600;
  font-size: clamp(44px, 7.2vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.038em;
  color: var(--ink);
}
.display .serif {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}

h2.head {
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
h2.head .serif {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  letter-spacing: -0.01em;
}

h3.sub {
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 40ch;
}
.lede strong { color: var(--ink); font-weight: 600; }
.lede em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--ink); font-size: 1.06em;
}

.prose { max-width: var(--maxw-rd); color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-family: var(--serif); font-style: italic; font-size: 1.08em; color: var(--ink); }

/* ── Eyebrow & section index — the brace motif ─────────────────────────── */
/* `{ section label }` — the mark's curly braces become a structural device.
   Everything an agent would key on (sections, claim ids, layers) is wrapped
   in braces, because in this brand a brace means "a parseable unit". */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
}
.eyebrow::before { content: '{'; color: var(--peach-deep); font-weight: 600; }
.eyebrow::after  { content: '}'; color: var(--peach-deep); font-weight: 600; }

.index {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.index b { color: var(--ink); font-weight: 600; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn--ink   { background: var(--ink); color: var(--paper-raise); }
.btn--ink:hover { transform: translateY(-1px); background: #110d24; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn--light { background: rgba(255,255,255,0.9); color: var(--ink); backdrop-filter: blur(8px); }
.btn--light:hover { background: #fff; transform: translateY(-1px); }

/* ── Pair-rule chips: executable · verifiable · forkable ───────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 0.5ch;
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--accent, var(--peach)); }
.tag--exec { --accent: var(--teal); }
.tag--veri { --accent: var(--sage); }
.tag--fork { --accent: var(--ochre); }

/* ── Stat callout ──────────────────────────────────────────────────────── */
.stat { }
.stat .num {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat .num .accent { color: var(--clay); }
.stat .cap { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); max-width: 30ch; }
.stat .cap b { color: var(--ink-2); font-weight: 600; }

/* ── The four-layer artifact — a file tree, the agent's-eye view ───────── */
.layers {
  font-family: var(--mono);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper-raise);
  overflow: hidden;
}
.layers__head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.layers__dot { width: 9px; height: 9px; border-radius: 999px; background: var(--line-2); }
.layer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.layer:last-child { border-bottom: 0; }
.layer:hover { background: var(--paper-sink); }
.layer__path { font-size: 15px; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.layer__path .seam { width: 9px; height: 9px; border-radius: 2px; background: var(--seam, var(--peach)); transform: translateY(1px); }
.layer__what { font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); text-align: right; }
.layer--logic    { --seam: var(--sage); }
.layer--src      { --seam: var(--teal); }
.layer--trace    { --seam: var(--slate); }
.layer--evidence { --seam: var(--ochre); }

/* ── Era table: paper era → ARA era ────────────────────────────────────── */
.era { width: 100%; border-collapse: collapse; }
.era th, .era td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.era thead th {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink-3); text-transform: none;
}
.era tbody td:first-child { color: var(--ink-3); font-size: 15px; }
.era tbody td:last-child  { color: var(--ink); font-size: 15px; font-weight: 500; }
.era tbody tr:hover td { background: var(--paper-raise); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raise);
  padding: clamp(22px, 3vw, 34px);
}

/* ── Brand lockup ──────────────────────────────────────────────────────── */
.lockup { display: inline-flex; align-items: center; gap: 11px; }
.lockup__mark {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.lockup__mark img { width: 100%; height: 100%; object-fit: contain; }
.lockup__word { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.lockup__word .commons {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  margin-left: 3px; color: var(--ink-2);
}

/* ── Top navigation ────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav--solid {
  background: rgba(251, 248, 241, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  font-size: 14.5px; color: var(--ink-2); transition: color 0.2s;
  position: relative;
}
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.5ch;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 15px;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.nav__cta:hover { border-color: var(--ink); transform: translateY(-1px); }

/* ── Announcement strip ────────────────────────────────────────────────── */
.strip {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px var(--gutter);
  background: var(--ink); color: var(--ink-on-dark);
  font-size: 13px; font-family: var(--mono); letter-spacing: 0.01em;
}
.strip a { color: var(--peach); display: inline-flex; align-items: center; gap: 0.5ch; }
.strip .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--ink-on-dark); opacity: 0.5; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.foot { background: var(--paper-ink); color: var(--ink-on-dark); padding-block: clamp(56px, 8vh, 88px); }
.foot a { color: var(--ink-on-dark); opacity: 0.78; transition: opacity 0.2s; }
.foot a:hover { opacity: 1; }
.foot__rule { height: 1px; background: var(--line-on-dark); border: 0; margin-block: 36px; }
.foot__cols { display: grid; grid-template-columns: 1fr auto auto; gap: 40px 64px; align-items: start; }
.foot__col h4 { font-family: var(--mono); font-size: 12px; font-weight: 500; opacity: 0.55; margin-bottom: 14px; letter-spacing: 0.02em; }
.foot__col a { display: block; font-size: 14.5px; padding: 5px 0; }
.foot__palindrome { font-family: var(--serif); font-style: italic; font-size: 18px; opacity: 0.82; }

/* ── Reveal-on-scroll ──────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .foot__cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  .layer { grid-template-columns: 1fr; gap: 6px; }
  .layer__what { text-align: left; }
}
