/* A Phoenix Wild — site styles */
:root {
  --night: #05070f;
  --deep: #0a0e22;
  --ink: #e9e4d8;
  --muted: #a8a59c;
  --faint: #6f6d68;
  --amber: #ffb547;
  --amber-hot: #ffd27a;
  --ember: #ff7a2a;
  --line: rgba(255, 181, 71, 0.22);
  --card: rgba(255, 255, 255, 0.035);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hot); }
::selection { background: rgba(255, 181, 71, 0.35); }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--amber); color: var(--night); padding: 8px 14px; border-radius: 6px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.scrolled { background: rgba(5, 7, 15, 0.72); backdrop-filter: blur(14px); padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: 0.28em; color: var(--ink); white-space: nowrap; }
.wordmark span { color: var(--amber); }
.nav ul { list-style: none; display: flex; gap: clamp(14px, 2.4vw, 34px); margin: 0; padding: 0; }
.nav ul a { color: var(--muted); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav ul a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav ul { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy {
  position: absolute; left: 0; right: 0; top: 15vh;
  text-align: center; padding: 0 20px; pointer-events: none;
}
.hero-copy .eyebrow { opacity: 0; animation: rise 1.6s 0.4s forwards; }
.title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(60px, 11.5vw, 168px); line-height: 0.9; letter-spacing: 0.04em;
  margin: 16px 0 6px;
  background: linear-gradient(180deg, #fff7e6 0%, #f2d9a8 55%, #c98a3e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255, 170, 70, 0.18));
  opacity: 0; animation: rise 2s 0.7s forwards;
}
.byline { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.4vw, 28px); color: var(--ink); opacity: 0; animation: rise 1.6s 1.3s forwards; }
.tagline { margin: 20px auto 0; max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); opacity: 0; animation: rise 1.6s 1.8s forwards; }
.hero-cta { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; pointer-events: auto; opacity: 0; animation: rise 1.6s 2.2s forwards; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid rgba(255, 181, 71, 0.5); color: var(--ink);
  background: rgba(10, 14, 34, 0.35); backdrop-filter: blur(6px);
  transition: all 0.3s;
}
.btn:hover { border-color: var(--amber); color: var(--night); background: var(--amber); }
.btn.solid { background: var(--amber); color: var(--night); border-color: var(--amber); }
.btn.solid:hover { background: var(--amber-hot); }

.hold {
  position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%);
  text-align: center; font-family: var(--serif); font-style: italic;
  color: rgba(233, 228, 216, 0.55); font-size: 18px; letter-spacing: 0.04em;
  transition: opacity 1.2s, color 1.2s; pointer-events: none; width: 90%;
}
.hold small { display: block; font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }
.hold.revealed { color: var(--amber-hot); }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; width: 1px; height: 38px; background: linear-gradient(var(--amber), transparent); animation: cue 2.4s infinite; }

@media (max-height: 720px) {
  .hero-copy { top: 11vh; }
  .title { font-size: clamp(54px, 10vw, 120px); margin: 10px 0 4px; }
  .tagline { margin-top: 12px; }
  .hero-cta { margin-top: 18px; }
  .hold { bottom: 4vh; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cue { 0% { opacity: 0; transform: scaleY(0); transform-origin: top; } 40% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
section { position: relative; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.pad { padding: clamp(90px, 13vw, 170px) 0; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; margin: 14px 0 26px; letter-spacing: 0.01em; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 0 0 8px; }
.lede { font-size: clamp(18px, 1.7vw, 21px); color: var(--ink); }
p { margin: 0 0 1.1em; }
.muted { color: var(--muted); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Book ---------- */
.book { background: radial-gradient(1200px 600px at 80% 0%, rgba(255,140,60,0.08), transparent 60%), var(--night); }
.book-grid { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
@media (max-width: 900px) { .book-grid { grid-template-columns: 1fr; } }

.cover-stage { perspective: 1400px; display: flex; justify-content: center; }
.cover {
  position: relative; width: min(100%, 360px); aspect-ratio: 2 / 3;
  border-radius: 4px 10px 10px 4px; overflow: hidden;
  transform: rotateY(-18deg) rotateX(4deg); transform-style: preserve-3d;
  box-shadow: -26px 34px 70px rgba(0,0,0,0.7), 0 0 80px rgba(255, 160, 60, 0.10);
  transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.cover:hover { transform: rotateY(-4deg) rotateX(1deg) scale(1.02); }
.cover canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: linear-gradient(90deg, rgba(0,0,0,0.6), rgba(255,255,255,0.08), transparent); z-index: 3; }
.cover-text { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 11% 8%; }
.cover-text .series { font-family: var(--mono); font-size: 10px; letter-spacing: 0.42em; color: rgba(255, 220, 160, 0.85); }
.cover-text .ct { font-family: var(--serif); font-size: clamp(54px, 8vw, 76px); line-height: 1; margin-top: 10px; color: #fff3dc; letter-spacing: 0.06em; text-shadow: 0 0 24px rgba(255,170,70,0.35); }
.cover-text .bk { font-family: var(--serif); font-style: italic; color: rgba(255, 232, 196, 0.8); margin-top: 6px; font-size: 18px; }
.cover-text .au { margin-top: auto; font-family: var(--serif); letter-spacing: 0.3em; font-size: 16px; color: #fff3dc; }

.blurb p { font-family: var(--serif); font-size: clamp(20px, 1.9vw, 24px); line-height: 1.5; color: #ece6d8; }
.blurb .kicker { font-style: italic; color: var(--amber-hot); }
.status { display: inline-flex; gap: 12px; align-items: center; margin-top: 18px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; box-shadow: 0 0 2px var(--amber); } }

.exchange { margin: clamp(80px, 10vw, 130px) auto 0; max-width: 820px; text-align: center; }
.exchange q { display: block; font-family: var(--serif); font-size: clamp(28px, 3.6vw, 46px); line-height: 1.2; quotes: "\201C" "\201D"; }
.exchange q + q { margin-top: 10px; }
.exchange q:nth-child(2) { color: var(--muted); }
.exchange q:nth-child(3) { color: var(--amber-hot); font-style: italic; }

/* ---------- Seam divider ---------- */
.seam { width: 100%; height: 120px; }
.seam path { fill: none; stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 2400; stroke-dashoffset: 2400; filter: drop-shadow(0 0 6px rgba(255,181,71,0.8)); transition: stroke-dashoffset 3.2s ease; }
.seam.in path { stroke-dashoffset: 0; }
.seam circle { fill: var(--amber-hot); opacity: 0; transition: opacity 0.6s; filter: drop-shadow(0 0 6px var(--amber)); }
.seam.in circle { opacity: 1; }

/* ---------- Lakehaven ---------- */
.world { background: linear-gradient(180deg, var(--night), #070b1c 30%, #090d22 70%, var(--night)); }
.world-intro { max-width: 760px; }
.panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 60px; }
@media (max-width: 800px) { .panels { grid-template-columns: 1fr; } }
.panel {
  position: relative; padding: 38px 34px 34px; border-radius: 14px; overflow: hidden;
  background: var(--card); border: 1px solid rgba(255,255,255,0.06);
  min-height: 300px; isolation: isolate;
}
.panel::after { content: ""; position: absolute; inset: auto -30% -60% -30%; height: 80%; background: radial-gradient(closest-side, rgba(255,170,70,0.13), transparent); z-index: -1; opacity: 0; transition: opacity 0.8s; }
.panel:hover::after { opacity: 1; }
.panel .num { font-family: var(--mono); color: var(--faint); font-size: 12px; letter-spacing: 0.3em; }
.panel h3 { margin-top: 18px; font-size: 34px; }
.panel p { color: var(--muted); }
.panel .art { height: 120px; margin: -6px -10px 18px; }

/* the fold */
.fold { position: relative; height: 210px; margin: -10px -6px 22px; perspective: 900px; border-radius: 10px; overflow: hidden; }
.fold .far { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 100%, #ffcf7a 0%, #e08a3a 22%, #5a2f3d 50%, #121633 85%); }
.fold .far::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(transparent, rgba(5,7,15,0.9)); }
.fold .far span { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; color: rgba(255,240,210,0.85); z-index: 2; }
.fold .leaf { position: absolute; top: 0; bottom: 0; width: 50%; background:
    repeating-linear-gradient(90deg, rgba(255,181,71,0.05) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #11152c, #0a0d1f);
  transition: transform 1.6s cubic-bezier(.6,.05,.2,1); backface-visibility: hidden; }
.fold .leaf.l { left: 0; transform-origin: left center; border-right: 1px solid rgba(255,210,122,0.0); }
.fold .leaf.r { right: 0; transform-origin: right center; }
.fold .crease { position: absolute; left: 50%; top: 8%; bottom: 8%; width: 2px; margin-left: -1px; background: linear-gradient(transparent, #fff1c9, transparent); box-shadow: 0 0 18px 4px rgba(255, 200, 110, 0.7); transform: scaleY(0); transition: transform 0.9s ease; z-index: 3; }
.fold.open .crease { transform: scaleY(1); }
.fold.open.wide .leaf.l { transform: rotateY(-82deg); }
.fold.open.wide .leaf.r { transform: rotateY(82deg); }
.fold.open.wide .crease { opacity: 0; transition: transform 0.9s, opacity 1s 0.4s; }

/* watchers panel */
.exposure { position: relative; height: 210px; margin: -10px -6px 22px; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #0b0f24, #141936 70%, #1d1a2c); cursor: crosshair; }
.exposure .ob { position: absolute; bottom: 18%; width: 16px; height: 110px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, rgba(220,230,255,0.55), rgba(220,230,255,0.12) 60%, transparent); filter: blur(5px); opacity: 0; transition: opacity 2.2s ease; }
.exposure .ob::before { content: ""; position: absolute; top: -12px; left: 1px; width: 14px; height: 18px; border-radius: 50%; background: rgba(230,236,255,0.5); filter: blur(2px); }
.exposure.developed .ob { opacity: 1; }
.exposure .meter { position: absolute; left: 14px; bottom: 12px; right: 14px; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--faint); }
.exposure .bar { flex: 1; height: 2px; background: rgba(255,255,255,0.08); position: relative; overflow: hidden; }
.exposure .bar b { position: absolute; inset: 0 100% 0 0; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* ---------- Characters ---------- */
.cast { background: var(--night); }
.cast-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 54px; }
@media (max-width: 1000px) { .cast-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cast-grid { grid-template-columns: 1fr; } }
.person {
  position: relative; padding: 30px 28px 26px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
  transition: transform 0.5s, border-color 0.5s;
}
.person:hover { transform: translateY(-4px); border-color: rgba(255,181,71,0.35); }
.person .age { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; color: var(--faint); text-transform: uppercase; }
.person h3 { margin-top: 10px; }
.person p { color: var(--muted); font-size: 15.5px; }
.person blockquote { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.07); font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--amber-hot); }
.person .glyph { position: absolute; right: 18px; top: 18px; width: 42px; height: 42px; opacity: 0.55; }

/* Bug feature */
.bug-feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 6vw, 90px); align-items: center; margin-top: clamp(70px, 9vw, 120px); padding: clamp(30px, 5vw, 60px); border-radius: 22px; background: radial-gradient(600px 380px at 25% 50%, rgba(255,140,50,0.10), transparent 70%), rgba(255,255,255,0.02); border: 1px solid rgba(255,181,71,0.14); }
@media (max-width: 860px) { .bug-feature { grid-template-columns: 1fr; text-align: center; } }
.bug-stage { position: relative; display: flex; justify-content: center; }
#bug { width: min(100%, 300px); cursor: pointer; filter: drop-shadow(0 30px 40px rgba(0,0,0,0.6)); transition: transform 0.25s; }
#bug:active { transform: scale(0.97); }
#bug .lid { transform-origin: 100px 104px; animation: blink 6s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(0); } 97% { transform: scaleY(1); } }
.speech {
  position: absolute; top: -8px; left: 50%; transform: translate(-50%, -100%);
  min-width: 220px; max-width: 320px; padding: 14px 18px; border-radius: 14px;
  background: #f5ead2; color: #1a1408; font-family: var(--serif); font-size: 19px; line-height: 1.3; text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.35s, transform 0.35s; pointer-events: none;
}
.speech::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #f5ead2; }
.speech.show { opacity: 1; transform: translate(-50%, calc(-100% - 6px)); }
.bug-copy .hint { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; color: var(--faint); text-transform: uppercase; margin-top: 18px; }

/* ---------- Read ---------- */
.read { background: linear-gradient(180deg, var(--night), #0b0a10 18%, #0e0c12); }
.excerpt { max-width: 700px; margin: 0 auto; }
.excerpt .head { text-align: center; margin-bottom: 50px; }
.excerpt .head h2 { margin-bottom: 8px; }
.excerpt .head p { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 20px; }
.prose { font-family: var(--serif); font-size: clamp(20px, 1.7vw, 22.5px); line-height: 1.62; color: #e6dfcf; }
.prose p { margin: 0 0 1.05em; }
.prose p:first-of-type::first-letter { float: left; font-size: 4.6em; line-height: 0.82; padding: 0.06em 0.12em 0 0; color: var(--amber); font-weight: 500; }
.prose em { color: #f3e7c9; }
.prose .voices p { font-style: italic; color: var(--muted); padding-left: 1.2em; border-left: 1px solid var(--line); margin-bottom: 0.5em; }
.prose .last { text-align: center; font-size: 1.25em; color: var(--amber-hot); margin: 1.6em 0; }
.fade-out { position: relative; max-height: 1100px; overflow: hidden; transition: max-height 1.4s ease; }
.fade-out::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 260px; background: linear-gradient(transparent, #0e0c12); transition: opacity 0.8s; }
.fade-out.open { max-height: 9000px; }
.fade-out.open::after { opacity: 0; pointer-events: none; }
.read-more { display: flex; justify-content: center; margin-top: 30px; }

/* ---------- Author ---------- */
.author { background: #0e0c12; }
.author-card { display: grid; grid-template-columns: auto 1fr; gap: clamp(26px, 5vw, 60px); align-items: center; max-width: 920px; margin: 0 auto; }
@media (max-width: 700px) { .author-card { grid-template-columns: 1fr; text-align: center; } }
.monogram { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; border: 1px solid rgba(255,181,71,0.35); font-family: var(--serif); font-size: 64px; letter-spacing: 0.04em; color: var(--amber-hot); background: radial-gradient(circle at 50% 120%, rgba(255,150,60,0.25), transparent 60%); box-shadow: inset 0 0 40px rgba(0,0,0,0.6), 0 0 60px rgba(255,160,60,0.08); }
.author-card h2 { margin: 6px 0 14px; }

/* ---------- Newsletter ---------- */
.lantern { background: radial-gradient(900px 420px at 50% 100%, rgba(255,150,60,0.16), transparent 70%), #0e0c12; text-align: center; }
.lantern h2 { margin-top: 10px; }
.signup { margin: 34px auto 0; display: flex; gap: 10px; max-width: 520px; flex-wrap: wrap; justify-content: center; }
.signup input { flex: 1 1 260px; padding: 14px 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.signup input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,181,71,0.18); }
.signup button { cursor: pointer; font: inherit; }
.signup-note { margin-top: 16px; min-height: 1.6em; font-family: var(--serif); font-style: italic; color: var(--muted); }

/* ---------- Footer ---------- */
footer { padding: 70px 0 50px; border-top: 1px solid rgba(255,255,255,0.05); background: var(--night); }
.foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.foot .wordmark { font-size: 17px; }
.foot small { color: var(--faint); font-size: 13px; }
.rating { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.rating b { color: var(--amber); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-copy .eyebrow, .title, .byline, .tagline, .hero-cta { opacity: 1; }
  .seam path { stroke-dashoffset: 0; }
}

#bug:focus { outline: none; }
#bug:focus-visible { outline: 2px solid var(--amber); outline-offset: 8px; border-radius: 50%; }

.byline.small-by { font-size: clamp(15px, 1.4vw, 18px); color: var(--muted); letter-spacing: 0.04em; }
