/* ============================================================
   SOCIARO — DESIGN SYSTEM v2
   Dark editorial. Monochrome + deep gold.
   Used across every page. Variables only; no selectors that
   conflict with per-page layout.
   ============================================================ */

:root {
  /* ── MEASURE ── */
  --col:     1160px;            /* main reading column */
  --wide:    1360px;            /* hero + footer + navs    */
  --ultra:   1560px;            /* ultra-wide feature hero */
  --margin:  clamp(24px, 5vw, 88px);

  /* ── PALETTE — LIGHT editorial (default) ─────────────
     Cream paper, warm ink, deep gold. Mirrors the dark
     scheme 1:1 so all component rules keep working. */
  --paper:   #f5efe2;           /* cream base              */
  --paper-2: #ede6d4;           /* raised / section wash   */
  --paper-3: #e4dcc6;           /* raised-2                */
  --paper-4: #d8cfb7;           /* stroke-on-stroke        */

  --ink:     #1a1510;           /* near-black headline     */
  --ink-2:   #3a2f22;           /* body copy               */
  --ink-3:   #7a6e5e;           /* secondary / labels      */
  --ink-4:   #a89d8a;           /* tertiary / disabled     */
  --ink-5:   #c9bfa9;           /* separators              */

  --rule:    #c9bfa9;
  --rule-2:  #d8cfb7;

  /* deep gold accent */
  --accent:  #9a7a2e;           /* primary gold — high-contrast on cream */
  --accent-2:#7a5e1e;           /* hover / pressed          */
  --accent-3:#c09441;           /* lit variant              */
  --accent-ink: #fff8e8;        /* text-on-gold             */

  /* signal colors — used extremely sparingly */
  --ok:      #6a8a5c;
  --warn:    #b8822f;
  --err:     #a44a3a;

  /* ── TYPOGRAPHY ── */
  --display: "Fraunces", "Tiempos Headline", Georgia, serif;
  --serif:   "Source Serif 4", "Charter", Georgia, serif;
  --sans:    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* ── ELEVATION / SHADOW ── */
  --shadow-1: 0 1px 0 rgba(201,162,76,0.04), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-2: 0 8px 32px -8px rgba(0,0,0,0.6);
  --glow:     0 0 0 1px rgba(201,162,76,0.2), 0 0 24px -4px rgba(201,162,76,0.15);

  /* ── MOTION ── */
  --ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out:  cubic-bezier(0, 0, 0.2, 1);

  /* ── THEME-AWARE BACKGROUND RGBAs (for nav blur bg, etc) */
  --paper-rgb: 245, 239, 226;
}

/* Pupper Light + Bookish — locked. No dark-mode override. */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-image:
    radial-gradient(circle at 20% -10%, rgba(154,122,46,0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 110%, rgba(154,122,46,0.03) 0%, transparent 45%);
  background-attachment: fixed;
}


a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: rgba(201,162,76,0.35); color: var(--ink); }

/* ── LAYOUT PRIMITIVES ── */
.col, .col-w, .col-u {
  margin: 0 auto;
  padding: 0 var(--margin);
}
.col   { max-width: var(--col); }
.col-w { max-width: var(--wide); }
.col-u { max-width: var(--ultra); }

/* ── LINKS ── */
.link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.005em;
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.link:hover { color: var(--accent-3); border-bottom-color: var(--accent); }
.link--muted { color: var(--ink-2); }
.link--muted:hover { color: var(--ink); border-bottom-color: var(--ink-4); }

/* ── EYEBROW / LABELS ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ── NUMERAL DISPLAY ── */
.num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-feature-settings: "lnum", "tnum";
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: center;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-3);
  border-color: var(--accent-3);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -6px rgba(201,162,76,0.5);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-5);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--link {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--accent);
  border-bottom: 1px solid var(--ink-5);
  border-radius: 0;
  padding-bottom: 2px;
}
.btn--link:hover { border-bottom-color: var(--accent); color: var(--accent-3); }

/* arrow marker */
.btn .arrow, .link .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow, .link:hover .arrow { transform: translateX(3px); }

/* ── SECTIONS ── */
.section {
  padding: clamp(24px, 2.75vw, 40px) 0;
  border-bottom: 1px solid var(--rule-2);
  position: relative;
}
.section-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex; align-items: baseline; gap: 12px;
}
.section-num .n { color: var(--accent); }
.section-num .sep { color: var(--ink-5); }

.section-head {
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: end;
}
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; }
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.section-lede {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}
.section-lede em { color: var(--accent-3); font-style: italic; }

/* ── RULES ── */
.rule { border: 0; border-top: 1px solid var(--rule-2); margin: 0; }
.rule--accent { border-top-color: var(--accent); }
.rule--double { border: 0; border-top: 3px double var(--rule); }

/* ── CARDS ── */
.card {
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  padding: 32px;
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.card:hover {
  border-color: var(--rule);
  background: var(--paper-3);
}
.card--link:hover { cursor: pointer; }
.card__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
  display: flex; justify-content: space-between;
}
.card__eyebrow .tag { color: var(--accent); }
.card__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 12px;
  text-wrap: balance;
}
.card__body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 20px;
}
.card__foot {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ── CODE BLOCKS ── */
.code {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
  padding: 20px 24px;
  overflow-x: auto;
  white-space: pre;
  font-feature-settings: "liga" 0;
  border-radius: 2px;
}
.code .c { color: var(--ink-4); font-style: italic; }  /* comment */
.code .k { color: var(--accent-3); }                    /* keyword */
.code .s { color: var(--ok); }                          /* string */
.code .n { color: var(--ink); }                         /* numeric */
.code .h { background: rgba(201,162,76,0.1); padding: 2px 4px; border-radius: 2px; color: var(--accent); }

.code-before, .code-after { position: relative; }
.code-before::before, .code-after::before {
  content: '# Before'; display: block;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule-2);
}
.code-after::before { content: '# After · one line changed'; color: var(--accent); }

/* ── FORMS ── */
.field {
  display: flex; flex-direction: column; gap: 8px;
}
.field__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field__input {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 15px;
  border-radius: 2px;
  transition: border-color .2s var(--ease);
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
}
.field__input::placeholder { color: var(--ink-4); }

/* ── MASTHEAD (site nav) ── */
.nav {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-2);
  position: sticky; top: 0; z-index: 50;
  background: rgba(var(--paper-rgb), 0.85);
  backdrop-filter: blur(14px) saturate(150%);
}
.nav-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--margin);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.nav__brand {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav__brand sup {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  position: relative; top: -4px;
}
.nav__brand .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  position: relative; top: -2px;
}
.nav__links {
  display: flex; align-items: center; gap: 28px;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
}
.nav__links a {
  position: relative;
  padding: 6px 0;
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::after {
  content: ''; position: absolute;
  bottom: -19px; left: 0; right: 0;
  height: 1px; background: var(--accent);
}
.nav__cta { display: flex; align-items: center; gap: 12px; }

@media (max-width: 900px) {
  .nav-inner { grid-template-columns: auto auto; }
  .nav__links { display: none; }
}

/* ── FOOTER ── */
.footer {
  padding: 56px 0 28px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--margin);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule-2);
}
.footer-brand {
  display: flex; flex-direction: column; gap: 16px;
}
.footer-brand__name {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.footer-brand__tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-3);
  max-width: 280px;
  line-height: 1.5;
}
.footer-brand__news {
  margin-top: 8px;
  display: flex;
  max-width: 320px;
}
.footer-brand__news input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--rule);
  border-right: 0;
  color: var(--ink);
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: 2px 0 0 2px;
}
.footer-brand__news input:focus { outline: none; border-color: var(--accent); }
.footer-brand__news button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 6px 0; }
.footer-col a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--accent); }
.footer-bot {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.footer-bot-links { display: flex; gap: 24px; }
.footer-bot a { color: var(--ink-4); transition: color .2s var(--ease); }
.footer-bot a:hover { color: var(--accent); }
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bot { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ── UTILITY ── */
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 16px); }
.grid { display: grid; gap: var(--gap, 32px); }
.spacer { flex: 1; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.display { font-family: var(--display); }

.text-ink { color: var(--ink); }
.text-muted { color: var(--ink-3); }
.text-accent { color: var(--accent); }

.hide-sm { display: initial; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* ── PRINT ── */
@media print {
  body { background: white; color: black; }
  .nav, .footer { display: none; }
}

/* ── SCROLL REVEAL (opt-in via data-reveal) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ── CODE FIGURE WRAPPER (replaces the old React CodeBlock) ── */
.code-fig { margin: 0; }
.code-fig__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-2);
}
.code-fig__label--accent { color: var(--accent); }
