/* graveyard.css — the 3D "startup graveyard" test page. Brand: cream, ink, signal red-orange, Manrope. */
:root {
  --cream: #F4F1EA; --ink: #161616; --muted: #4f4e4b; --signal: #E4502F;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--cream); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
#world, #pulse { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#world { z-index: 0; }
#pulse { z-index: 1; pointer-events: none; }
.g-scroller { height: 720vh; }

/* ---------- glass nav (turns dark at night) ---------- */
.g-nav { position: fixed; z-index: 5; top: 14px; left: 50%; transform: translateX(-50%); width: min(1140px, calc(100% - 28px));
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.55); -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 10px 30px rgba(90, 50, 30, 0.07); transition: background .6s, border-color .6s; }
.g-logo img { height: 26px; width: auto; display: block; transition: filter .6s; }
.g-nav-cta { text-decoration: none; font-size: 14px; font-weight: 700; color: #fff; background: var(--ink); padding: 9px 14px; border-radius: 10px; transition: background .6s, color .6s; }
body.night .g-nav { background: rgba(18, 16, 18, 0.5); border-color: rgba(255, 255, 255, 0.08); box-shadow: none; }
body.night .g-logo img { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
body.night .g-nav-cta { background: var(--cream); color: var(--ink); }

/* ---------- panels fade in and out with the scroll (opacity and --y set by graveyard.js) ---------- */
.g-panel { position: fixed; z-index: 2; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.g-panel.live { pointer-events: auto; }

.g-hero { left: max(28px, calc(50vw - 570px)); top: 50%; width: min(600px, 47vw); transform: translateY(calc(-50% + var(--y, 0px))); }
.g-pill { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: #BF3F1C; background: #FCEDE7; border: 1px solid rgba(228, 80, 47, .28); border-radius: 999px; padding: 7px 12px; }
.g-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(228, 80, 47, .6); animation: gBeat 1s infinite; }
@keyframes gBeat { 0% { box-shadow: 0 0 0 0 rgba(228, 80, 47, .55); } 70% { box-shadow: 0 0 0 8px rgba(228, 80, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(228, 80, 47, 0); } }
.g-hero h1 { font-size: clamp(38px, 4.3vw, 60px); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; margin: 18px 0 16px; }
.g-hero h1 em { font-style: normal; color: var(--signal); }
.g-hero > p { color: var(--muted); font-size: 17px; margin: 0; max-width: 470px; }
.g-scroll-old { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #6b6a66; margin-top: 30px !important; }
.g-scroll span { display: inline-block; margin-left: 6px; animation: gBob 1.6s ease-in-out infinite; }
@keyframes gBob { 50% { transform: translateY(5px); } }

.g-form { display: flex; gap: 8px; margin-top: 24px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 14px 40px rgba(90, 50, 30, .1); max-width: 500px; }
.g-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px; font: 15px var(--sans); color: inherit; outline: none; }
.g-form button { border: 0; border-radius: 12px; padding: 12px 18px; font: 700 15px var(--sans); color: #fff; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #F7A86E 0%, #EE6A43 40%, #E4502F 62%, #C9451F 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 22px rgba(228, 80, 47, .35); transition: transform .2s, box-shadow .2s; }
.g-form button:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 14px 32px rgba(228, 80, 47, .45); }
.g-form button:disabled { opacity: .85; cursor: wait; }
.g-msg { min-height: 20px; margin: 10px 0 0 !important; font-size: 14px !important; font-weight: 600; color: #BF3F1C !important; }

.g-count { left: 50%; top: 50%; width: min(780px, 90vw); text-align: center; color: var(--cream); transform: translate(-50%, calc(-50% + var(--y, 0px))); }
.g-eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #F0B9A6; margin: 0; }
.g-count h2, .g-end h2 { font-size: clamp(36px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; margin: 16px 0 14px; text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.g-count h2 b { color: var(--signal); font-variant-numeric: tabular-nums; }
.g-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 26px auto 0; max-width: 860px; text-align: left; }
.g-stats div { padding: 16px 16px 14px; border-radius: 16px; background: rgba(16, 13, 16, .62); border: 1px solid rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.g-stats b { display: block; font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; letter-spacing: -.03em; color: var(--cream); font-variant-numeric: tabular-nums; }
.g-stats b.zero { color: #7ee2a8; }
.g-stats span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: rgba(244, 241, 234, .66); }
.g-count { width: min(900px, 92vw); }

/* the cause-of-death card that appears while the matching stones glow */
.g-cause { left: max(24px, calc(50vw - 570px)); top: 50%; width: 330px; padding: 22px 22px 18px; border-radius: 20px; color: var(--cream);
  background: rgba(20, 14, 14, .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(228, 80, 47, .28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); transform: translateY(calc(-50% + var(--y, 0px))); pointer-events: none !important; }
.g-cause h3 { font-size: 30px; line-height: 1.05; letter-spacing: -.03em; margin: 12px 0 8px; transition: opacity .25s; }
.g-cause p { margin: 0; font-size: 14px; color: rgba(244, 241, 234, .75); }
.g-cause p b { font-size: 22px; color: #FF8A64; margin-right: 4px; }
.g-cause-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); margin: 14px 0 10px; overflow: hidden; }
.g-cause-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #8E2A12, #FF6A3D); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.g-cause small { font: 500 11px/1.4 var(--mono); color: rgba(244, 241, 234, .5); }
.g-cause.swap h3, .g-cause.swap p { opacity: 0; }

.g-count p, .g-end > p { color: rgba(244, 241, 234, .72); font-size: 17px; margin: 0 auto; max-width: 560px; }

.g-hint { left: 50%; bottom: 26px; transform: translate(-50%, var(--y, 0px)); pointer-events: none !important; }
.g-hint p { margin: 0; color: rgba(244, 241, 234, .8); font: 500 12.5px/1 var(--mono); letter-spacing: .06em; white-space: nowrap; padding: 11px 16px; border-radius: 999px;
  background: rgba(18, 16, 18, .5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .08); }

.g-end { left: 50%; top: 50%; width: min(660px, 90vw); text-align: center; color: var(--cream); transform: translate(-50%, calc(-50% + var(--y, 0px))); }
.g-end .g-form { margin: 26px auto 0; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.g-end input { color: #fff; }
.g-end input::placeholder { color: rgba(244, 241, 234, .5); }
.g-end .g-msg { color: #F0B9A6 !important; }
.g-back { display: inline-block; margin-top: 14px; color: rgba(244, 241, 234, .7); font-size: 14px; font-weight: 600; text-decoration: none; }
.g-back:hover { color: #fff; }
#g-lies { min-height: 12px; }

/* ---------- the card that appears when the lantern finds a stone ---------- */
.g-tip { position: fixed; z-index: 6; left: 0; top: 0; width: 270px; padding: 15px 17px; border-radius: 16px; pointer-events: none;
  background: rgba(22, 18, 16, .74); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 170, 110, .2);
  color: var(--cream); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); opacity: 0; transition: opacity .18s; }
.g-tip.on { opacity: 1; }
.g-tip b { display: block; font-size: 17px; letter-spacing: -.01em; }
.g-tip .t-meta { font: 500 11.5px/1.4 var(--mono); color: rgba(244, 241, 234, .55); margin: 3px 0 10px; }
.g-tip .t-cause { display: inline-block; font-size: 12.5px; font-weight: 700; color: #FFB08A; background: rgba(228, 80, 47, .16); border: 1px solid rgba(228, 80, 47, .35); border-radius: 999px; padding: 4px 10px; }
.g-tip p { margin: 10px 0 0; font-size: 13.5px; color: rgba(244, 241, 234, .82); line-height: 1.45; }
.g-tip small { display: block; margin-top: 10px; font: 500 11px/1.4 var(--mono); color: #F0B9A6; letter-spacing: .04em; }

/* ---------- no 3D available: show the words as a normal page ---------- */
body.no-3d .g-scroller, body.no-3d #world, body.no-3d #pulse, body.no-3d .g-hint { display: none; }
body.no-3d .g-panel { position: relative; opacity: 1 !important; pointer-events: auto; transform: none !important; left: auto; top: auto; margin: 120px auto 60px; width: min(620px, 90vw); }
body.no-3d .g-count, body.no-3d .g-end { color: var(--ink); }
body.no-3d .g-count p, body.no-3d .g-end > p, body.no-3d .g-back { color: var(--muted); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .g-hero { left: 16px; right: 16px; width: auto; top: auto; bottom: 22px; transform: translateY(var(--y, 0px)); }
  .g-hero h1 { font-size: 34px; margin: 12px 0 10px; }
  .g-hero > p { font-size: 15px; }
  .g-form { margin-top: 16px; }
  .g-form button { padding: 12px 14px; }
  .g-scroll { margin-top: 16px !important; }
  .g-hint p { font-size: 11px; white-space: normal; text-align: center; }
  .g-hint { width: calc(100% - 32px); }
  .g-logo img { height: 22px; }
  .g-stats { grid-template-columns: 1fr 1fr; }
  .g-stats span { font-size: 11.5px; }
  .g-cause { left: 16px; right: 16px; width: auto; top: auto; bottom: 70px; transform: translateY(var(--y, 0px)); padding: 16px; }
  .g-cause h3 { font-size: 22px; }
}

/* ---------- luring people to scroll before they act ---------- */
.g-tease { margin: 22px 0 0 !important; font-size: 16px !important; color: var(--ink) !important; max-width: 470px; }
.g-tease b { color: var(--signal); }
.g-enter { margin-top: 22px; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; padding: 13px 20px 13px 16px; border-radius: 999px;
  font: 700 15px var(--sans); color: var(--ink); background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(90, 50, 30, .1); transition: transform .25s, box-shadow .25s, background .25s; }
.g-enter:hover { transform: translateY(2px); background: rgba(255, 255, 255, .85); box-shadow: 0 14px 34px rgba(228, 80, 47, .16); }
.g-enter-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); animation: gBeat 1s infinite; }
.g-enter-arrow { display: inline-block; color: var(--signal); animation: gBob 1.4s ease-in-out infinite; }
.g-mouse { position: relative; width: 20px; height: 30px; border-radius: 12px; border: 2px solid currentColor; opacity: .9; flex: none; }
.g-mouse i { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--signal); animation: gWheel 1.6s ease-in-out infinite; }
@keyframes gWheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

.g-cue { position: fixed; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 500 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); pointer-events: none; transition: opacity .5s; animation: gBob 1.8s ease-in-out infinite; }
.g-cue.gone { opacity: 0; }

/* the journey rail: where you are, and how much is left */
.g-rail { position: fixed; z-index: 4; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 22px; }
.g-rail::before { content: ""; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 1px; background: rgba(22, 22, 22, .18); transition: background .6s; }
.g-rail a { position: relative; display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--cream); border: 1.5px solid rgba(22, 22, 22, .35); cursor: pointer; transition: transform .3s, background .3s, border-color .3s; }
.g-rail a span { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: 0; transition: opacity .3s; }
.g-rail a.done { background: var(--signal); border-color: var(--signal); }
.g-rail a.now { transform: scale(1.5); background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 5px rgba(228, 80, 47, .18); }
.g-rail a.now span, .g-rail:hover a span { opacity: 1; }
body.night .g-rail::before { background: rgba(255, 255, 255, .18); }
body.night .g-rail a { background: #1a1618; border-color: rgba(255, 255, 255, .35); }
body.night .g-rail a.done, body.night .g-rail a.now { background: var(--signal); border-color: var(--signal); }
body.night .g-rail a span { color: rgba(244, 241, 234, .75); }

/* the nav's "Try premortem" waits until you've walked in */
.g-nav-cta { transition: opacity .5s, transform .5s, background .6s, color .6s; }
body:not(.cta-ready) .g-nav-cta { opacity: 0; transform: translateY(-6px); pointer-events: none; }
@media (max-width: 760px) { .g-rail { right: 10px; gap: 16px; } .g-rail a span { display: none; } .g-cue { display: none; } .g-enter { justify-content: center; } }

/* ---------- the ending: the flash when your stone breaks, then dawn ---------- */
.g-flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 52%, rgba(255, 240, 210, .95) 0%, rgba(255, 170, 110, .55) 35%, rgba(255, 120, 60, 0) 75%); }
.g-end { top: 11vh; transform: translate(-50%, var(--y, 0px)); }
.g-end h2 { font-size: clamp(34px, 4.6vw, 64px) !important; }
.g-end h2 em { font-style: normal; background: linear-gradient(100deg, #1E7A4C, #3DBA7A 55%, #1E7A4C); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.dawn .g-end { color: var(--ink); }
body.dawn .g-end h2 { text-shadow: 0 4px 40px rgba(255, 240, 220, .8); }
body.dawn .g-end .g-eyebrow { color: #1E7A4C; }
body.dawn .g-end > p, body.dawn .g-back { color: rgba(22, 22, 22, .72); }
body.dawn .g-end .g-form { background: rgba(255, 255, 255, .72); border-color: rgba(255, 255, 255, .9); box-shadow: 0 20px 60px rgba(90, 50, 30, .18); }
body.dawn .g-end input { color: var(--ink); }
body.dawn .g-end input::placeholder { color: #8a857c; }
body.dawn .g-end .g-msg { color: #BF3F1C !important; }
body.dawn .g-rail::before { background: rgba(22, 22, 22, .2); }
body.dawn .g-rail a span { color: var(--muted); }
@media (max-width: 760px) { .g-end { top: 9vh; } }

/* the creepy walk: dark edges close in, with a faint red pulse and film grain */
.g-dread { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, .55) 70%, rgba(10, 0, 0, .9) 100%); animation: gDread 2.2s ease-in-out infinite; }
.g-dread::after { content: ""; position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes gDread { 50% { transform: scale(1.04); filter: brightness(1.15) sepia(.3) hue-rotate(-20deg); } }
@media (prefers-reduced-motion: reduce) { .g-dread { animation: none; } }

/* the ending words sit on frosted glass so they read clearly over the sunrise */
.g-end { padding: 30px 40px 26px; border-radius: 30px; width: min(780px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .32));
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .75); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 30px 80px rgba(120, 60, 30, .22); }
body.dawn .g-end h2 { text-shadow: none; }
body:not(.dawn) .g-end { background: rgba(20, 16, 18, .4); border-color: rgba(255, 255, 255, .12); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
@media (max-width: 760px) { .g-end { padding: 22px 18px; } }

/* lightning bolts strike in from the edges of the screen */
.g-bolts { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; mix-blend-mode: screen; }

@media (prefers-reduced-motion: reduce) { .g-bolts { display: none !important; } }
