/* ═══════════════════════════════════════════════════════════════
   Warp & Weft — front door
   Aesthetic: "the woven page" — warm undyed linen, ink, and the two
   oldest dyes (indigo warp, madder weft). Editorial, unhurried,
   ceremony over click. No frameworks, no build step, no tracking.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --linen:  #f4efe6;
  --linen-deep: #ece4d4;
  --ink:    #26231d;
  --ink-soft: #57503f;
  --indigo: #2b3a67;
  --indigo-bright: #40548f;
  --madder: #9a4a32;
  --thread: rgba(43, 58, 103, .28);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Newsreader", "Iowan Old Style", Georgia, serif;

  --measure: 62ch;
  --step--1: clamp(.83rem, .8rem + .18vw, .95rem);
  --step-0:  clamp(1.05rem, .98rem + .35vw, 1.28rem);
  --step-1:  clamp(1.35rem, 1.2rem + .7vw, 1.8rem);
  --step-2:  clamp(1.9rem, 1.55rem + 1.7vw, 3rem);
  --step-3:  clamp(2.6rem, 1.9rem + 3.6vw, 5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --linen: #191d2b;          /* night loom: deep indigo ground */
    --linen-deep: #141726;
    --ink: #e9e2d2;
    --ink-soft: #b0a891;
    --indigo: #8fa1d6;
    --indigo-bright: #aebde6;
    --madder: #cd7c5f;
    --thread: rgba(143, 161, 214, .3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* linen grain */
.grain {
  position: fixed; inset: 0; z-index: 10; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { mix-blend-mode: screen; opacity: .35; } }

/* ── masthead ─────────────────────────────────────────────── */
.masthead {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(2.5rem, 6vh, 4.5rem) 1.5rem 0;
}
.mark {
  display: grid; grid-template-columns: repeat(3, 9px); gap: 4px;
  margin-bottom: 1.1rem;
}
.mark span {
  height: 9px;
  border-top: 2.5px solid var(--indigo);
  border-bottom: 2.5px solid var(--indigo);
  position: relative;
}
.mark span::after {
  content: ""; position: absolute; inset: -4px auto -4px 50%;
  width: 2.5px; margin-left: -1.25px; background: var(--madder);
}
.mark span:nth-child(2)::after { inset-block: -7px; }

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .42em; text-indent: .42em;
  text-transform: uppercase;
}
.wordmark em { font-style: italic; color: var(--madder); letter-spacing: 0; }

/* ── hero ─────────────────────────────────────────────────── */
.hero {
  max-width: 46rem; margin: 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) 1.5rem clamp(4rem, 10vh, 7rem);
  text-align: center;
}
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -.015em;
}
h1 em { font-style: italic; color: var(--indigo); }

.weft-line {
  width: min(20rem, 70%); height: 12px; margin: 1.6rem auto 0;
  color: var(--madder); display: block;
}
.weft-line path {
  stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: draw 2.4s cubic-bezier(.4, 0, .2, 1) .5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.lede {
  max-width: var(--measure); margin: 2rem auto 0;
  font-size: var(--step-1); line-height: 1.55;
  color: var(--ink-soft);
}
.lede em { color: var(--ink); }

/* ── ask (email capture) ──────────────────────────────────── */
.ask { max-width: 30rem; margin: 2.75rem auto 0; }
.ask input {
  width: 100%; padding: .85rem .25rem;
  font: inherit; text-align: center;
  color: var(--ink); background: transparent;
  border: 0; border-bottom: 1.5px solid var(--thread);
  transition: border-color .4s ease;
}
.ask input::placeholder { color: var(--ink-soft); opacity: .55; }
.ask input:focus { outline: none; border-bottom-color: var(--indigo); }
.ask input:focus-visible { outline: 2px solid var(--indigo); outline-offset: 4px; }

.ask button {
  display: block; width: 100%; margin-top: 1.1rem;
  padding: .95rem 1.5rem;
  font-family: var(--font-display); font-size: var(--step-0); font-weight: 600;
  letter-spacing: .06em;
  color: var(--linen); background: var(--indigo);
  border: 1.5px solid var(--indigo); border-radius: 2px;
  cursor: pointer;
  transition: background .5s ease, letter-spacing .5s ease;
}
.ask button:hover, .ask button:focus-visible { background: var(--madder); border-color: var(--madder); letter-spacing: .09em; }
@media (prefers-color-scheme: dark) {
  .ask button { color: var(--linen-deep); }
}

.ask-note, .ask-fallback {
  margin: 1.1rem auto 0; max-width: 34ch;
  font-size: var(--step--1); font-style: italic; color: var(--ink-soft);
  line-height: 1.55;
}
.ask-fallback a { color: var(--madder); }

/* ── woven divider ────────────────────────────────────────── */
.weave {
  height: 13px; max-width: 34rem; margin: 0 auto;
  background:
    repeating-linear-gradient(90deg, var(--madder) 0 7px, transparent 7px 16px),
    repeating-linear-gradient(0deg, var(--indigo) 0 2.5px, transparent 2.5px 5.5px);
  opacity: .3;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

/* ── prose sections ───────────────────────────────────────── */
section { padding: clamp(3.5rem, 9vh, 6.5rem) 1.5rem; }
.prose { max-width: var(--measure); margin: 0 auto; }

.section-label {
  margin: 0 0 1.4rem;
  font-family: var(--font-display); font-size: var(--step--1);
  font-weight: 600; font-variant: small-caps; letter-spacing: .3em;
  color: var(--madder);
}
h2 {
  margin: 0 0 1.4rem;
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-2); line-height: 1.15; letter-spacing: -.01em;
}
.prose p { margin: 0 0 1.2rem; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 500; }

/* ── tiers ────────────────────────────────────────────────── */
.tiers { max-width: 72rem; margin: 0 auto; }
.tiers .section-label { text-align: center; margin-bottom: 3rem; }
.tier-row {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.tier {
  position: relative; padding-top: 2.2rem;
}
.tier::before {              /* hanging warp thread */
  content: ""; position: absolute; top: 0; left: 0;
  width: 1.5px; height: 100%;
  background: linear-gradient(var(--madder) 0 1.4rem, var(--thread) 1.4rem);
}
.tier { padding-left: 1.6rem; }
.tier-numeral {
  margin: 0 0 .4rem;
  font-family: var(--font-display); font-style: italic;
  font-size: var(--step-1); color: var(--madder);
}
.tier h3 {
  margin: 0 0 .8rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-1); letter-spacing: .01em;
}
.tier p { margin: 0; font-size: var(--step-0); color: var(--ink-soft); line-height: 1.6; }
.tier strong { color: var(--ink); font-weight: 500; }

/* ── how it feels ─────────────────────────────────────────── */
.feels { margin: 2.2rem 0 0; }
.feels div { margin-bottom: 1.6rem; }
.feels dt {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-1); margin-bottom: .3rem;
}
.feels dt::before { content: "— "; color: var(--madder); }
.feels dd { margin: 0; color: var(--ink-soft); }

/* ── founder / closing ────────────────────────────────────── */
.founder blockquote { margin: 0; font-style: italic; font-size: var(--step-1); line-height: 1.5; }
.founder cite { display: block; margin-top: 1rem; font-style: normal; color: var(--madder); }

.closing { text-align: center; }
.closing h2 { margin-bottom: 1.6rem; }
.closing p { max-width: 48ch; margin-inline: auto; }

/* ── footer ───────────────────────────────────────────────── */
footer { padding: 0 1.5rem clamp(2.5rem, 6vh, 4rem); text-align: center; }
footer .weave { margin-bottom: 2.6rem; }
.foot-id { margin: 0 0 1.2rem; font-size: var(--step--1); color: var(--ink-soft); }
.foot-id a { color: var(--indigo-bright); text-decoration-color: var(--thread); }
.boundary {
  max-width: 52ch; margin: 0 auto 1.4rem;
  font-size: var(--step--1); font-style: italic;
  color: var(--ink-soft); line-height: 1.6;
}
.foot-year { margin: 0; font-size: var(--step--1); color: var(--ink-soft); opacity: .7; }

/* ── reveal on scroll ─────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.masthead .mark { transition-delay: .1s; }
.masthead .wordmark { transition-delay: .25s; }

/* ── a11y ─────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .weft-line path { animation: none; stroke-dashoffset: 0; }
  .ask button { transition: none; }
}
