/* Gurgle Chain — landing page
   Ink and tones follow docs/design/ui-notes (notes #857E78, logo #A8957F). */

@font-face {
  font-family: "Horror";
  src: url("assets/fonts/HorrorFont-Regular.ttf") format("truetype");
  font-display: block;
}

:root {
  --void: #050404;
  --void-2: #0c0a09;
  --ash: #1a1715;
  --ink: #857e78;        /* note ink */
  --tan: #a8957f;        /* logo ink */
  --bone: #d9cfc3;       /* body text */
  --dim: #8a827b;
  --blood: #7d0d12;
  --blood-hi: #b3141c;
  --gutter: clamp(16px, 5vw, 64px);
  --measure: 38rem;
  --serif: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --horror: "Horror", "IM Fell English SC", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
em { color: var(--tan); }
::selection { background: var(--blood); color: var(--bone); }

/* ── atmosphere ─────────────────────────────────────────── */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 49;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.horror {
  font-family: var(--horror);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--tan);
  line-height: 1.05;
}

/* ── hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  cursor: crosshair;
}
.stage svg { width: 100%; height: 100%; display: block; }
#plates image { transition: opacity 90ms linear; }
.stage::after { /* fade the face into the page */
  content: ""; position: absolute; inset: auto 0 0 0; height: 24%;
  background: linear-gradient(to bottom, transparent, rgba(5,4,4,0.75) 55%, var(--void));
  pointer-events: none;
}

#notes text {
  font-family: var(--horror);
  fill: var(--ink);
  fill-opacity: 0.92;
}
#notes path { fill: none; stroke: var(--ink); stroke-opacity: 0.9; stroke-linecap: round; stroke-linejoin: round; }
#notes .ghost { fill-opacity: 0.25; }
.mobile-only { display: none; }

/* the logo lives outside the cropped face so it is always on screen */
.brand {
  position: absolute; z-index: 2;
  top: clamp(8px, 2vw, 28px); left: clamp(8px, 2vw, 32px);
  margin: 0;
  width: clamp(170px, 24vw, 380px);
  pointer-events: none;
}
.brand a { display: block; pointer-events: auto; }
.brand__ink {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 559 / 471;
  opacity: 0.95;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.85));
}

.hero-copy {
  position: relative;
  margin-top: -12vh;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 0 var(--gutter) clamp(40px, 8vh, 90px);
  gap: 0.9rem;
}
.whisper {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem);
  color: var(--bone);
  text-shadow: 0 2px 18px #000, 0 0 3px #000;
}
.formats {
  margin: 0;
  font-family: var(--sc);
  font-size: 0.85rem; letter-spacing: 0.18em;
  color: var(--dim);
  text-shadow: 0 0 6px #000;
}

/* ── CTA ────────────────────────────────────────────────── */
.cta {
  --pad: clamp(0.9rem, 0.7rem + 0.8vw, 1.3rem);
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 0.15rem;
  padding: var(--pad) calc(var(--pad) * 2.4);
  text-decoration: none;
  color: var(--bone);
  background:
    radial-gradient(120% 140% at 50% 120%, rgba(179,20,28,0.55), transparent 60%),
    linear-gradient(#170707, #0b0303);
  border: 1px solid rgba(179,20,28,0.6);
  box-shadow: 0 0 0 1px #000, 0 10px 40px -10px rgba(179,20,28,0.55), inset 0 0 22px rgba(0,0,0,0.8);
  transition: transform 200ms ease, box-shadow 300ms ease, border-color 300ms ease;
  -webkit-tap-highlight-color: transparent;
  clip-path: polygon(0 4%, 3% 0, 52% 2%, 97% 0, 100% 7%, 99% 55%, 100% 96%, 96% 100%, 45% 98%, 4% 100%, 0 93%, 1% 40%);
}
.cta::after { /* a drip off the bottom edge */
  content: ""; position: absolute; left: 68%; top: 100%;
  width: 5px; height: 0; border-radius: 0 0 4px 4px;
  background: var(--blood-hi);
  transition: height 900ms cubic-bezier(.2,.7,.2,1);
}
.cta:hover, .cta:focus-visible {
  transform: translateY(-2px);
  border-color: var(--blood-hi);
  box-shadow: 0 0 0 1px #000, 0 16px 60px -8px rgba(179,20,28,0.8), inset 0 0 18px rgba(0,0,0,0.6);
  outline: none;
}
.cta:focus-visible { box-shadow: 0 0 0 3px var(--tan), 0 16px 60px -8px rgba(179,20,28,0.8); }
.cta__word {
  font-family: var(--horror);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem);
  letter-spacing: 0.16em;
  line-height: 1.1;
  color: #efe4d6;
  text-shadow: 0 0 12px rgba(179,20,28,0.6);
}
.cta__price {
  font-family: var(--sc);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--tan);
}
.cta--final .cta__word { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); }

/* ── sections ───────────────────────────────────────────── */
.section {
  position: relative;
  padding: clamp(72px, 12vw, 150px) var(--gutter);
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.section > h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(2.2rem, 1.4rem + 4vw, 4.6rem);
}
.lede {
  margin: 0 auto 2.6rem;
  max-width: var(--measure);
  color: var(--dim);
  font-style: italic;
}

/* reveal on scroll: a flicker-in, like a bulb that's not sure */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { animation: flickerIn 900ms steps(1, end) forwards, rise 900ms ease-out forwards; }
@keyframes flickerIn {
  0% { opacity: 0; } 10% { opacity: 0.6; } 14% { opacity: 0.05; } 26% { opacity: 0.8; }
  30% { opacity: 0.2; } 44% { opacity: 1; } 48% { opacity: 0.55; } 60%, 100% { opacity: 1; }
}
@keyframes rise { to { transform: none; } }

/* ── video FPO ──────────────────────────────────────────── */
.screen {
  margin: 0 auto;
  max-width: 1000px;
  position: relative;
  padding: clamp(8px, 1.4vw, 16px);
  background: linear-gradient(145deg, #1b1715, #0a0807);
  border: 1px solid #2a2421;
  box-shadow: 0 30px 80px -30px #000, inset 0 0 0 1px #000;
}
.screen__fpo {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.screen__fpo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.85) contrast(1.2) brightness(0.35) blur(1.5px);
  transform: scale(1.08);
  animation: tapeRoll 7s ease-in-out infinite;
}
@keyframes tapeRoll {
  0%, 92%, 100% { transform: scale(1.08) translateY(0); }
  94% { transform: scale(1.08) translateY(-3%); filter: grayscale(0.85) contrast(1.6) brightness(0.5) blur(2px) hue-rotate(-20deg); }
  96% { transform: scale(1.08) translateY(2%); }
}
.screen__fpo::before { /* scanlines */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.35) 0 1px, transparent 1px 3px);
}
.screen__play {
  position: absolute; inset: 0; margin: auto; z-index: 2;
  width: clamp(64px, 10vw, 96px); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(168,149,127,0.6);
  background: rgba(5,4,4,0.55);
  color: var(--tan);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 200ms ease, background 200ms ease;
}
.screen__play svg { width: 46%; fill: currentColor; margin-left: 8%; }
.screen__play:hover, .screen__play:focus-visible { transform: scale(1.06); background: rgba(125,13,18,0.5); outline: none; }
.screen__tag, .screen__rec, .screen__tc {
  position: absolute; z-index: 2;
  font-family: var(--sc); font-size: clamp(0.65rem, 0.6rem + 0.3vw, 0.85rem); letter-spacing: 0.18em;
  color: var(--ink);
}
.screen__tag { left: 0; right: 0; bottom: 6%; text-align: center; padding: 0 1rem; }
.screen__rec { top: 5%; left: 4%; color: var(--blood-hi); display: flex; align-items: center; gap: 0.5em; }
.screen__rec b { width: 0.65em; height: 0.65em; border-radius: 50%; background: var(--blood-hi); animation: blink 1.2s steps(1) infinite; }
.screen__tc { top: 5%; right: 4%; font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: 0; } }

/* ── audio relics ───────────────────────────────────────── */
.relic-list {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 900px;
  display: grid; gap: 14px;
  text-align: left;
}
.relic {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  padding: clamp(12px, 2vw, 20px);
  background: linear-gradient(90deg, rgba(26,23,21,0.9), rgba(12,10,9,0.9));
  border: 1px solid #241f1c;
  border-left: 2px solid var(--blood);
}
.relic.is-playing { border-left-color: var(--blood-hi); box-shadow: -8px 0 30px -12px rgba(179,20,28,0.7); }
.relic__play {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(168,149,127,0.5);
  background: #0b0908; color: var(--tan);
  cursor: pointer; display: grid; place-items: center;
}
.relic__play i { /* play triangle / pause bars, drawn with borders */
  width: 0; height: 0; margin-left: 4px;
  border-left: 14px solid currentColor; border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.relic.is-playing .relic__play i { width: 14px; height: 16px; margin: 0; border: 0; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.relic__play:hover, .relic__play:focus-visible { background: #1d0607; outline: none; border-color: var(--blood-hi); }
.relic__body { min-width: 0; }
.relic__title { margin: 0; font-family: var(--sc); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.06em; color: var(--bone); }
.relic__note { margin: 0 0 6px; font-style: italic; color: var(--dim); font-size: 0.95rem; }
.relic__wave { width: 100%; height: 56px; display: block; cursor: pointer; }
.relic__flip { display: flex; flex-direction: column; gap: 4px; }
.relic__flip button {
  font: inherit; font-family: var(--sc); font-size: 0.8rem; letter-spacing: 0.12em;
  padding: 0.3em 0.8em; min-height: 32px;
  background: transparent; color: var(--dim);
  border: 1px solid #2c2622; cursor: pointer;
}
.relic__flip button[aria-pressed="true"] { color: var(--bone); border-color: var(--blood-hi); background: rgba(125,13,18,0.35); }
.fpo-note { margin: 1.4rem 0 0; font-family: var(--sc); font-size: 0.75rem; letter-spacing: 0.2em; color: #5a534e; }

/* ── ritual ─────────────────────────────────────────────── */
.rite-list {
  list-style: none; padding: 0; margin: 2.4rem auto 0;
  display: grid; gap: clamp(28px, 4vw, 48px);
  grid-template-columns: repeat(3, 1fr);
  text-align: left;
}
.rite { position: relative; padding-top: 0.4rem; }
.rite__num {
  display: block;
  font-family: var(--sc); font-size: clamp(3rem, 2rem + 3vw, 5rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--blood-hi);
  margin-bottom: 0.4rem;
}
.rite h3 { margin: 0 0 0.5rem; font-family: var(--sc); font-weight: 400; font-size: 1.35rem; color: var(--tan); }
.rite p { margin: 0; color: var(--bone); }
.faithless { margin: clamp(40px, 6vw, 70px) auto 0; max-width: var(--measure); color: var(--dim); font-style: italic; }

/* ── six sorrows ────────────────────────────────────────── */
.sorrow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 30px);
  text-align: left;
}
.sorrow {
  position: relative;
  padding: 0 0 1.4rem;
  background: linear-gradient(180deg, #0f0c0b, #070505);
  border: 1px solid #1f1a18;
}
.sorrow > :not(.sorrow__face) { padding: 0 clamp(16px, 2vw, 22px); }
.sorrow__face {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
  margin-bottom: 1.1rem;
}
.sorrow__face span {
  position: absolute; left: 50%; top: 50%;
  width: calc(100% * var(--z));
  aspect-ratio: 3 / 2;
  background: url("assets/img/face.jpg") center / cover no-repeat;
  transform: translate(calc(-1 * var(--fx)), calc(-1 * var(--fy)));
  filter: grayscale(0.3) contrast(1.08) brightness(0.85);
  transition: transform 1.6s cubic-bezier(.2,.7,.2,1), filter 600ms ease;
}
.sorrow__face::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(5,4,4,0.85) 100%), linear-gradient(transparent 60%, #0f0c0b);
}
.sorrow:hover .sorrow__face span, .sorrow.is-near .sorrow__face span {
  transform: translate(calc(-1 * var(--fx)), calc(-1 * var(--fy))) scale(1.08);
  filter: grayscale(0) contrast(1.15) brightness(1);
}
.sorrow--voices .sorrow__face span:nth-child(2) { opacity: 0.22; margin-left: 9%; margin-top: 3%; animation: drift 7s ease-in-out infinite; }
.sorrow--voices .sorrow__face span:nth-child(3) { opacity: 0.14; margin-left: -11%; margin-top: 6%; animation: drift 9s ease-in-out infinite reverse; }
@keyframes drift { 50% { margin-left: 2%; margin-top: -2%; } }
.sorrow h3 { margin: 0; font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem); }
.sorrow__where { margin: 0.2rem 0 0.8rem; font-family: var(--sc); font-size: 0.85rem; letter-spacing: 0.12em; color: var(--blood-hi); }
.sorrow p { margin-top: 0; }
.sorrow__skin { margin: 0.9rem 0 0; font-family: var(--sc); font-size: 0.72rem; letter-spacing: 0.22em; color: #4f4945; }

/* ── final ──────────────────────────────────────────────── */
.waiting { overflow: hidden; padding-bottom: clamp(90px, 14vw, 180px); }
.waiting__splat {
  position: absolute; left: 50%; top: 50%;
  width: min(1286px, 160vw); aspect-ratio: 1286 / 720;
  transform: translate(-50%, -46%) rotate(-4deg);
  background: url("assets/img/splatter.png") center / contain no-repeat;
  opacity: 0.32; z-index: -1;
  filter: saturate(0.8) brightness(0.7);
}
.waiting__eyes {
  position: absolute; inset: 0; z-index: -2;
  background: url("assets/img/face-wide.jpg") center 32% / cover no-repeat;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.specs {
  list-style: none; padding: 0; margin: 2.6rem 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.6rem;
  font-family: var(--sc); font-size: 0.85rem; letter-spacing: 0.12em; color: var(--dim);
}

.foot {
  padding: 48px var(--gutter) 64px;
  text-align: center;
  border-top: 1px solid #16120f;
  color: #5d5651; font-size: 0.9rem;
}
.foot__logo { width: 120px; margin: 0 auto 0.8rem; filter: brightness(0.55) sepia(0.6); opacity: 0.8; }
.foot p { margin: 0.2rem 0; }
.foot a { color: var(--dim); text-decoration: none; border-bottom: 1px solid #2c2622; }
.foot a:hover, .foot a:focus-visible { color: var(--tan); border-color: var(--blood-hi); outline: none; }
.foot__small { font-style: italic; font-size: 0.8rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0;
  max-width: calc(100vw - 32px);
  padding: 0.7rem 1.2rem;
  background: #110707; border: 1px solid var(--blood);
  font-family: var(--sc); letter-spacing: 0.08em; color: var(--bone); font-size: 0.95rem;
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* scream flash: the whole page jolts */
body.jolt { animation: jolt 180ms steps(2) 1; }
@keyframes jolt { 0% { transform: translate(3px, -2px); } 50% { transform: translate(-4px, 2px); } 100% { transform: none; } }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .rite-list { grid-template-columns: 1fr; max-width: 34rem; }
  .sorrow-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-aspect-ratio: 1/1) {
  .stage { height: auto; min-height: 0; aspect-ratio: 540 / 512; }
  .stage svg { position: absolute; inset: 0; }
  .stage::after { height: 30%; }
  .hero-copy { margin-top: -6vw; padding-bottom: 40px; }
}
@media (max-width: 600px) {
  .sorrow-grid { grid-template-columns: 1fr; }
  .relic { grid-template-columns: auto 1fr; }
  .relic__flip { grid-column: 1 / -1; flex-direction: row; }
  .relic__flip button { flex: 1; }
  .cta { width: 100%; max-width: 26rem; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .descend i, .screen__fpo img, .sorrow--voices span { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal.is-in { animation: none; }
  html { scroll-behavior: auto; }
}

.hint {
  margin: 0.3rem 0 0;
  font-style: italic; font-size: 0.85rem;
  color: #5d5651;
}
.sorrow--screams .sorrow__face span { background-image: url("assets/img/face-scream.jpg"); }
.sorrow--voices .sorrow__face span:nth-child(n+2) { background-image: url("assets/img/face-scream.jpg"); }
