/* Opening: PORTFOLIO wordmark → falling i-dot → portal into the portfolio.
   Every moving value below is driven from js/intro.js (single timeline). */

@font-face {
  font-family: "Anton";
  src: url("../fonts/anton-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}

.opening { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; display: none; --impact: 0; --glow: .35; }
html[data-intro="active"] .opening,
html[data-intro="leaving"] .opening { display: block; }
html[data-intro="leaving"] .opening { opacity: 0; transition: opacity 420ms ease; }

.opening__hole { position: absolute; inset: 0; background: #060405; }
html[data-portal="on"] .opening__hole {
  -webkit-mask-image: radial-gradient(circle at var(--hx) var(--hy), transparent var(--hr), #000 calc(var(--hr) + 1.5px));
  mask-image: radial-gradient(circle at var(--hx) var(--hy), transparent var(--hr), #000 calc(var(--hr) + 1.5px));
}

.opening__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 52%, rgba(120, 30, 12, calc(var(--glow) * .55)) 0%, transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 55%, #170a08 0%, #0a0506 48%, #040203 100%);
}
.opening__bg::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 90vw; height: 34vh; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 90, 30, calc(var(--glow) * .5)), transparent);
  filter: blur(30px);
}
.opening__grain {
  position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.opening__lines i { position: absolute; top: 8vh; bottom: 8vh; width: 2px; background: linear-gradient(180deg, transparent, rgba(255, 110, 50, .8) 35%, rgba(255, 80, 30, .35) 70%, transparent); box-shadow: 0 0 14px rgba(255, 90, 30, .55); opacity: .55; }
.opening__lines i:first-child { left: 2.2vw; }
.opening__lines i:last-child { right: 2.2vw; }

.opening__hud { position: absolute; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 clamp(20px, 4.6vw, 64px); font: 500 11px/1 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .22em; color: rgba(255, 175, 135, .5); }
.opening__hud--top { top: 26px; justify-content: flex-start; gap: 28px; }
.opening__hud--bottom { bottom: 26px; }
.opening__hud span:nth-child(2) { color: rgba(255, 140, 90, .85); font-variant-numeric: tabular-nums; }

/* ── wordmark ─────────────────────────────────────────── */
.wm { position: absolute; left: 0; right: 0; top: 50%; margin-top: calc(var(--fs, 200px) * -.52); height: calc(var(--fs, 200px) * 1.04); font-size: var(--fs, 200px); will-change: transform; }
.wm__letters {
  position: relative; display: flex; justify-content: center; white-space: nowrap;
  font: 400 1em/1 "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif; letter-spacing: .012em;
  perspective: 1200px; perspective-origin: 50% 40%;
  -webkit-box-reflect: below -0.015em linear-gradient(180deg, transparent 62%, rgba(255, 200, 150, .16));
  /* One restrained orange glow, nothing else. The previous stack (2px bright halo + 15px glow + 30px black shadow) measurably
     softened the glyph edge (edge transition 3.4px vs 1.5px without it); depth now comes from the crisp extrusion below.
     --gk caps the glow's on-screen radius while the portal scales the wordmark (see setGlowScale in js/intro.js). */
  filter: drop-shadow(0 0 calc(.03em * var(--gk, 1)) rgba(255, 85, 30, calc(.26 + var(--impact) * .5)));
}
/* Each letter = invisible real glyph (keeps the advance width) + crisp hard-stepped extrusion (::before) + chrome fill with a
   rim light (::after). Colours are the existing palette; the fill gets a hard horizon break, the Y2K chrome signature. */
.wm__l {
  --fill: linear-gradient(180deg, #ffe6cc 0%, #ff9a55 14%, #ff6a2b 30%, #e8481c 49.6%, #4a110b 50%, #a92a12 78%, #e8481c 90%, #ff6a2b 100%);
  --extrude:
    0.0025em 0.0025em 0 #a92a12, 0.0050em 0.0050em 0 #a02811, 0.0075em 0.0075em 0 #982610, 0.0100em 0.0100em 0 #8f2310,
    0.0125em 0.0125em 0 #87210f, 0.0150em 0.0150em 0 #7e1f0e, 0.0175em 0.0175em 0 #761d0d, 0.0200em 0.0200em 0 #6d1a0d,
    0.0225em 0.0225em 0 #65180c, 0.0250em 0.0250em 0 #5c160b, 0.0275em 0.0275em 0 #54140a, 0.0300em 0.0300em 0 #4b110a,
    0.0325em 0.0325em 0 #430f09, 0.0350em 0.0350em 0 #3a0d08;
  position: relative; display: inline-block; text-transform: uppercase; opacity: 0; will-change: transform, opacity, filter; transform-origin: 50% 100%;
  color: transparent; -webkit-text-fill-color: transparent;
}
.wm__l::before, .wm__l::after { content: attr(data-c); position: absolute; left: 0; top: 0; white-space: nowrap; }
.wm__l::before { color: #a92a12; -webkit-text-fill-color: #a92a12; text-shadow: var(--extrude); }
.wm__l::after {
  background: var(--fill); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .0018em rgba(255, 226, 190, .42);
}
.wm__i::before, .wm__i::after { content: none; }
.wm__i { background: none; }
.wm__glyph { visibility: hidden; }
.wm__stem {
  position: absolute; background: var(--fill);
  box-shadow: inset 0 0 0 .0018em rgba(255, 226, 190, .42), var(--extrude);
}
.wm__probe { position: absolute; left: 0; bottom: 0; width: 0; height: 0; }
/* technical hairlines framing the word (cap line above, base line below the extrusion); they draw in with the letters */
.wm::before, .wm::after {
  content: ""; position: absolute; left: 4%; right: 4%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 150, 90, .55) 10%, rgba(255, 150, 90, .55) 90%, transparent);
  transform: scaleX(var(--guide, 0));
}
.wm::before { top: var(--y-cap, 0); }
.wm::after { top: var(--y-base, 0); }
.wm__socket { position: absolute; left: 0; top: 0; border-radius: 50%; opacity: 0; border: 1.5px solid rgba(255, 150, 90, .55); box-shadow: 0 0 16px rgba(255, 90, 30, .35), inset 0 0 14px rgba(255, 90, 30, .25); }

/* ── dot + portal parts ─────────────────────────────── */
.dot, .dot-halo, .portal-fx, .flash { position: fixed; left: 0; top: 0; pointer-events: none; opacity: 0; }
.dot {
  border-radius: 50%; transform-origin: 50% 100%; will-change: transform;
  background: radial-gradient(circle at 37% 30%, #fffaf0 0%, #ffd49a 14%, #ff9440 38%, #ee5016 68%, #b82c06 100%);
  box-shadow: 0 0 calc(var(--d, 70px) * .45) calc(var(--d, 70px) * .08) rgba(255, 110, 40, .7), 0 0 calc(var(--d, 70px) * 1.6) calc(var(--d, 70px) * .3) rgba(255, 70, 20, .32);
}
.dot-halo { border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 140, 70, .55), rgba(255, 80, 30, .18) 55%, transparent); mix-blend-mode: screen; }
/* Aperture rim + the two light pulses, drawn as ONE full-screen radial-gradient (js/intro.js sets the stops each frame).
   They used to be three huge elements with box-shadow blurs, re-rasterised every frame at up to ~2900px: ~45ms of GPU per
   frame late in the portal. A gradient is evaluated analytically, so the same rim + glow now costs next to nothing. */
.portal-fx { inset: 0; width: auto; height: auto; }
.flash { inset: 0; width: auto; height: auto; background: radial-gradient(circle at var(--hx, 50%) var(--hy, 40%), rgba(255, 240, 220, .95) 0%, rgba(255, 150, 80, .55) 22%, rgba(255, 70, 20, .16) 55%, transparent 75%); mix-blend-mode: screen; }

/* ── reduced motion: composed still, no motion ───────── */
@media (prefers-reduced-motion: reduce) {
  html[data-intro="leaving"] .opening { transition-duration: 1ms; }
}

@media (max-width: 960px) { .opening__hud--bottom { bottom: 76px; } }
@media (max-width: 640px) {
  .opening__hud { font-size: 9px; letter-spacing: .16em; }
  .opening__hud--top span:nth-child(3) { display: none; }
}

/* First-frame ignition (2026-10-28): a point of ember light at the centre stretches into the line the letters rise from, instead of an empty
   dark frame. The HUD fades in with it. Both are driven by the opening clock (js/intro.js); nothing here animates on its own. */
.opening__ignite { position: absolute; left: 50%; top: 50%; width: min(64vw, 900px); height: 2px; margin: -1px 0 0 calc(min(64vw, 900px) / -2); border-radius: 2px; opacity: 0; transform: scaleX(.04); pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 170, 110, 0), rgba(255, 190, 130, .55) 14%, rgba(255, 230, 195, .98) 50%, rgba(255, 190, 130, .55) 86%, rgba(255, 170, 110, 0));
  box-shadow: 0 0 22px 3px rgba(255, 100, 40, .5), 0 0 70px 10px rgba(255, 70, 20, .22); will-change: transform, opacity; }
.opening__hud { opacity: var(--hudA, 1); }
@media (prefers-reduced-motion: reduce) { .opening__ignite { display: none; } }
