@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 {
  --ink-open: #f5f3eb;
  --void: #0a0c0a;
  --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);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
  color: var(--ink-open);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}
html { position: fixed; inset: 0; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
:focus-visible {
  outline: 2px solid rgba(243, 107, 33, 0.55);
  outline-offset: 3px;
}

body.is-hero {
  background: #e4e6df;
  color: #0b2a20;
}

/* —— Phase Open —— */
#phase-open {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--void);
  opacity: 1;
  transition: opacity 400ms var(--ease);
  pointer-events: auto;
}
#phase-open.is-leaving {
  opacity: 0;
  pointer-events: none;
}
#phase-open.is-gone {
  display: none;
}

.film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  background: var(--void);
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(10, 12, 10, 0.42) 100%),
    linear-gradient(to top, rgba(10, 12, 10, 0.55) 0%, transparent 14%),
    linear-gradient(to bottom, rgba(10, 12, 10, 0.28) 0%, transparent 12%);
  z-index: 2;
}

.grain-open {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: soft-light;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.year-wrap {
  position: absolute;
  top: calc(22px + var(--safe-top));
  left: calc(28px + var(--safe-left));
  z-index: 5;
  pointer-events: none;
}
.year-open {
  display: block;
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(42px, 7.2vw, 78px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: rgba(245, 243, 235, 0.92);
  text-shadow:
    0 1px 0 rgba(10, 12, 10, 0.35),
    0 8px 28px rgba(10, 12, 10, 0.45);
}

.chrome-open {
  position: absolute;
  top: calc(18px + var(--safe-top));
  right: calc(22px + var(--safe-right));
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 14px;
  pointer-events: none;
}
.mark {
  font-family: Manrope, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 243, 235, 0.78);
  pointer-events: auto;
}
.mark i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-radius: 50%;
  background: #f36b21;
  vertical-align: 1px;
}
.quiet {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(245, 243, 235, 0.38);
}

.gate {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(10, 12, 10, 0.28);
  color: rgba(245, 243, 235, 0.92);
  cursor: pointer;
  touch-action: manipulation;
}
.gate[hidden] { display: none !important; }
.gate-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 243, 235, 0.55);
  background:
    radial-gradient(circle at 45% 50%, transparent 0 38%, rgba(245, 243, 235, 0.92) 39% 40%, transparent 41%),
    rgba(10, 12, 10, 0.35);
  box-shadow: 0 10px 40px rgba(10, 12, 10, 0.35);
}
.gate-label {
  font-family: Manrope, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 243, 235, 0.82);
}

.transport {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.48);
  border: 1px solid rgba(245, 243, 235, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(245, 243, 235, 0.88);
  font-size: 28px;
  line-height: 1;
  touch-action: manipulation;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.nav-btn:hover,
.nav-btn:active { background: rgba(245, 243, 235, 0.1); }
.nav-play {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(245, 243, 235, 0.22);
  background: rgba(10, 12, 10, 0.35);
  font-size: 18px;
}
.play-icon {
  display: block;
  transform: translateX(1px);
}
.nav-play.is-playing .play-icon {
  transform: none;
  letter-spacing: 0.08em;
  font-size: 16px;
}

.mute {
  position: absolute;
  right: calc(16px + var(--safe-right));
  bottom: calc(22px + var(--safe-bottom));
  z-index: 7;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.42);
  border: 1px solid rgba(245, 243, 235, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(245, 243, 235, 0.78);
  font-size: 12px;
  letter-spacing: 0.04em;
  touch-action: manipulation;
}

@media (max-width: 640px) {
  .year-wrap {
    top: calc(56px + var(--safe-top));
    left: calc(18px + var(--safe-left));
  }
  .chrome-open {
    left: calc(18px + var(--safe-left));
    right: auto;
    gap: 10px;
  }
  .quiet { display: none; }
  .year-open { font-size: clamp(36px, 11vw, 56px); }
  .transport {
    bottom: calc(18px + var(--safe-bottom));
    gap: 8px;
    padding: 8px 8px;
  }
  .mute {
    bottom: calc(86px + var(--safe-bottom));
    right: calc(16px + var(--safe-right));
  }
}

@media (min-width: 641px) {
  .mute { right: calc(22px + var(--safe-right)); }
}
