/* 40Forty: snap-panel rebuild. Dark ember, 390px first.
   Full-screen Y scroll-snap panels, 100svh, transform/opacity motion only. */

:root {
  --bg: #131009;
  --bg2: #1b160e;
  --ink: #f1e9d7;
  --muted: #a2967d;
  --faint: #6f6552;
  --ember: #e09a3c;
  --ember-hot: #f2b45a;
  --rust: #b4502a;
  --hair: #2b2417;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--ember); color: #131009; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ember); color: #131009;
  padding: .6rem 1rem; z-index: 100; font-weight: 700;
}
.skip:focus { left: 0; }
.vis {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

a { color: var(--ember); }
a:hover { color: var(--ink); }

/* ---------- header ---------- */
.site {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(19, 16, 9, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto;
  padding: .7rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.mark {
  font-family: var(--mono); font-weight: 700; font-size: .95rem;
  color: #131009; background: var(--ember);
  width: 1.9rem; height: 1.9rem; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.word { font-family: var(--serif); font-style: italic; font-size: 1.25rem; letter-spacing: .01em; }
.site nav { display: flex; gap: 1.1rem; align-items: center; }
.site nav a {
  color: var(--muted); text-decoration: none; font-size: .82rem;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em;
}
.site nav a:hover { color: var(--ink); }
.site nav a.ext {
  border: 1px solid var(--hair); border-radius: 999px; padding: .32rem .8rem;
  color: var(--ink);
}
@media (max-width: 560px) {
  .site nav a:not(.ext) { display: none; }
}

/* ---------- panels ---------- */
.panel {
  position: relative;
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg);
}

/* background layer + parallax drift */
.bg { position: absolute; inset: -12% 0; z-index: 0; pointer-events: none; }
.bg.flat { inset: 0; background: radial-gradient(120% 90% at 50% 0%, var(--bg2) 0%, var(--bg) 60%); }
.bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transform: scale(1.12);
  will-change: transform;
}
@supports (animation-timeline: view()) {
  .bg img {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
}
@keyframes drift {
  from { transform: translateY(-6%) scale(1.12); }
  to   { transform: translateY(6%) scale(1.12); }
}
.scrim { position: absolute; inset: 0; }
.scrim {
  background:
    linear-gradient(180deg, rgba(19,16,9,.55) 0%, rgba(19,16,9,.15) 40%, rgba(19,16,9,.72) 100%);
}
.scrim.right {
  background:
    linear-gradient(90deg, rgba(19,16,9,.35) 0%, rgba(19,16,9,.82) 70%),
    linear-gradient(180deg, rgba(19,16,9,.4) 0%, rgba(19,16,9,.7) 100%);
}
.scrim.left {
  background:
    linear-gradient(-90deg, rgba(19,16,9,.35) 0%, rgba(19,16,9,.82) 70%),
    linear-gradient(180deg, rgba(19,16,9,.4) 0%, rgba(19,16,9,.7) 100%);
}

/* content positions — nothing forced to vertical center */
.pos {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px;
  margin: 0 auto; padding: 4.5rem 1.25rem 2rem;
  pointer-events: none;
}
.pos > * { pointer-events: auto; }
.pos.top-right   { align-self: flex-start; text-align: right;  padding-top: 5.5rem; }
.pos.mid-left    { align-self: flex-start; }
.pos.bottom-left { align-self: flex-end;   padding-bottom: 3.5rem; }
.pos.bottom-right{ align-self: flex-end;   text-align: right; padding-bottom: 3.5rem; }
.pos.top-left    { align-self: flex-start; padding-top: 5.5rem; }
.pos.mid         { text-align: center; }

/* giant display words */
.word-xl, .word-lg {
  font-family: var(--mono); font-weight: 800;
  letter-spacing: -.04em; line-height: .9;
  margin: 0 0 1rem;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.word-xl { font-size: clamp(3.6rem, 20vw, 13rem); }
.word-lg { font-size: clamp(2.6rem, 13vw, 7rem); }
.ember { color: var(--ember); }
.pos.top-right .word-xl, .pos.bottom-right .word-xl { margin-right: -.06em; }

.copy .short {
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  margin: .35rem 0; max-width: 34ch;
}
.pos.top-right .copy .short, .pos.bottom-right .copy .short { margin-left: auto; }
.pos.mid .copy .short { margin-left: auto; margin-right: auto; }
.dim { color: var(--muted); }

/* clip reveals — observe the PANEL, reveal the children */
[data-reveal] {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transform: translateY(26px);
  transition:
    clip-path .8s var(--ease) var(--rd, 0s),
    transform .8s var(--ease) var(--rd, 0s),
    opacity .6s ease var(--rd, 0s);
  will-change: clip-path, transform;
}
.in [data-reveal] {
  clip-path: inset(0 0 -10% 0);
  opacity: 1;
  transform: translateY(0);
}
.word-xl [data-reveal], .word-lg [data-reveal] { --rd: .05s; }
.copy [data-reveal], .demo [data-reveal], .notify [data-reveal] { --rd: .3s; }
.hero-foot [data-reveal] { --rd: .5s; }

/* ---------- hero specifics ---------- */
.hero-count {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; width: 100%;
  padding: 5rem 1.25rem 0;
}
.count-label {
  font-family: var(--mono); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .22em;
  color: var(--muted); margin: 0 0 .6rem;
}
.count { display: flex; align-items: baseline; gap: .35rem; }
.unit { display: flex; flex-direction: column; }
.num {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  color: var(--ember-hot); line-height: 1;
  text-shadow: 0 0 24px rgba(224,154,60,.35);
  font-variant-numeric: tabular-nums;
}
.key {
  font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .2em;
  color: var(--faint); margin-top: .35rem;
}
.colon {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 3rem);
  color: var(--rust); transform: translateY(-1.1rem);
}
.count-note { color: var(--muted); font-size: .92rem; max-width: 34ch; }
.hero-word {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; width: 100%;
  padding: 0 1.25rem;
}
.hero-word span {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(6rem, 34vw, 22rem);
  line-height: .85; letter-spacing: -.05em;
  color: var(--ink);
  text-shadow: 0 4px 60px rgba(0,0,0,.7);
}
.hero-foot {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; width: 100%;
  padding: 0 1.25rem 2.5rem;
  margin-top: -1rem;
}
.hero-foot .line {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  margin: 0;
}
.hero-foot .sub { color: var(--muted); margin: .3rem 0 0; }
.scroll-cue {
  position: absolute; bottom: 1.1rem; left: 50%;
  transform: translateX(-50%); z-index: 2; margin: 0;
}
.scroll-cue a {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--faint); text-decoration: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--mono); font-weight: 700; font-size: .95rem;
  color: #131009; background: var(--ember);
  border: none; border-radius: 999px;
  padding: .8rem 1.6rem; cursor: pointer; text-decoration: none;
  transition: transform .25s var(--ease), background .25s ease;
  min-height: 44px;
}
.btn:hover { background: var(--ember-hot); color: #131009; transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }

/* ---------- burn demo ---------- */
.demo { max-width: 560px; }
.burn-form { display: flex; gap: .6rem; margin-top: 1rem; }
.burn-form input {
  flex: 1; min-height: 44px;
  background: rgba(19,16,9,.7); border: 1px solid var(--hair);
  border-radius: 10px; color: var(--ink);
  padding: .7rem .9rem; font-size: 1rem; font-family: var(--sans);
}
.burn-form input:focus {
  outline: 2px solid var(--ember);
  border-color: var(--ember);
}
.burn-form input::placeholder { color: var(--faint); }
@media (max-width: 520px) {
  .burn-form { flex-direction: column; }
}
.feed { margin-top: 1.2rem; display: grid; gap: .7rem; }
.note {
  position: relative; overflow: hidden;
  background: rgba(27,22,14,.85); border: 1px solid var(--hair);
  border-radius: 10px; padding: .85rem 1rem .9rem;
}
.note p { margin: 0 0 .55rem; font-size: 1.02rem; }
.ttl {
  height: 4px; border-radius: 2px; background: var(--hair); overflow: hidden;
}
.ttl span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--ember), var(--rust));
  transform-origin: left center;
  transition: transform 1s linear;
}
.note.dying {
  animation: crumble 1.1s var(--ease) forwards;
}
.note.dying .ttl span { transition: none; }
@keyframes crumble {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  40%  { opacity: .85; transform: translateY(6px) scale(.995); }
  100% { opacity: 0; transform: translateY(22px) scale(.96); }
}
.gone-note {
  font-family: var(--mono); font-size: .85rem; color: var(--faint);
  text-transform: uppercase; letter-spacing: .18em;
}

/* ---------- notify ---------- */
.notify { max-width: 520px; margin: 1.2rem auto 0; }
.fields { display: flex; gap: .6rem; align-items: stretch; }
.field { flex: 1; text-align: left; }
.field label {
  display: block; font-family: var(--mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); margin-bottom: .4rem;
}
.field input {
  width: 100%; min-height: 44px;
  background: rgba(19,16,9,.7); border: 1px solid var(--hair);
  border-radius: 10px; color: var(--ink);
  padding: .7rem .9rem; font-size: 1rem;
}
.field input:focus {
  outline: 2px solid var(--ember);
  border-color: var(--ember);
}
.field input::placeholder { color: var(--faint); }
@media (max-width: 520px) {
  .fields { flex-direction: column; }
}
.field-error { color: var(--ember-hot); min-height: 1.4em; font-size: .9rem; margin: .4rem 0 0; }
.form-ok { color: var(--ember-hot); font-family: var(--mono); font-size: .95rem; }
.fine { color: var(--faint); font-size: .85rem; }

/* ---------- footer ---------- */
.foot-panel {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
}
.badge { display: inline-block; }
.badge img { display: block; width: 180px; height: auto; }
.foot-panel nav {
  display: flex; gap: 1.1rem; justify-content: center;
  margin: 1rem 0 .6rem; flex-wrap: wrap;
}
.foot-panel nav a {
  color: var(--muted); text-decoration: none;
  font-family: var(--mono); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .1em;
}
.foot-panel nav a:hover { color: var(--ink); }

/* ---------- prose pages (privacy / terms / thanks / 404 / derp) ---------- */
.prose { max-width: 42rem; padding: 6rem 1.25rem 4rem; margin: 0 auto; }
.prose h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 3.6rem); margin: 0 0 1rem; line-height: 1.1;
}
.prose h2 { font-family: var(--mono); font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ember); margin: 2.4rem 0 .8rem; }
.prose p { color: var(--muted); margin: 0 0 1rem; }
.prose .updated { font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.stage { text-align: center; padding: 8rem 1.25rem 4rem; max-width: 40rem; margin: 0 auto; }
.stage h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 11vw, 4.5rem); margin: 0 0 1rem; }
.stage .lede { margin-left: auto; margin-right: auto; }
.lede { font-size: clamp(1.05rem, 4vw, 1.3rem); color: var(--ink); max-width: 34rem; margin: 0 0 1rem; }
.lede.dim { color: var(--muted); font-family: var(--serif); font-style: italic; }
.eyebrow {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ember); margin: 0 0 1.4rem;
}
.dog { font-family: var(--mono); color: var(--ember); line-height: 1.3; margin: 2rem 0; white-space: pre; font-size: .9rem; }
.back { display: inline-block; margin-top: 1rem; font-family: var(--mono); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.foot { border-top: 1px solid var(--hair); padding: 2.5rem 1.25rem 4rem; }
.foot .wrap { max-width: 1040px; margin: 0 auto; }
.madeby { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; font-size: .92rem; color: var(--muted); }
.foot nav { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: .86rem; font-family: var(--mono); }
.foot nav a:hover { color: var(--ink); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg img { animation: none; transform: scale(1.02); }
  [data-reveal] { clip-path: none; opacity: 1; transform: none; transition: none; }
  .note.dying { animation: none; opacity: 0; }
}
