/* Talewick: site styles */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0907;
  --bg-2: #130e0a;
  --cream: #f1e7d6;
  --dim: #a09382;
  --ash: #4b4037;
  --ember: #ff7a2e;
  --ember-deep: #ff5a1f;
  --gold: #ffc56b;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --wick-x: clamp(70px, 8.5vw, 150px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: clamp(1rem, .95rem + .3vw, 1.2rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* film grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .8  0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .07;
}
::selection { background: var(--ember); color: #1a0d05; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 380; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0; letter-spacing: -.025em; line-height: .98; }
h1 em, h2 em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; font-weight: 340; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--cream); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* the light: darkness + flame, drawn over everything */
#light { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
.no-gl #light { display: none; }

/* the wick */
#wick { position: absolute; top: 0; left: 0; width: 100%; z-index: 1; pointer-events: none; overflow: visible; }
#wick path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wick-fresh { stroke: var(--cream); stroke-width: 1.6; opacity: .78; }
.wick-burnt { stroke: #5a4d42; stroke-width: 1.2; stroke-dasharray: 1 5; opacity: .9; }
.wick-glow { stroke-width: 2.4; }
.knot { fill: var(--bg); stroke: var(--cream); stroke-width: 1.5; transition: fill .5s, stroke .5s, r .6s var(--ease); }
.knot.lit { fill: var(--ember); stroke: var(--gold); r: 7px; filter: drop-shadow(0 0 8px rgba(255, 122, 46, .9)); }
.no-gl #wick, .no-js #wick { display: none; }

/* nav + logo */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 2.6vw, 34px) var(--gutter);
}
.brand { display: block; color: var(--cream); text-decoration: none; transform-origin: 0 0; }
.logo { display: block; height: clamp(30px, 2.6vw, 40px); width: auto; overflow: visible; transform-origin: 0 0; }
.lg-l { transition: opacity .7s ease, fill 1.6s ease, filter 1.4s ease; }
.lg-flame-in { transform-box: fill-box; }
.lg-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: lg-flicker 2.6s infinite ease-in-out; transition: opacity .6s; }
.brand:hover .lg-flame { animation-duration: .9s; }
.brand:hover .lg-l { fill: #fff6e6; }
@keyframes lg-flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  18% { transform: scale(.94, 1.1) skewX(-5deg); }
  36% { transform: scale(1.04, .95) skewX(3deg); }
  55% { transform: scale(.96, 1.14) skewX(6deg); }
  72% { transform: scale(1.03, .98) skewX(-3deg); }
  88% { transform: scale(.97, 1.07) skewX(2deg); }
}
/* intro: logo sits big in the middle, dark, then lights from the i outward */
.js.intro .brand { transition: none; }
.js.intro .lg-l { opacity: 0; fill: var(--ember); filter: blur(10px); }
.js.intro .lg-flame { opacity: 0; animation: none; }
.js.intro-lit .lg-l { opacity: 1; fill: var(--cream); filter: none; transition-delay: calc(var(--d) * 110ms), calc(var(--d) * 110ms + 250ms), calc(var(--d) * 110ms); }
.js.intro-move .brand, .js.intro-move .logo { transition: transform 1.25s cubic-bezier(.7, 0, .2, 1); }
.js.intro .nav-mail, .js.intro .hero > *:not(.hero-flame) { opacity: 0; }
.nav-mail, .hero-sub, .cue { transition: opacity 1.2s ease .5s; }

.nav-mail {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--dim);
  padding: 8px 0; position: relative;
}
.nav-mail::after, .fuse::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--ember-deep), var(--gold));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease);
}
.nav-mail:hover { color: var(--cream); }
.nav-mail:hover::after, .fuse:hover::after { transform: scaleX(1); }

/* shared bits */
.eyebrow {
  font-family: var(--sans); font-size: .76rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); display: flex; align-items: center; gap: 12px; margin-bottom: clamp(18px, 2.4vw, 30px);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.lede { color: #d9cdba; max-width: 34em; }
.lede + .lede { margin-top: 1em; }

/* letters that catch fire */
.js [data-split] .w { display: inline-block; white-space: nowrap; }
.js [data-split] .ch {
  /* the padding (cancelled by the margin) keeps overhanging strokes inside the letter's own layer, so nothing is clipped while it animates */
  display: inline-block; padding: .36em; margin: -.36em; opacity: 0; color: var(--ember); filter: blur(7px);
  transform: translateY(.22em) scale(1.06); text-shadow: 0 0 .45em rgba(255, 122, 46, .95);
  transition: opacity .55s ease, color 1.5s ease, filter .8s ease, transform 1s var(--ease), text-shadow 1.8s ease;
  transition-delay: calc(var(--i) * 26ms);
}
.js [data-split].lit .ch { opacity: 1; color: inherit; filter: none; transform: none; text-shadow: 0 0 0 rgba(255, 122, 46, 0); }
.js [data-fade] { opacity: 0; transform: translateY(18px); transition: opacity 1.1s ease, transform 1.2s var(--ease); transition-delay: var(--delay, .15s); }
.js [data-fade].lit { opacity: 1; transform: none; }

/* hero */
.hero {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(96px, 15vh, 150px) var(--gutter) 0;
}
.hero h1 { font-size: clamp(2.9rem, min(10.4vw, 17vh), 10.5rem); max-width: 11em; }
.hero h1 em { display: block; }
.hero-flame { position: absolute; left: 50%; top: 79%; width: 0; height: 0; }
.hero-sub { position: absolute; left: var(--gutter); bottom: clamp(24px, 5vh, 52px); max-width: 21em; text-align: left; color: #cfc3b0; font-size: .98rem; }
.cue {
  position: absolute; right: var(--gutter); bottom: clamp(24px, 5vh, 52px);
  font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); text-decoration: none;
  display: flex; align-items: center; gap: 12px;
}
.cue i { display: block; width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent); animation: drip 2.2s infinite var(--ease); transform-origin: 50% 0; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.fallback-flame { display: none; }
.no-gl .fallback-flame { display: block; position: absolute; left: -45px; bottom: 0; width: 90px; animation: lg-flicker 2.4s infinite ease-in-out; transform-origin: 50% 100%; filter: drop-shadow(0 0 40px rgba(255, 122, 46, .7)); }

/* sections that sit beside the wick */
.sec { position: relative; z-index: 2; padding: clamp(110px, 22vh, 240px) var(--gutter); }
.sec .col { max-width: 44rem; }
.sec[data-wick="left"] .col { margin-left: calc(var(--wick-x) + clamp(20px, 4vw, 70px)); }
.sec[data-wick="right"] .col { margin-left: auto; margin-right: calc(var(--wick-x) + clamp(20px, 4vw, 70px)); }
.sec h2 { font-size: clamp(2.4rem, 6vw, 5.6rem); margin-bottom: clamp(22px, 3vw, 40px); }
.sec h2 em, .finale h2 em { display: block; }

/* questions */
.questions { padding-left: 0; padding-right: 0; overflow: hidden; }
.questions .col { max-width: none; margin: 0 !important; }
.q-intro { padding: 0 var(--gutter); margin-right: calc(var(--wick-x) + clamp(20px, 4vw, 70px)); display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.q-list { list-style: none; margin: clamp(30px, 5vw, 70px) 0 0; padding: 0 0 0 clamp(60px, 9vw, 150px); }
.q-list li {
  font-family: var(--serif); font-style: italic; font-weight: 300; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(2.6rem, 9.5vw, 9.5rem); line-height: 1.04; letter-spacing: -.03em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(241, 231, 214, .3);
  transform: translate3d(var(--x, 0px), 0, 0); will-change: transform;
  transition: color 1.6s ease, -webkit-text-stroke-color 1.6s ease, text-shadow 2s ease;
}
.q-list li.lit { color: var(--cream); -webkit-text-stroke-color: transparent; animation: catch 1.8s ease both; }
@keyframes catch {
  0% { color: transparent; text-shadow: 0 0 0 transparent; }
  25% { color: var(--gold); text-shadow: 0 0 .35em rgba(255, 122, 46, .9), 0 0 1.2em rgba(255, 90, 31, .5); }
  100% { color: var(--cream); text-shadow: 0 0 0 transparent; }
}

/* how a tale is made */
.steps { list-style: none; margin: clamp(34px, 5vw, 64px) 0 0; padding: 0; display: grid; gap: clamp(40px, 7vw, 84px); counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: clamp(18px, 3vw, 40px); align-items: start; }
.step-n { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 1.6vw, 1.5rem); color: var(--gold); padding-top: .5em; min-width: 2ch; font-variant-numeric: tabular-nums; }
.step h3 { font-size: clamp(1.9rem, 3.8vw, 3.4rem); margin-bottom: .35em; }
.step p { color: #d2c6b3; max-width: 30em; }

/* slow burn */
.burn h2 { font-size: clamp(3rem, 9vw, 9rem); }
.burn-word {
  font-style: italic; font-weight: 340; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  background: linear-gradient(100deg, var(--cream) 0%, var(--cream) 38%, var(--gold) 46%, var(--ember) 50%, #7a2a0c 53%, #3b332c 58%, #3b332c 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding: 0 .08em .12em 0; display: inline-block;
}

/* finale */
.finale { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 var(--gutter) clamp(50px, 8vh, 90px); }
.finale-flame { height: clamp(210px, 31vh, 320px); width: 0; position: relative; flex: none; }
.finale-flame span { position: absolute; left: 0; bottom: 0; }
.finale .eyebrow { justify-content: center; margin-top: clamp(22px, 3.4vh, 40px); }
.finale .eyebrow::after { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.finale h2 { font-size: clamp(2.4rem, 5.6vw, 5.2rem); max-width: 12em; }
.finale .lede { margin: clamp(20px, 3vh, 34px) auto 0; }
.mail {
  position: relative; display: inline-block; margin-top: clamp(20px, 3.4vh, 40px);
  font-family: var(--serif); font-style: italic; font-weight: 340; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(1.7rem, 4.6vw, 4rem); letter-spacing: -.02em; line-height: 1.2; text-decoration: none; color: var(--gold);
  padding-bottom: .12em; transition: color .4s, text-shadow .6s;
}
.mail::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(241, 231, 214, .28); }
.mail::after { height: 2px; box-shadow: 0 0 12px rgba(255, 122, 46, .9); transition-duration: .9s; }
.mail:hover { color: #fff3dc; text-shadow: 0 0 .6em rgba(255, 122, 46, .55); }
.copy-note { display: block; height: 1.4em; margin-top: 8px; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); opacity: 0; transition: opacity .4s; }
.copy-note.on { opacity: 1; }

.blow {
  position: relative; z-index: 60; margin-top: clamp(12px, 2.4vh, 28px);
  appearance: none; border: 1px solid rgba(241, 231, 214, .32); background: rgba(11, 9, 7, .5); color: var(--cream);
  font: 500 .76rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  padding: 16px 26px; border-radius: 999px; cursor: pointer;
  transition: border-color .4s, background .4s, color .4s, box-shadow .6s, transform .4s var(--ease);
}
.blow:hover { border-color: var(--gold); box-shadow: 0 0 34px rgba(255, 122, 46, .28); transform: translateY(-2px); }
.is-out .blow { border-color: var(--ember); color: var(--gold); box-shadow: 0 0 40px rgba(255, 122, 46, .35); background: #0b0907; }
.goodnight { position: relative; z-index: 60; margin-top: 16px; text-align: center; pointer-events: none; font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.9rem); color: #b9ab97; opacity: 0; transition: opacity 1.6s ease; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.is-out .goodnight { opacity: 1; transition-delay: .9s; }

.foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: center; padding: 26px var(--gutter) 34px; border-top: 1px solid rgba(241, 231, 214, .1); font-size: .82rem; color: var(--dim); }
.foot a { text-decoration: none; position: relative; padding-bottom: 3px; }
.foot a:hover { color: var(--cream); }
.foot nav { display: flex; gap: 24px; }

/* plain pages (privacy, 404) */
.plain { position: relative; z-index: 2; max-width: 46rem; margin: 0 auto; padding: clamp(120px, 20vh, 200px) var(--gutter) 90px; }
.plain h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: .5em; }
.plain h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 2em 0 .5em; letter-spacing: -.01em; line-height: 1.15; }
.plain p, .plain li { color: #d6cab7; }
.plain p + p { margin-top: 1em; }
.plain a { color: var(--gold); }
.plain .eyebrow { margin-bottom: 20px; }
.lost { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.lost .logo { height: 34px; }

/* small screens: the wick runs down the left edge */
@media (max-width: 819px) {
  :root { --wick-x: 26px; }
  .sec { padding-top: clamp(90px, 16vh, 150px); padding-bottom: clamp(90px, 16vh, 150px); }
  .sec[data-wick] .col { margin-left: 38px; margin-right: 0; }
  .q-intro { margin: 0 0 0 38px; align-items: flex-start; text-align: left; }
  .q-list { padding-left: 58px; }
  .q-list li { font-size: clamp(1.9rem, 8.4vw, 3.4rem); line-height: 1.16; }
  .hero { padding-top: 112px; }
  .hero-flame { top: 81%; }
  .hero-sub { position: static; text-align: center; margin: 22px auto 0; max-width: 22em; font-size: .95rem; }
  .cue { display: none; }
  .nav-mail { font-size: .7rem; letter-spacing: .1em; }
  .step { grid-template-columns: 1fr; }
  .step-n { padding: 0 0 4px; }
  .foot { justify-content: center; text-align: center; }
}
@media (max-height: 620px) and (min-width: 820px) {
  .hero h1 { font-size: clamp(2.6rem, 11vh, 5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
.plain .brand { color: var(--cream); }
