/* marcugarcia.com v3 — a walk-through, teal on deep, Cabinet Grotesk */

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('../assets/fonts/cabinet-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('../assets/fonts/cabinet-grotesk-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('../assets/fonts/cabinet-grotesk-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #0a2228;
  --deep: #06272d;
  --ink: #f7f9f8;
  --muted: #9fbcbf;
  --accent: #6fd3e0;
  --accent-deep: #2f737d;
  --step-body: clamp(16px, 1.1vw, 18px);
  --step-head: clamp(28px, 2.6vw, 40px);
  --margin: clamp(20px, 3vw, 44px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#stage:active { cursor: grabbing; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 42%, transparent 52%, rgba(2, 10, 12, 0.52) 100%);
}

/* ---------- enter overlay ---------- */

.enter {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: radial-gradient(ellipse 120% 100% at 28% 42%, rgba(10, 34, 40, 0.88), rgba(6, 20, 24, 0.94));
  display: grid;
  place-items: center;
  transition: opacity 700ms var(--ease-out), visibility 700ms;
}

.enter.off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-inner {
  text-align: left;
}

.enter h1, .enter .tag, #walkin {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 900ms var(--ease-out) forwards;
}
.enter h1 { animation-delay: 150ms; }
.enter .tag { animation-delay: 450ms; }
#walkin { animation-delay: 750ms; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .enter h1, .enter .tag, #walkin { animation: none; opacity: 1; transform: none; }
}

.enter h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(64px, 12vw, 170px);
  line-height: 0.86;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .enter h1 {
    font-size: clamp(44px, 16vw, 90px);
    white-space: normal;
  }
}
.enter .l1 { color: var(--accent); }
.enter .l2 { color: var(--ink); }

.enter .tag {
  margin: 18px 0 26px 4px;
  max-width: 30ch;
  font-size: 18px;
  color: var(--muted-foreground, #b9c6c8);
}

#walkin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  background: var(--accent);
  color: var(--deep);
  border: none;
  border-radius: 26px;
  font-family: inherit;
  font-size: var(--step-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(111, 211, 224, 0.25);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
#walkin:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(111, 211, 224, 0.35); }
#walkin:active { transform: translateY(1px) scale(0.98); box-shadow: 0 4px 16px rgba(111, 211, 224, 0.2); }

/* ---------- captions ---------- */

.caps { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

.cap {
  position: absolute;
  left: var(--margin);
  bottom: clamp(72px, 13vh, 130px);
  max-width: 36ch;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
  visibility: hidden;
  padding: 14px 18px 16px;
  background: rgba(6, 34, 40, 0.5);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.cap.on {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.cap h2 {
  margin: 0 0 10px;
  font-size: var(--step-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.cap p {
  margin: 0;
  font-size: clamp(17px, 1.25vw, 20px);
  color: var(--ink);
}

.cap p + p { margin-top: 10px; }

.cap .links {
  display: flex;
  gap: 22px;
  pointer-events: auto;
}

.cap .links a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: border-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.cap .links a:hover { color: var(--accent); border-bottom-color: var(--ink); }

.cap a { text-decoration: none; border-bottom: 2px solid var(--accent); }
.cap a:hover { color: var(--accent); }

#hum { display: none; }

#mute {
  position: fixed;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(10, 34, 40, 0.82);
  border: 2px solid var(--accent-deep);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), border-color 200ms var(--ease-out);
}
#mute:hover { transform: translateY(-1px); border-color: var(--accent); }
#mute { right: var(--margin); bottom: clamp(24px, 4vh, 40px); }
#mute .ic-off { display: none; }
#mute.muted .ic-on { display: none; }
#mute.muted .ic-off { display: block; }
#mute.muted { color: var(--muted); }


/* ---------- rail ---------- */

.rail {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--accent-deep);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.rail button:hover { border-color: var(--accent); }
.rail button.on { background: var(--accent); border-color: var(--accent); }

/* ---------- hint ---------- */

.hint {
  position: fixed;
  right: calc(var(--margin) + 56px);
  bottom: 34px;
  z-index: 10;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  transition: opacity 600ms var(--ease-out);
}
.hint.off { opacity: 0; pointer-events: none; }

/* ---------- phone ---------- */

@media (max-width: 760px) {
  .enter h1 { font-size: clamp(44px, 13vw, 72px); }
  .enter .tag { font-size: 16px; }
  .cap { right: var(--margin); bottom: clamp(96px, 18vh, 130px); max-width: none; }
  .cap h2 { font-size: 26px; }
  .cap p { font-size: 16px; }
  .rail { right: 14px; }
  .hint { right: 14px; bottom: 18px; }
  #mute { right: 14px; bottom: clamp(52px, 8vh, 76px); }
}

@media (prefers-reduced-motion: reduce) {
  .enter, .cap, #mute, .rail button, .hint { transition: none; }
  .cap { transform: none; }
}

.load { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--bg); transition: opacity .6s ease; }
.load.off { opacity: 0; pointer-events: none; }
.load-inner { display: grid; gap: 14px; justify-items: center; }
.load-name { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .04em; color: var(--ink); }
.load-bar { width: 220px; height: 2px; background: rgba(247,249,248,.14); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.load-pct { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, rgba(247,249,248,.55)); }
