@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-latin-900-normal.woff2") format("woff2");
  font-weight: 900; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

:root {
  --ink: #2a1c0e;
  --paper: #f2e2c2;
  --stone: #cdb488;
  --stone-dark: #6b5230;
  --sepia1: #4a3418;
  --sepia2: #1c1206;
  --accent: #8a3b1e;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "EB Garamond", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sepia2); color: var(--paper);
  font-family: var(--font-body); font-size: 18px;
  min-height: 100vh;
}
body.is-locked { overflow: hidden; height: 100vh; }
body.is-shaking { animation: shake 0.5s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-10px, 4px) rotate(-0.6deg); }
  30% { transform: translate(9px, -5px) rotate(0.5deg); }
  45% { transform: translate(-7px, 5px) rotate(-0.4deg); }
  60% { transform: translate(6px, -3px) rotate(0.3deg); }
  75% { transform: translate(-4px, 2px) rotate(-0.2deg); }
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-family: var(--font-display); margin: 0; }
.skip-link { position: absolute; left: -9999px; }

/* ---------- backdrop ---------- */
#slopeBg {
  position: fixed; inset: 0; z-index: 1;
  background: url("assets/slope.webp") center 30% / cover no-repeat;
  filter: sepia(0.5) contrast(1.05);
}
#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 35%, rgba(20,13,6,0.15) 30%, rgba(15,9,4,0.82) 100%);
}
#grain {
  position: fixed; inset: 0; z-index: 850; pointer-events: none; opacity: 0.09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- custom paw cursor ---------- */
@media (pointer: fine) {
  body.cursor-ready, body.cursor-ready a, body.cursor-ready button { cursor: none; }
}
#cursorPaw {
  position: fixed; top: 0; left: 0; width: 30px; height: 30px; z-index: 9998;
  transform: translate(-999px, -999px); pointer-events: none;
  background-repeat: no-repeat; background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23f2e2c2' stroke='%232a1c0e' stroke-width='4'%3E%3Cellipse cx='50' cy='62' rx='26' ry='22'/%3E%3Cellipse cx='22' cy='34' rx='11' ry='14' transform='rotate(-18 22 34)'/%3E%3Cellipse cx='44' cy='20' rx='11' ry='14'/%3E%3Cellipse cx='68' cy='22' rx='11' ry='14' transform='rotate(14 68 22)'/%3E%3Cellipse cx='82' cy='42' rx='10' ry='13' transform='rotate(30 82 42)'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- floating cat widget ---------- */
#catWidget {
  position: fixed; right: 16px; bottom: 16px; z-index: 500;
  width: 78px; height: 78px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(242,226,194,0.25), rgba(20,13,6,0.5));
  border: 3px solid var(--stone);
  display: grid; place-items: center; cursor: pointer; padding: 6px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.5);
  transition: transform 0.15s var(--ease), filter 0.5s;
}
#catWidget:hover { transform: scale(1.06); }
#catWidget:active { transform: scale(0.93); }
#catWidgetImg { width: 100%; height: 100%; object-fit: contain; }
#catWidget.mood-tense { filter: saturate(1.3) contrast(1.1); }
#catWidget.mood-furious { filter: saturate(1.6) hue-rotate(-10deg) contrast(1.2); animation: catRattle 0.35s infinite; }
#catWidget.mood-zen { filter: sepia(0.4) brightness(1.15) saturate(0.85); }
@keyframes catRattle {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  25% { transform: translate(-1.5px,0) rotate(-1deg); }
  75% { transform: translate(1.5px,0) rotate(1deg); }
}
@keyframes purrPop {
  0% { transform: scale(1); }
  40% { transform: scale(0.86) rotate(-4deg); }
  100% { transform: scale(1); }
}
#catWidget.purring #catWidgetImg { animation: purrPop 0.4s var(--ease); }

/* ---------- topline / rail ---------- */
.topline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 36px);
  background: linear-gradient(rgba(20,13,6,0.75), transparent);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; color: var(--paper); }
.ca-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,13,6,0.55); border: 1px solid var(--stone);
  border-radius: 4px; padding: 7px 14px; font-family: var(--font-body); font-size: 13px;
  color: var(--paper); cursor: pointer; transition: border-color 0.2s;
}
.ca-pill span:first-child { opacity: 0.6; font-family: var(--font-display); font-size: 11px; }
.ca-pill:hover { border-color: var(--accent); }
.ca-pill.is-copied { border-color: var(--accent); color: var(--accent); }

.rail {
  position: fixed; left: clamp(14px, 3vw, 34px); top: 50%; transform: translateY(-50%); z-index: 400;
  display: flex; flex-direction: column; gap: 18px;
}
body.is-locked .rail, body.is-locked #catWidget { display: none; }
.rail a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.55; transition: opacity 0.2s;
}
.rail a span { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--paper); transition: background 0.2s; }
.rail a:hover, .rail a.is-active { opacity: 1; }
.rail a.is-active span { background: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) { .rail a span + * { display: none; } }
@media (max-width: 520px) { .rail { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
  padding: 13px 26px; border-radius: 3px; text-decoration: none; border: 1px solid var(--stone-dark);
  cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-primary { background: linear-gradient(180deg, #b5843f, #7a4a1a); color: #201202; box-shadow: 0 8px 20px -8px rgba(0,0,0,0.7); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(20,13,6,0.5); color: var(--paper); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-text { background: none; border-color: transparent; color: var(--paper); opacity: 0.75; text-decoration: underline; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero / push ---------- */
main { position: relative; z-index: 5; }
.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 20px 40px; position: relative;
}
.hero-frame {
  width: min(58vw, 380px); padding: 10px; margin-bottom: 8px;
  background: linear-gradient(160deg, #4a3418, #201202);
  border: 3px solid var(--stone);
  box-shadow: 0 0 0 6px rgba(20,13,6,0.5), 0 25px 60px -20px rgba(0,0,0,0.8);
}
.hero-art { width: 100%; filter: contrast(1.05) saturate(0.95); }
.ticker {
  font-size: clamp(38px, 7vw, 68px); letter-spacing: 0.03em; color: var(--paper);
  text-shadow: 0 2px 0 #000, 0 0 30px rgba(138,59,30,0.4);
}
.sub { opacity: 0.8; font-style: italic; margin: 8px 0 20px; }

.push-rig { width: min(90vw, 420px); margin-top: 6px; }
.push-label { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; margin: 0 0 10px; }
.push-track {
  position: relative; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, #1a1006, #0c0703);
  border: 2px solid var(--stone-dark);
  overflow: visible;
}
.push-fill {
  position: absolute; inset: 2px; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, #6b3d15, #b5843f);
  transition: width 0.08s linear;
}
.push-cat {
  position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 26px;
  transition: left 0.08s linear; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.6));
}
.push-pct { font-family: var(--font-display); font-size: 13px; margin: 8px 0 0; opacity: 0.8; }
.push-anyway { margin-top: 18px; }
.push-counter { margin-top: 30px; font-size: 12px; letter-spacing: 0.04em; opacity: 0.6; font-family: var(--font-body); }
.push-counter b { color: var(--paper); opacity: 1; font-weight: 600; }

.fail-overlay {
  position: fixed; inset: 0; z-index: 800; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10,6,2,0.7); opacity: 0; pointer-events: none; transition: opacity 0.35s;
  text-align: center; padding: 20px;
}
.fail-overlay.is-on { opacity: 1; }
.fail-meow { font-family: var(--font-display); font-size: 40px; margin: 0 0 10px; color: var(--paper); }
.fail-quote { font-style: italic; font-size: 18px; opacity: 0.85; max-width: 40ch; }

/* ---------- ledges ---------- */
.ledge {
  position: relative; max-width: 900px; margin: 0 auto; padding: 130px 24px 60px;
  text-align: center;
}
.ledge-kicker { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.ledge-title { font-size: clamp(30px, 5vw, 48px); margin-bottom: 8px; text-shadow: 0 2px 0 #000; }
.ledge-sub { opacity: 0.75; font-style: italic; margin: 0 0 40px; }

.ledge-tablet { width: min(90vw, 560px); margin: 0 auto 30px; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6)); }
.myth-text { max-width: 60ch; margin: 0 auto; text-align: left; font-size: 19px; line-height: 1.7; }
.myth-text p { margin: 0 0 18px; }
.myth-text p::first-letter { font-family: var(--font-display); font-size: 1.6em; color: var(--accent); }

.stone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .stone-grid { grid-template-columns: repeat(2, 1fr); } }
.stone-plaque {
  background: linear-gradient(160deg, #4a3418, #241708);
  border: 2px solid var(--stone-dark); border-radius: 4px;
  padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}
.stone-value { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.stone-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.65; }

.boulder-rig { margin-bottom: 30px; }
.boulder-ca {
  position: relative; font-family: var(--font-body); font-size: 15px;
  background: linear-gradient(160deg, #4a3418, #241708); color: var(--paper);
  border: 2px solid var(--stone-dark); border-radius: 999px; padding: 12px 24px;
  cursor: pointer; transition: transform 0.4s var(--ease), left 0.4s var(--ease);
  left: 0; display: inline-block;
}
.boulder-msg { min-height: 1.4em; font-size: 13px; opacity: 0.8; margin-top: 12px; font-style: italic; }

.forge-rig { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; justify-content: center; }
.forge-preview {
  width: min(70vw, 320px); border: 3px solid var(--stone); padding: 8px;
  background: linear-gradient(160deg, #4a3418, #201202);
}
#forgeCanvas { width: 100%; aspect-ratio: 1/1; display: block; }
.forge-controls { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.forge-upload { cursor: pointer; }

/* ---------- summit ---------- */
.summit-overlay {
  position: fixed; inset: 0; z-index: 9000; background: #ece2cf;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  filter: sepia(0.6);
}
.summit-overlay[hidden] { display: none; }
.summit-inner { text-align: center; max-width: 60ch; color: #3a2a15; }
.summit-line { font-family: var(--font-display); font-size: 18px; margin: 0 0 14px; }
.summit-line-big { font-size: clamp(26px, 5vw, 44px); font-weight: 900; letter-spacing: 0.04em; }
.summit-role { font-size: 15px; margin: 20px 0 28px; }
.summit-overlay .btn-ghost { color: #3a2a15; border-color: #6b5230; background: rgba(255,255,255,0.3); }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 5; text-align: center; padding: 70px 20px 50px; }
.footer-line { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; margin: 0 0 18px; }
.footer-socials { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.footer-socials a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20,13,6,0.5); border: 1px solid var(--stone-dark);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.footer-socials a:hover { border-color: var(--accent); transform: translateY(-3px); }
.footer-ca { font-size: 11px; opacity: 0.5; word-break: break-all; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.is-shaking { animation: none; }
  #catWidget.mood-furious { animation: none; }
  #catWidget.purring #catWidgetImg { animation: none; }
  #grain { display: none; }
}
