/* ============================================================
   RANCH HOUSE RECOVERY · Earth & Ember Design System
   Tokens pulled exactly from the approved brand guide.
   ============================================================ */

:root {
  /* Core palette */
  --clay:   #B85C2E;   /* primary accent: links, buttons, key marks */
  --oak:    #4A3520;   /* primary dark: feature bands, deep text */
  --sage:   #7A8767;   /* secondary accent */
  --hearth: #D97842;   /* highlight / hover, used sparingly */
  --sand:   #EFE6D4;   /* ground: primary background */

  /* Supporting neutrals */
  --sand-deep: #E3D6BB; /* surface tier */
  --bone:      #F6F0E2; /* top surface */
  --ink:       #2B1F15; /* primary text, dark walnut */
  --ink-soft:  rgba(43,31,21,0.70);
  --ink-faint: rgba(43,31,21,0.40);
  --bone-soft: rgba(246,240,226,0.72);
  --bone-faint:rgba(246,240,226,0.42);

  /* Typography */
  --display: 'Old Standard TT', Georgia, 'Times New Roman', serif;
  --body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Type scale (fluid) */
  --fs-display: clamp(3.5rem, 9vw, 10.5rem);   /* 56 - 168 */
  --fs-h1:      clamp(2.8rem, 6vw, 5.75rem);
  --fs-h2:      clamp(2rem, 4.2vw, 4rem);       /* 48 - 92 */
  --fs-h3:      clamp(1.4rem, 2.2vw, 2.375rem); /* 26 - 38 */
  --fs-lede:    clamp(1.15rem, 1.6vw, 1.375rem);/* 20 - 22 */
  --fs-body:    clamp(1rem, 1.1vw, 1.125rem);   /* 16 - 18 */
  --fs-label:   0.72rem;                        /* ~11-12 mono */

  /* Spacing & rhythm */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-y: clamp(4rem, 9vw, 9rem);
  --maxw: 1280px;
  --maxw-text: 68ch;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.6s;

  /* Borders */
  --rule: 1px solid var(--ink-faint);
  --rule-clay: 1.5px solid var(--clay);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  font-family: var(--body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--clay); text-decoration: none; transition: color 0.25s var(--ease-soft); }
a:hover { color: var(--hearth); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Type primitives ---------- */
.display { font-family: var(--display); font-weight: 400; line-height: 0.98; letter-spacing: -0.025em; }
.display em, .em-clay { font-style: italic; color: var(--clay); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; }
.lede { font-family: var(--display); font-size: var(--fs-lede); line-height: 1.45; color: var(--ink-soft); }

.label, .eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--clay);
}
.label-soft { color: var(--ink-faint); }
.label-bone { color: var(--bone-soft); }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.measure { max-width: var(--maxw-text); }
.center { text-align: center; }

/* Dark Oak feature band */
.band-oak { background: var(--oak); color: var(--bone); }
.band-oak h1, .band-oak h2, .band-oak h3 { color: var(--bone); }
.band-oak .lede { color: var(--bone-soft); }
.band-oak .label { color: var(--hearth); }
.band-oak a { color: var(--hearth); }

/* Section rule device: thick rule, clay diamond, thin rule */
.rule-device { display: flex; align-items: center; gap: 0; margin-block: 1.5rem; }
.rule-device::before { content:""; height: 2px; width: 56px; background: var(--ink); }
.rule-device::after  { content:""; height: 1px; flex: 1; background: var(--ink-faint); }
.rule-device .diamond { width: 7px; height: 7px; background: var(--clay); transform: rotate(45deg); margin-inline: 10px; flex: none; }
.band-oak .rule-device::before { background: var(--bone); }
.band-oak .rule-device::after  { background: var(--bone-faint); }

/* Clay hairline */
.hr-clay { height: 1.5px; background: var(--clay); border: none; }
.hr-ink  { height: 1px; background: var(--ink-faint); border: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7em;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 1.05em 1.7em; position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-primary { background: var(--clay); color: var(--bone); }
.btn-primary:hover { background: var(--hearth); color: var(--bone); transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(184,92,46,0.6); }
.btn-ghost { background: transparent; color: var(--clay); border: 1.5px solid var(--clay); }
.btn-ghost:hover { background: var(--clay); color: var(--bone); transform: translateY(-2px); }
.band-oak .btn-ghost { color: var(--bone); border-color: var(--bone-faint); }
.band-oak .btn-ghost:hover { background: var(--bone); color: var(--oak); border-color: var(--bone); }

/* ---------- Pattern surfaces ---------- */
/* P-01 Ruled grain: horizontal rules at 40px over bone */
.p-ruled {
  background-color: var(--bone);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, rgba(43,31,21,0.07) 39px, rgba(43,31,21,0.07) 40px);
}
.band-oak.p-ruled, .p-ruled-oak {
  background-color: var(--oak);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, rgba(246,240,226,0.06) 39px, rgba(246,240,226,0.06) 40px);
}

/* Registration corner marks */
.reg-frame { position: relative; }
.reg-frame .reg { position: absolute; width: 18px; height: 18px; pointer-events: none; opacity: 0.5; }
.reg-frame .reg::before, .reg-frame .reg::after { content:""; position: absolute; background: var(--clay); }
.reg-frame .reg::before { width: 100%; height: 1px; top: 50%; }
.reg-frame .reg::after  { height: 100%; width: 1px; left: 50%; }
.reg-tl { top: -9px; left: -9px; } .reg-tr { top: -9px; right: -9px; }
.reg-bl { bottom: -9px; left: -9px; } .reg-br { bottom: -9px; right: -9px; }

/* Figure label (book-design convention) */
.fig-label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); display: flex; gap: 0.8em; align-items: baseline; }
.fig-label .num { color: var(--clay); }
.band-oak .fig-label { color: var(--bone-faint); }
.band-oak .fig-label .num { color: var(--hearth); }

/* Pull quote */
.pullquote { font-family: var(--display); font-style: italic; font-size: clamp(1.5rem,3vw,2.5rem); line-height: 1.3; text-align: center; max-width: 24ch; margin-inline: auto; padding-block: 1.4rem; border-top: var(--rule-clay); border-bottom: var(--rule-clay); }
.pullquote cite { display: block; font-family: var(--mono); font-style: normal; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hearth); margin-top: 1.1rem; }

/* ---------- Reveal animation base ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; } .reveal-d4 { transition-delay: 0.32s; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--oak); color: var(--bone); padding: 0.8em 1.2em; z-index: 200; font-family: var(--mono); font-size: 0.8rem; }
.skip:focus { left: 0; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
