@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-300-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color: #151914;
  background: #1c3028;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --paper: #f5f3eb;
  --paper-deep: #ece9df;
  --ink: #151914;
  --muted: #61665f;
  --line: rgba(21, 25, 20, 0.15);
  --amber: #f36b21;
  --warm: #fbf8ee;
  --forest: #1c3028;
  --stage: #f1f2ed;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--ink);
  background: var(--forest);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
:focus-visible {
  outline: 3px solid rgba(243, 107, 33, 0.55);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Outer forest shell —— */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--forest);
}
.app::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 82%, rgba(243, 107, 33, 0.1), transparent 36%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  content: "";
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: calc(10px + var(--safe-top)) clamp(18px, 3.5vw, 48px) 8px;
  color: #f6f2e8;
}
.roover-mark {
  display: inline-flex;
  align-items: baseline;
  color: inherit;
  font: 400 14px/1 Manrope, sans-serif;
  letter-spacing: 0.23em;
}
.roover-mark i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 2px;
  background: var(--amber);
  border-radius: 50%;
}
.chrome-title {
  color: rgba(246, 242, 232, 0.55);
  font: 400 12px/1 Manrope, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.back-hub {
  color: rgba(246, 242, 232, 0.72);
  font: 400 12px/1 Manrope, sans-serif;
  letter-spacing: 0.08em;
}
.back-hub:hover { color: #f6f2e8; }

/* —— Paper story window —— */
.stage-wrap {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 0 clamp(14px, 3vw, 40px) 12px;
}
.story-card {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--stage);
  border-radius: 28px;
  box-shadow: 0 28px 72px #00000055;
}

.film {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 58% 30%;
}
.film video,
.film-still {
  position: absolute;
  top: 0;
  left: 50%;
  width: 118%;
  height: 132%;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: 42% 8%;
}
.film video {
  opacity: 0.42;
  filter: grayscale(1) contrast(1.05) brightness(0.92);
}
.film-still {
  display: none;
  opacity: 0.5;
  filter: grayscale(1);
}
.film-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(241, 242, 237, 0.5) 0%, rgba(241, 242, 237, 0.28) 40%, rgba(241, 242, 237, 0.58) 100%);
}
.film-grain {
  position: absolute;
  inset: -20%;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: multiply;
}

.type-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.type-layer .lead,
.type-layer .support,
.type-layer .word,
.type-layer .stack-line {
  margin: 0;
  color: var(--ink);
  font-weight: 300;
  letter-spacing: -0.04em;
}
.type-layer .support {
  color: var(--muted);
  letter-spacing: -0.02em;
}
.caret {
  display: inline-block;
  width: 0.05em;
  height: 0.85em;
  margin-left: 0.04em;
  vertical-align: -0.05em;
  background: var(--ink);
  opacity: 0;
  animation: blink 1s steps(1) infinite;
}
.caret.on { opacity: 0.55; }
@keyframes blink {
  50% { opacity: 0; }
}

.amber-word { color: var(--amber); }
.amber-line {
  display: block;
  width: 0;
  height: 2px;
  margin-top: 10px;
  background: var(--amber);
  transition: width 0.7s var(--ease);
}
.amber-line.on { width: min(120px, 40%); }

/* —— HUD —— */
.hud {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 6px clamp(18px, 3.5vw, 48px) calc(14px + var(--safe-bottom));
  color: #f6f2e8;
}
.hud-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-btn {
  min-width: 44px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(246, 242, 232, 0.22);
  border-radius: 999px;
  color: rgba(246, 242, 232, 0.88);
  font: 400 12px/1 Manrope, sans-serif;
  letter-spacing: 0.08em;
}
.hud-btn:hover { border-color: rgba(246, 242, 232, 0.5); }
.hud-btn:disabled { opacity: 0.35; cursor: default; }
.dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(246, 242, 232, 0.28);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.dots span.on {
  background: var(--amber);
  transform: scale(1.15);
}
.beat-label {
  color: rgba(246, 242, 232, 0.5);
  font: 400 11px/1 Manrope, sans-serif;
  letter-spacing: 0.12em;
}

@media (max-width: 520px) {
  .chrome-title { display: none; }
  .story-card { border-radius: 22px; }
  .hud-btn { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { display: none !important; }
  .film video { display: none; }
  .film-still { display: block; }
}
