/* =============================================================
   ARATECH — Site styles
   Shared across every page in /site/. Direction A's tokens
   distilled from components/startup-chrome.jsx and the
   global colors_and_type.css.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Inter:wght@400;450;500;600&family=Newsreader:ital,wght@0,300;0,400;1,300&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces — dark default */
  --ink:           #0A0A0A;
  --ink-soft:      #121212;
  --ink-elev:      #161616;
  --line:          #1E1E1E;
  --line-strong:   #2A2A2A;

  /* Foregrounds */
  --text:          #EDEAE2;
  --text-mute:     #9A958C;
  --text-dim:      #5F5B53;

  /* Accent — softer brass per direction A */
  --accent:        #D4B488;
  --accent-soft:   #E3C8A0;
  --accent-deep:   #8C6E41;

  /* Type stacks */
  --font-display:  'Chakra Petch', 'Saira', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:    'Newsreader', 'Source Serif 4', Georgia, serif;
  --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Layout */
  --gutter:        clamp(20px, 4vw, 48px);
  --max:           1200px;
  --rail:          260px;

  /* Motion */
  --ease:          cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  --ink:           #FAFAF7;
  --ink-soft:      #F4F1EA;
  --ink-elev:      #FFFFFF;
  --line:          #E6E0D2;
  --line-strong:   #D4CCBA;

  --text:          #1A1714;
  --text-mute:     #5F5B53;
  --text-dim:      #8A857B;

  --accent:        #8C6E41;
  --accent-soft:   #A98756;
  --accent-deep:   #5C4628;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ink); }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
em { font-style: italic; }

/* ─── Selection ─── */
::selection { background: var(--accent); color: #0A0A0A; }

/* ─── Type primitives ─── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6.6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.h-1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.h-2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.h-3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
  margin: 0;
  color: var(--text);
}

.lede {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
  margin: 0;
}
.prose p {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 18px 0;
  max-width: 68ch;
  text-wrap: pretty;
}
.prose p.muted { color: var(--text-mute); }

.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.accent { color: var(--accent); }

/* ─── Layout ─── */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page > main { flex: 1; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

.section {
  padding: clamp(64px, 9vw, 120px) 0;
  border-top: 1px solid var(--line);
}
.section.no-border { border-top: 0; }

.split {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.split > .body { max-width: 760px; }

/* ─── Nav ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  height: 68px;
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__lockup {
  height: 22px;
  width: auto;
  display: block;
  color: var(--text);
}
.nav__lockup .brass { fill: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 450;
  color: var(--text-mute);
  transition: color 160ms var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--text); }

.nav__theme {
  margin-left: 12px;
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  transition: color 160ms, border-color 160ms;
}
.nav__theme:hover { color: var(--accent); border-color: var(--accent); }
.nav__theme svg { width: 16px; height: 16px; }
.nav__theme .icon-light { display: none; }
.nav__theme .icon-dark { display: block; }
[data-theme="light"] .nav__theme .icon-light { display: block; }
[data-theme="light"] .nav__theme .icon-dark { display: none; }

.nav__menu {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  color: var(--text);
}
.nav__menu svg { width: 22px; height: 22px; }

/* ─── Buttons ─── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #0A0A0A;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 10px);
}
.btn--primary:hover { background: var(--text); color: var(--ink); }
/* Light mode: brass is mid-tone, so flip the primary button to deep-brass-on-cream
   for proper contrast. Keeps the metallic feel without washing out. */
[data-theme="light"] .btn--primary {
  background: var(--accent-deep);
  color: #FAFAF7;
}
[data-theme="light"] .btn--primary:hover {
  background: #0A0A0A;
  color: #FAFAF7;
}
.btn--secondary {
  background: var(--ink-soft);
  color: var(--text);
  border: 1px solid var(--line-strong);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--text); }
.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: 10px 0;
}
.btn--ghost::after {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
  transition: width 200ms var(--ease);
}
.btn--ghost:hover::after { width: 40px; }

/* ─── Status pill ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 2px;
}
.pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill--amber { background: #261E10; color: #D4B488; }
.pill--live  { background: #12251A; color: #7FC79A; }
.pill--neutral { background: var(--ink-soft); color: var(--text-mute); }
[data-theme="light"] .pill--amber { background: #F4E9D5; color: #8C6E41; }
[data-theme="light"] .pill--live  { background: #DEEDE0; color: #3E6D4D; }
[data-theme="light"] .pill--neutral { background: var(--ink-soft); color: var(--text-mute); }

/* ─── Tag chip ─── */
.tag {
  display: inline-block;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
}

/* ─── Cards ─── */
.card {
  background: var(--ink);
  border: 1px solid var(--line);
  padding: 36px 32px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
[data-theme="light"] .card { background: var(--ink-elev); }

/* ─── Forms ─── */
.input {
  flex: 1;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 160ms;
}
.input:focus { border-color: var(--accent); }

/* ─── Footer ─── */
.footer {
  padding: 80px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  background: var(--ink);
}
.footer__grid {
  max-width: var(--max);
  margin: 0 auto 64px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 64px;
}
.footer__brand { display: flex; flex-direction: column; gap: 20px; }
.footer__brand-row { display: flex; align-items: center; gap: 14px; }
.footer__word {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.footer__tag {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mute);
  margin: 0;
  max-width: 360px;
}
.footer__col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer__link {
  display: block;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  transition: color 160ms;
}
.footer__link:hover { color: var(--accent); }
.footer__bar {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.footer__bar a:hover { color: var(--accent); }

/* ─── Hero common ─── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 128px) 0 clamp(64px, 8vw, 96px);
}
.hero__watermark {
  position: absolute;
  pointer-events: none;
  opacity: 0.07;
}

/* ─── Page-corner mono codes (editorial flourish) ─── */
.corner-codes {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.corner-codes--tl { top: 24px; left: var(--gutter); }
.corner-codes--tr { top: 24px; right: var(--gutter); }

/* ─── Meta strip (key/value rows) ─── */
.meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.meta-row__pair { display: flex; flex-direction: column; gap: 6px; }
.meta-row__k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.meta-row__v {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--text);
}

/* ─── Section label rail ─── */
.rail-label {
  position: sticky;
  top: 100px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.rail-label::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─── Utility ─── */
.divider {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 0;
}
.hidden { display: none !important; }

/* ─── Mobile breakpoint ─── */
@media (max-width: 880px) {
  :root { --rail: 100%; }

  .nav { height: 56px; padding: 12px var(--gutter); }
  .nav__links { display: none; }
  .nav__theme { display: none; }
  .nav__menu { display: inline-flex; }

  .nav.is-open .nav__links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .nav.is-open .nav__link { padding: 14px var(--gutter); border-top: 1px solid var(--line); }
  .nav.is-open .nav__link:first-child { border-top: 0; }

  .split { grid-template-columns: 1fr; gap: 32px; }
  .rail-label { position: static; }

  .meta-row { grid-template-columns: repeat(2, 1fr); gap: 24px; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__bar { flex-direction: column; gap: 8px; align-items: flex-start; }

  .corner-codes { display: none; }
}

@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
