/* Hallmark · macrostructure: Long Document editorial (Warm Local Pro mechanics, Kade's pick 2026-08-27 "I like this style more")
 * theme: warm paper + EMBER accent #C14E2B (matches the Ember in Stone logo) · one accent only
 * type: Newsreader 400-600 + italic (variable, self-hosted) · Hanken Grotesk body
 * motion: fail-visible reveals, condensing nav, gentle portrait parallax · reduced-motion clean
 */

/* ---------- fonts (self-hosted, latin) ---------- */
@font-face { font-family: "Newsreader"; src: url("fonts/Newsreader-var.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/NewsreaderItalic-var.woff2") format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/HankenGrotesk-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/HankenGrotesk-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/HankenGrotesk-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #F7F2E9;
  --sand: #EFE5D4;
  --cream: #F6F0E4;
  --ink: #292219;
  --body-warm: #57503F;
  --muted: #6B5F52;
  --faint: #A2947F;
  --ember: #C14E2B;
  --ember-deep: #A23F1F;
  --ember-soft: #D65F35;
  --line: rgba(41, 34, 25, 0.15);
  --line-strong: rgba(41, 34, 25, 0.24);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --band-r: 60px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ember); color: var(--cream); }
a { color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ember); color: var(--cream); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- reveal-on-scroll: FAIL VISIBLE ---------- */
.js .rv {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--d, 0s);
}
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
}

/* ---------- nav: condenses on scroll ---------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 26px; padding-bottom: 26px;
  transition: padding 0.4s cubic-bezier(0.16,1,0.3,1);
}
header.site.scrolled {
  background: rgba(247, 242, 233, 0.90);
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--line);
}
header.site.scrolled .nav { padding-top: 12px; padding-bottom: 12px; }
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1; }
.lockup svg {
  width: 34px; height: 34px; flex: none;
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1), height 0.4s cubic-bezier(0.16,1,0.3,1);
}
header.site.scrolled .lockup svg { width: 28px; height: 28px; }
.wordmark {
  font-family: var(--serif); font-size: 23px; font-weight: 500; letter-spacing: 0.01em;
  transition: font-size 0.4s cubic-bezier(0.16,1,0.3,1);
}
header.site.scrolled .wordmark { font-size: 20px; }
.wordmark span { font-style: italic; color: var(--ember); }
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a { font-size: 15.5px; font-weight: 500; text-decoration: none; color: var(--ink); position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -5px; height: 1.5px;
  background: var(--ember); transition: right 0.35s cubic-bezier(0.16,1,0.3,1);
}
.nav-links a:not(.btn):hover::after { right: 0; }
/* The CTA pill stays cream on ember; must outrank .nav-links a. Do not remove. */
.nav-links a.btn { color: var(--cream); }
@media (prefers-reduced-motion: reduce) {
  header.site, .nav, .wordmark, .lockup svg { transition: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  background: var(--ember); color: var(--cream);
  padding: 15px 30px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--ember);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), background 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 5px rgba(120, 62, 30, 0.14);
}
.btn:hover { background: var(--ember-deep); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(193,78,43,0.25); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.small { padding: 11px 22px; font-size: 15px; }
.btn.light { background: var(--cream); color: var(--ember-deep); border-color: var(--cream); box-shadow: 0 2px 5px rgba(60, 30, 12, 0.22); }
.btn.light:hover { background: #fffdf7; box-shadow: 0 12px 28px rgba(0,0,0,0.25); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--ember); outline-offset: 3px; border-radius: 4px;
}
.btn:focus-visible { border-radius: 999px; }
.textlink {
  font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink);
  border-bottom: 1.5px solid var(--line); padding-bottom: 3px;
  transition: border-color 0.25s, color 0.25s;
}
.textlink:hover { border-color: var(--ember); color: var(--ember-deep); }

/* ---------- display type ---------- */
h1 {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(2.8rem, 5.6vw, 4.7rem);
  line-height: 1.05; letter-spacing: -0.016em;
  margin-bottom: 28px; max-width: 15ch;
  padding-bottom: 5px;
}
h1 em, h2 em, .statement em { font-style: italic; font-weight: 400; color: var(--ember); }
h2 {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(2.1rem, 3.8vw, 3.1rem);
  line-height: 1.1; letter-spacing: -0.012em;
  margin-bottom: 20px; padding-bottom: 4px;
}
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ember); margin-bottom: 24px;
}

/* ---------- hero ---------- */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(820px 560px at 82% -8%, #F2DFC8 0%, rgba(242,223,200,0) 68%);
}
.hero .wrap {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 88px);
  padding-top: clamp(116px, 14vw, 164px);
  align-items: start;
}
.hero-sub {
  font-size: clamp(1.06rem, 1.4vw, 1.22rem); color: var(--muted);
  max-width: 42ch; margin-bottom: 38px;
}
.hero-ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding-bottom: clamp(64px, 8vw, 116px); }


/* ---------- centered hero (home) ---------- */
.hero-center .wrap {
  display: block;
  max-width: 980px;
  text-align: center;
  padding-top: clamp(128px, 15vw, 184px);
  padding-bottom: clamp(70px, 9vw, 120px);
}
.hero-center h1 {
  max-width: 16ch;
  margin-left: auto; margin-right: auto;
  font-size: clamp(2.9rem, 6.2vw, 5.3rem);
}
.hero-center .hero-sub { margin-left: auto; margin-right: auto; max-width: 46ch; }
.hero-center .hero-ctas { justify-content: center; padding-bottom: 0; }
.hero-center::before {
  background: radial-gradient(900px 560px at 50% -12%, #F2DFC8 0%, rgba(242,223,200,0) 70%);
}

/* ---------- sand band (doors / feature bands) ---------- */
.band {
  background: var(--sand);
  border-radius: var(--band-r);
  position: relative; z-index: 1;
}
.band.overlap {
  padding: clamp(80px, 10vw, 130px) 0;
}
.band-head { max-width: 60ch; }
.band-head p, .section-head p { color: var(--body-warm); font-size: 1.1rem; max-width: 52ch; }
.door-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
  margin-top: clamp(40px, 5vw, 60px);
}
.door {
  display: flex; flex-direction: column; align-items: flex-start; text-decoration: none;
  background: var(--cream);
  border: 1px solid rgba(41,34,25,0.10);
  border-radius: 32px;
  padding: clamp(34px, 4vw, 52px);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s;
}
.door:hover { transform: translateY(-4px); box-shadow: 0 20px 48px rgba(41,34,25,0.13); }
.door:focus-visible { border-radius: 32px; }
.door h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1.12; margin-bottom: 14px; padding-bottom: 3px; }
.door h3 em { font-style: italic; font-weight: 400; color: var(--ember); }
.door > p { color: var(--body-warm); font-size: 16.5px; max-width: 40ch; margin-bottom: 26px; }
.door-list { list-style: none; margin-bottom: 30px; width: 100%; }
.door-list li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  font-size: 15.5px; color: var(--body-warm);
  display: flex; align-items: baseline; gap: 12px;
}
.door-list li::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--ember); flex: none; position: relative; top: -2px;
}
.door .go {
  margin-top: auto;
  font-weight: 600; font-size: 16px; color: var(--ember-deep);
  border-bottom: 1.5px solid rgba(193,78,43,0.35); padding-bottom: 3px;
  transition: border-color 0.25s;
}
.door:hover .go { border-color: var(--ember); }

/* ---------- sections + steps ---------- */
section { padding: clamp(72px, 9vw, 130px) 0 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(36px, 4.5vw, 56px); }
.steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.step { border-top: 1.5px solid var(--line-strong); padding-top: 24px; }
.step .sno { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.05rem; color: var(--ember); display: block; margin-bottom: 10px; }
.step h3 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.6rem; line-height: 1.2; margin-bottom: 12px; padding-bottom: 3px;
}
.step p { font-size: 16px; color: var(--body-warm); max-width: 36ch; }

/* ---------- numbered system rows (subpages) ---------- */
.sys { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); border-top: 1.5px solid var(--line-strong); padding: 34px 0; }
.sys:last-of-type { border-bottom: 1.5px solid var(--line-strong); }
.sys .s-title { display: flex; align-items: baseline; gap: 16px; }
.sys .sno { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.05rem; color: var(--ember); }
.sys h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.2; padding-bottom: 2px; }
.sys p { color: var(--body-warm); font-size: 16.5px; max-width: 52ch; }

/* ---------- diagram panel ---------- */
.diagram {
  background: var(--cream); border: 1px solid var(--line); border-radius: 32px;
  padding: clamp(16px, 2.4vw, 34px);
  overflow-x: auto;
  margin-top: clamp(30px, 4vw, 44px);
}
.diagram svg { min-width: 760px; width: 100%; height: auto; display: block; }

/* ---------- QA ---------- */
.qa {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 4vw, 64px);
  border-top: 1.5px solid var(--line-strong);
  padding: 34px 0;
}
.qa:last-of-type { border-bottom: 1.5px solid var(--line-strong); }
.qa h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.25; padding-bottom: 2px; }
.qa p { color: var(--body-warm); font-size: 16.5px; }


/* ---------- form ---------- */
.form-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: 32px;
  padding: clamp(28px, 4vw, 52px);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line-strong); border-radius: 14px;
  padding: 13px 15px;
  transition: border-color 0.2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.form-note { font-size: 14.5px; color: var(--muted); margin-top: 14px; }

/* ---------- close band (carries the footer) ---------- */
.close {
  background: radial-gradient(130% 150% at 50% -25%, var(--ember-soft) 0%, var(--ember) 40%, var(--ember-deep) 100%);
  border-radius: var(--band-r) var(--band-r) 0 0;
  margin-top: clamp(90px, 11vw, 150px);
  color: var(--cream);
  padding: clamp(90px, 11vw, 150px) 0 44px;
  position: relative; overflow: hidden;
}
.close::before {
  content: ""; position: absolute; left: 50%; top: clamp(44px, 6vw, 84px);
  transform: translateX(-50%);
  width: min(820px, 86vw); height: 560px;
  border: 1.5px solid rgba(246,240,228,0.16); border-bottom: 0;
  border-radius: 999px 999px 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  pointer-events: none;
}
.close-inner { position: relative; text-align: center; }
.close h2 {
  color: var(--cream); max-width: 17ch; margin-left: auto; margin-right: auto;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.1;
}
.close h2 em { color: #F6C9A8; }
.close-inner > p { color: rgba(246,240,228,0.85); max-width: 52ch; margin: 0 auto; font-size: 1.06rem; }
.close-ctas { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 40px; }
.close a:focus-visible { outline-color: var(--cream); }
.close-foot {
  position: relative;
  margin-top: clamp(80px, 10vw, 140px);
  border-top: 1px solid rgba(246,240,228,0.28);
  padding-top: 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.close-foot .lockup svg { width: 28px; height: 28px; }
.close-foot .wordmark { color: var(--cream); font-size: 20px; }
.close-foot .wordmark span { color: #F6C9A8; }
.foot-right { display: flex; gap: 28px; align-items: baseline; font-size: 14.5px; color: rgba(246,240,228,0.7); flex-wrap: wrap; }
.foot-right a { text-decoration: none; color: rgba(246,240,228,0.85); font-weight: 500; border-bottom: 1px solid rgba(246,240,228,0.3); padding-bottom: 1px; }
.foot-right a:hover { border-color: var(--cream); color: var(--cream); }
.foot-fine { position: relative; margin-top: 22px; font-size: 13px; color: rgba(246,240,228,0.55); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- page heroes (subpages) ---------- */
.page-hero .wrap { display: block; padding-top: clamp(116px, 14vw, 156px); padding-bottom: clamp(20px, 3vw, 40px); }
.page-hero h1 { max-width: 18ch; }
.page-hero .hero-ctas { padding-bottom: clamp(28px, 4vw, 48px); }

/* ---------- anchors + responsive ---------- */
#doors, #how, #answers, #contact, #systems, #example, #custom { scroll-margin-top: 96px; }

@media (max-width: 920px) {
  :root { --band-r: 44px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; padding-top: 112px; }
  h1 { max-width: 14ch; }
  .hero-ctas { padding-bottom: 24px; }
  .band.overlap { padding-top: 90px; }
  .door-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .sys, .qa { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .page-hero .wrap { padding-top: 108px; }
}
@media (max-width: 480px) {
  :root { --band-r: 32px; }
  body { font-size: 16px; }
  h1 { font-size: 2.55rem; }
  .btn { padding: 14px 26px; }
  .close::before { width: 120vw; }
  .foot-right { gap: 16px; }
}

/* ---------- legal / doc pages ---------- */
.doc { max-width: 720px; }
.doc h2 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); margin-top: 44px; margin-bottom: 12px; }
.doc p, .doc li { color: var(--body-warm); font-size: 16.5px; }
.doc ul { padding-left: 22px; margin: 10px 0 16px; }
.doc li { margin-bottom: 6px; }
.doc .updated { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.doc a { color: var(--ember-deep); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid rgba(193,78,43,0.35); }
.doc a:hover { border-color: var(--ember); }
