/* ============================================================
   fairywren — redesign concept 3: "the arithmetic"
   Thesis: the pitch IS arithmetic — lead with the numbers.
   Dark ink ground, no imagery: a year of months, big exact
   figures, spreadsheet-true tables, a working season calculator.
   Tokens: brand/tokens.css (dark). One easing.
   ============================================================ */

:root {
  --bg:        #0a0b12;
  --bg-raise:  #10111b;
  --card:      #141626;
  --card-2:    #191c2e;
  --line:      #262a3d;
  --line-soft: #1d2030;
  --text:      #eef0f7;
  --text-dim:  #a6aac2;
  --text-mute: #767a95;
  --accent:       #4f6bff;
  --accent-text:  #7d92ff;
  --accent-hover: #7d92ff;
  --glow: rgba(79,107,255,.22);
  --ok: #3fcf8e;

  --font-head: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1020px;
  --maxw-text: 760px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-tap: 150ms;
  --t-ui: 280ms;
  --t-reveal: 600ms;
  --t-hero: 900ms;
  --focus-ring: 0 0 0 3px rgba(79,107,255,.22), 0 0 0 1.5px #4f6bff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image: radial-gradient(1000px 520px at 12% -12%, rgba(79,107,255,.10), transparent 62%);
}

a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
a:not(.btn):focus-visible { border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; }

.wordmark {
  font-family: var(--font-head); font-weight: 600; letter-spacing: -0.03em;
  text-decoration: none; color: var(--text);
}
.wordmark .dot { color: var(--accent); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid transparent;
  background: rgba(10,11,18,.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--t-ui) var(--ease), background var(--t-ui) var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line-soft); background: rgba(10,11,18,.84); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 18px; }
.nav .wordmark { font-size: 1.32rem; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { white-space: nowrap;
  text-decoration: none; color: var(--text-dim); font-size: .95rem; font-weight: 500;
  transition: color var(--t-ui) var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .btn { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .92rem 1.7rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease),
              transform var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 30px -8px var(--glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(79,107,255,.42); }
.btn-ghost:hover { background: rgba(79,107,255,.12); border-color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: .55rem 1.1rem; font-size: .92rem; }

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.16rem; letter-spacing: -0.02em; }
.lead { color: var(--text-dim); font-size: clamp(1.02rem, 2.1vw, 1.16rem); max-width: var(--maxw-text); }
.mono { font-family: var(--font-mono); letter-spacing: .03em; }

.section { padding: clamp(52px, 7.5vw, 100px) 0; }
.section-tight { padding: clamp(36px, 5vw, 64px) 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 9vw, 110px) 0 0; }
.js .rise { opacity: 0; transform: translateY(20px); animation: rise var(--t-hero) var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.rise-2 { animation-delay: 90ms !important; }
.rise-3 { animation-delay: 180ms !important; }

/* ---------- the year strip (hero moment) ---------- */
.year { margin-top: clamp(32px, 5vw, 56px); }
.year-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.month {
  position: relative; border: 1px solid var(--line-soft); border-radius: 8px;
  background: linear-gradient(180deg, var(--card), var(--bg-raise));
  aspect-ratio: 1 / 1.5; padding: 8px 0 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.month .m { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; color: var(--text-mute); }
.month .amt { font-family: var(--font-mono); font-size: .72rem; color: var(--text-dim); }
.month .dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; padding: 0 6px; min-height: 9px; }
.month .dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 2px rgba(79,107,255,.18); }
.month.on { border-color: rgba(79,107,255,.55); }
.month.on .amt { color: var(--accent-text); }
/* staggered light-up — the one hero moment */
.js .month { opacity: 0; transform: translateY(14px); transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }
.js .month.lit { opacity: 1; transform: none; }
.year-sum {
  margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between;
  font-family: var(--font-mono); font-size: .84rem; letter-spacing: .03em; color: var(--text-dim);
}
.year-sum .total { color: var(--text); }
.year-sum .zero { color: var(--ok); }

/* ---------- stat band ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: clamp(22px, 3.5vw, 36px) clamp(16px, 3vw, 32px); border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat .big { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.stat .big .unit { font-size: .45em; color: var(--text-mute); font-weight: 500; letter-spacing: -0.01em; }
.stat p { margin: .7rem 0 0; color: var(--text-dim); font-size: .95rem; }

/* ---------- what a wedding buys ---------- */
.buys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.buy {
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--card), var(--bg-raise));
  padding: 20px 22px;
  transition: border-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.buy:hover { border-color: var(--line); transform: translateY(-3px); }
.buy h3 { font-size: 1.05rem; }
.buy p { margin: .3rem 0 0; color: var(--text-dim); font-size: .93rem; }
.buy .v { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .03em; color: var(--accent-text); display: block; margin-top: .6rem; }

/* ---------- calculator ---------- */
.calc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-raise));
  padding: clamp(22px, 4vw, 40px);
}
.calc fieldset { border: 0; margin: 0; padding: 0; }
.calc legend { font-weight: 600; font-size: .98rem; padding: 0; margin-bottom: .7rem; color: var(--text); }
.calc .group { margin-top: 1.5rem; }
.calc .group:first-child { margin-top: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font-family: var(--font-head); font-weight: 500; font-size: .95rem;
  color: var(--text-dim); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: .55rem 1.15rem;
  cursor: pointer;
  transition: color var(--t-tap) var(--ease), border-color var(--t-tap) var(--ease), background var(--t-tap) var(--ease);
}
.seg button:hover { color: var(--text); border-color: var(--accent); }
.seg button[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.seg button .m2 { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em; margin-left: 8px; opacity: .85; }
.check {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  color: var(--text-dim); font-size: .98rem;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.check .m2 { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-text); }
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; line-height: 1;
  color: var(--text); background: transparent; border: 0; cursor: pointer;
  padding: .5rem 1rem;
  transition: background var(--t-tap) var(--ease);
}
.stepper button:hover { background: rgba(79,107,255,.14); }
.stepper output {
  font-family: var(--font-mono); font-size: 1rem; min-width: 3.2em; text-align: center;
  border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  padding: .5rem .4rem;
}
.calc-out {
  margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: var(--font-mono); letter-spacing: .02em;
}
.calc-out .sum { font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--text-dim); overflow-wrap: anywhere; }
.calc-out .sum .total { color: var(--text); font-weight: 500; }
.calc-out .note { margin-top: .5rem; font-size: .8rem; color: var(--text-mute); }
.calc-out .note .zero { color: var(--ok); }

/* ---------- sheet tables ---------- */
.sheet-block { margin-top: clamp(36px, 5.5vw, 60px); }
.sheet-block .sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; margin-bottom: .9rem; }
.sheet-block h2 { font-size: clamp(1.35rem, 2.8vw, 1.8rem); }
.sheet-block .meta { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .04em; color: var(--text-mute); }
.sheet-note { color: var(--text-dim); font-size: .93rem; margin: .6rem 0 1rem; max-width: var(--maxw-text); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.sheet { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.sheet th {
  text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: .74rem;
  letter-spacing: .04em; color: var(--text-mute);
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-raise);
}
table.sheet td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
table.sheet tr:last-child td { border-bottom: 0; }
table.sheet td.k { font-weight: 600; letter-spacing: -0.01em; }
table.sheet td.n { font-family: var(--font-mono); font-size: .88rem; color: var(--text); white-space: nowrap; }
table.sheet td.s { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .03em; color: var(--accent-text); white-space: nowrap; }
table.sheet .flag {
  font-family: var(--font-mono); font-weight: 500; font-size: .66rem; letter-spacing: .04em;
  color: var(--ok); border: 1px solid rgba(63,207,142,.4); border-radius: 999px;
  padding: 2px 8px; margin-left: 10px; white-space: nowrap;
}

.footnote { color: var(--text-mute); font-size: .86rem; margin-top: 2.2rem; max-width: var(--maxw-text); }
.footnote strong { color: var(--text-dim); font-weight: 500; }

/* ---------- callout ---------- */
.callout {
  border: 1px solid var(--line); border-radius: var(--radius); text-align: center;
  background: radial-gradient(120% 180% at 0% 0%, rgba(79,107,255,.12), transparent 55%),
              linear-gradient(180deg, var(--card), var(--bg-raise));
  padding: clamp(30px, 5vw, 52px);
}
.callout h2 { max-width: 620px; margin: 0 auto; }
.callout .lead { margin: .9rem auto 0; }
.callout .btn { margin-top: 1.6rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 44px 0 52px; margin-top: clamp(40px, 6vw, 72px); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer .wordmark { font-size: 1.05rem; }
.foot-by { color: var(--text-mute); font-family: var(--font-mono); font-size: .76rem; letter-spacing: .03em; margin-top: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { text-decoration: none; color: var(--text-dim); font-size: .92rem; transition: color var(--t-ui) var(--ease); }
.footer-links a:hover { color: var(--text); }

/* ---------- reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d2 { transition-delay: 70ms; }
.reveal.d3 { transition-delay: 140ms; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line-soft); }
  .stat:first-child { border-top: 0; }
  .buys { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .year-grid { grid-template-columns: repeat(6, 1fr); }
  .month { aspect-ratio: 1 / 1.3; }
  .nav-links { gap: 14px; }
}

/* ---------- reduced motion (mandatory) ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .rise { animation: none; opacity: 1; transform: none; }
  .js .month { opacity: 1; transform: none; transition: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .btn, .buy, .nav, .seg button { transition: none; }
}
