/* galuh.dev: one fixed screen. Layers, back to front:
   .gp-words (giant type) < .gp-stage (transparent WebGL) < .gp-veil < .gp-ui */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07090a;
  --fg: #eceee9;
  --soft: #cdd3d0;
  --muted: #98a4a8;
  --line: #1f282d;
  --acc: #ffb23f;
  --acc-ink: #160f03;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 48px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); }

#gp-root {
  --prog: 0;
  position: fixed; inset: 0; overflow: hidden;
  background: var(--bg); color: var(--fg);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
#gp-root a { color: var(--fg); }
#gp-root a:hover { color: var(--acc); }
#gp-root a:focus-visible, #gp-root button:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
#gp-root p, #gp-root h2 { margin: 0; }

.gp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gp-mono { font-family: var(--mono); }
.gp-acc { color: var(--acc); }

/* ---------- layer 0: giant words behind the 3D scene ---------- */
.gp-words { position: absolute; inset: 0; z-index: 0; }
.gp-word {
  position: absolute; left: 0; right: 0; text-align: center; white-space: nowrap;
  font-weight: 800; letter-spacing: -0.06em; line-height: 0.84;
  pointer-events: none; user-select: none;
  opacity: 0; transform: translate3d(0, 7%, 0) scale(1.05);
  transition: opacity 0.45s, transform 1.2s var(--ease);
}
.gp-w1 { top: 7%; font-size: clamp(72px, 21vw, 330px); color: #e9ece6; }
.gp-w2 { top: 5%; font-size: clamp(56px, 16vw, 250px); color: #e9ece6; }
.gp-w3 { top: 9%; font-size: clamp(44px, 11.4vw, 180px); color: #e9ece6; }
#gp-root[data-ch="1"] .gp-w1,
#gp-root[data-ch="2"] .gp-w2,
#gp-root[data-ch="3"] .gp-w3 { opacity: 1; transform: none; transition-delay: 1.2s; }

/* The name as plain type: it is on screen from the first paint, in the place where the
   particles will form, and fades out as they arrive. Without WebGL it stays. */
.gp-name {
  position: absolute; left: 50%; top: calc(35.5vh - 14.5vw); margin: 0; transform: translateX(-50%);
  font-size: 16.5vw; font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; white-space: nowrap;
  color: #e9ece6; pointer-events: none; user-select: none;
  transition: opacity 0.9s 0.6s, filter 0.9s 0.6s;
}
@media (max-aspect-ratio: 3/2) { .gp-name { top: calc(50vh - 25.1vw); font-size: 17.5vw; } }
#gp-root[data-live] .gp-name { opacity: 0; filter: blur(8px); }
#gp-root:not([data-ch="0"]) .gp-name { opacity: 0; transition-delay: 0s; }
#gp-root[data-nogl][data-ch="0"] .gp-name { opacity: 1; filter: none; }

/* ---------- layer 1 and 2 ---------- */
.gp-stage { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gp-veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(7, 9, 10, 0) 52%, rgba(7, 9, 10, 0.72) 100%),
    linear-gradient(to top, rgba(7, 9, 10, 0.92) 0, rgba(7, 9, 10, 0) 190px);
}

/* ---------- layer 3: interface ---------- */
.gp-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.gp-top {
  position: absolute; top: 0; left: 0; right: 0; height: 72px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  pointer-events: auto;
}
.gp-brand { font-size: 14px; font-weight: 500; text-decoration: none; }
.gp-links { display: flex; gap: 24px; font-size: 14.5px; }
.gp-links a { text-decoration: none; }

.gp-panel {
  position: absolute; display: flex; flex-direction: column; gap: 12px;
  width: 420px; max-width: calc(100% - 2 * var(--gutter));
  opacity: 0; visibility: hidden; transform: translate3d(0, 26px, 0);
  transition: opacity 0.3s, transform 0.3s, visibility 0s 0.3s;
  pointer-events: auto;
}
#gp-root[data-ch="0"] .gp-p0,
#gp-root[data-ch="1"] .gp-p1,
#gp-root[data-ch="2"] .gp-p2,
#gp-root[data-ch="3"] .gp-p3,
#gp-root[data-ch="4"] .gp-p4 {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.7s 1.35s, transform 0.95s var(--ease) 1.35s, visibility 0s 1.35s;
}
.gp-l { left: var(--gutter); bottom: 112px; }
.gp-r { right: var(--gutter); bottom: 112px; }
.gp-c { left: 50%; bottom: 112px; width: 720px; margin-left: -360px; align-items: center; text-align: center; }
/* A caption is plain type on the scene. A soft dark patch behind it keeps the words readable. */
.gp-caption { width: 350px; }
.gp-caption::before {
  content: ""; position: absolute; inset: -70px -90px -60px -80px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(7, 9, 10, 0.94) 45%, rgba(7, 9, 10, 0.7) 72%, rgba(7, 9, 10, 0));
}
.gp-caption h2 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.gp-caption p { color: var(--soft); }
.gp-caption .gp-tag { font-size: 17px; }
.gp-caption .gp-stack { font-size: 13px; color: var(--muted); margin-top: 10px; }
/* the longer description opens on hover, on focus, or with the About button */
.gp-more { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -12px; transition: grid-template-rows 0.45s var(--ease), opacity 0.3s, margin-top 0.45s var(--ease); }
.gp-more > div { min-height: 0; overflow: hidden; }
.gp-more p:first-child { font-size: 15px; }
.gp-caption.is-open .gp-more { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
@media (hover: hover) {
  .gp-caption:hover .gp-more { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
}
.gp-info {
  height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 500 14px var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 4px;
}
.gp-info:hover { color: var(--fg); }
@media (hover: hover) { .gp-info { display: none; } }
.gp-lede { font-size: 21px; line-height: 1.45; color: var(--soft); }
.gp-row { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.gp-hint { font-size: 13px; color: var(--muted); }
.gp-ask { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.gp-mail { font-size: 24px; overflow-wrap: anywhere; }
#gp-root .gp-mail a { color: var(--acc); text-decoration: none; }
#gp-root .gp-mail a:hover { text-decoration: underline; }
.gp-day { font-size: 14.5px; color: var(--muted); max-width: 56ch; }

.gp-go {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; font: 600 15px var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.35s var(--ease), background-color 0.25s, color 0.25s;
}
.gp-go svg, .gp-step svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gp-go svg { transition: transform 0.35s var(--ease); }
.gp-go:hover svg { transform: translate(3px, -3px); }
.gp-go:active { transform: scale(0.97); }
#gp-root .gp-solid, #gp-root .gp-solid:hover { background: var(--acc); color: var(--acc-ink); }
#gp-root .gp-line { border: 1px solid #35424a; }

/* pinfall score */
.gp-score {
  position: absolute; top: 44%; right: var(--gutter);
  font-size: clamp(40px, 7vw, 104px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--acc);
  opacity: 0; transform: translate3d(0, -12px, 0);
  transition: opacity 0.25s, transform 0.5s var(--ease);
  pointer-events: none;
}
.gp-score[data-on] { opacity: 1; transform: none; }
#gp-root:not([data-ch="1"]) .gp-score { opacity: 0; }

/* portwatch signal labels, placed from 3D positions */
.gp-label {
  position: absolute; left: 0; top: 0; padding: 4px 9px; border-radius: 999px;
  background: rgba(7, 9, 10, 0.85); border: 1px solid var(--acc); color: var(--acc);
  font-size: 13px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; will-change: transform;
}
.gp-label-hover { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); transition: opacity 0.15s; }

/* the rail: one tick for each screen */
.gp-rail {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: stretch; gap: 10px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  pointer-events: auto;
}
.gp-step {
  flex: none; width: 44px; height: 44px; margin-top: 10px; border-radius: 50%;
  border: 1px solid #2c363b; background: rgba(7, 9, 10, 0.6); color: var(--fg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.gp-step:hover { border-color: var(--acc); color: var(--acc); }
.gp-tick {
  flex: 1 1 0; min-width: 0; min-height: 54px; padding: 10px 0 0;
  display: flex; flex-direction: column; gap: 10px;
  border: 0; background: none; color: var(--muted); cursor: pointer; text-align: left;
  font: 500 14px var(--sans);
  transition: color 0.25s;
}
.gp-tick:hover { color: var(--fg); }
.gp-tick[aria-current] { color: var(--acc); }
.gp-bar { display: block; height: 3px; border-radius: 2px; background: #232c31; overflow: hidden; }
.gp-fill { display: block; height: 100%; background: var(--acc); transform: scaleX(0); transform-origin: 0 50%; }
.gp-tick[aria-current] .gp-fill { transform: scaleX(var(--prog)); }
.gp-tl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .gp-panel { left: 16px; right: 16px; bottom: 96px; width: auto; max-width: none; margin-left: 0; }
  .gp-caption { gap: 10px; }
  .gp-caption::before { inset: -56px -16px -24px -16px; background: linear-gradient(to top, rgba(7, 9, 10, 0.92) 55%, rgba(7, 9, 10, 0)); }
  .gp-caption h2 { font-size: 28px; }
  .gp-more { margin-top: -10px; }
  .gp-tick .gp-tl { display: none; }
  .gp-tick[aria-current] { flex-grow: 3; }
  .gp-tick[aria-current] .gp-tl { display: block; }
  .gp-lede { font-size: 19px; }
  .gp-ask { font-size: 24px; }
  .gp-mail { font-size: 18px; }
  .gp-rail { gap: 6px; }
  .gp-step, .gp-p0 .gp-hint { display: none; }
  .gp-score { top: 34%; }
  .gp-w1 { top: 12%; }
  .gp-w2 { top: 11%; }
  .gp-w3 { top: 16%; }
}

@media (prefers-reduced-motion: reduce) {
  .gp-word, .gp-name, .gp-panel, .gp-more, .gp-go, .gp-go svg, .gp-score { transition: none !important; }
}
