/* ==========================================================================
   JoJoeKing — King of Curses
   Palette: void #050505 / #0a0a0b · blood #c1121f → ember #ff1f2d · bone #e9e4da

   Type: Shippori Mincho B1 700 is the one display face: the name, the
   呪いの王 accent and the 領域展開 overlay. A Japanese mincho whose Latin was
   drawn to sit beside kanji: brush-born wedge serifs, sharp hairlines and
   steady, heavy stems, so the name and the kanji read as one hand. It is
   wide (≈5.15em for "JoJoeKing"), so it is set smaller than a Didone would
   be and tracked slightly in. Subset to exactly the glyphs used (see the
   &text= list in index.html). Inter for the small tracked labels.
   ========================================================================== */

:root {
  --void: #050505;
  --void-2: #0a0a0b;
  --blood: #c1121f;
  --ember: #ff1f2d;
  --bone: #e9e4da;
  --bone-88: rgba(233, 228, 218, .88);
  --bone-15: rgba(233, 228, 218, .15);

  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  --safe-t: max(16px, env(safe-area-inset-top));
  --safe-b: max(16px, env(safe-area-inset-bottom));

  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-cut: cubic-bezier(.7, 0, .2, 1);

  color-scheme: dark;
}

/* ---------- Base ---------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--void);
  color: var(--bone);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  /* No pull-to-refresh / rubber-band when dragging the King on phones. */
  overscroll-behavior-y: none;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--void);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--blood); color: var(--bone); }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layers: scene · vignette · content · grain · intro ----------- */

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: auto;
  /* Long-press target ("Domain Expansion", ui.js): no iOS callout or selection. */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
html.has-scene #scene { opacity: 1; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 85% at 50% 40%, rgba(5, 5, 5, 0) 55%, rgba(5, 5, 5, .72) 100%),
    linear-gradient(180deg, rgba(5, 5, 5, 0) 55%, rgba(5, 5, 5, .38) 82%, rgba(5, 5, 5, .7) 100%);
}

/* Film grain: sparse white specks (alpha noise), not a grey haze, so blacks stay deep. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 2.2 -1.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Pre-JS gate (class set by the inline head script). Lifts itself after 3.2s
   even if no module ever runs, so the page can never stay black. */
html.intro-pending body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--void);
  pointer-events: none;
  animation: gate-failsafe .5s ease 3.2s forwards;
}
@keyframes gate-failsafe { to { opacity: 0; visibility: hidden; } }

/* While anything covers the content (pre-JS gate, intro overlay) and for the
   ~0.5s settle after a skip, the hidden links and name take no hits. A tap
   that skips the intro lifts its finger after the overlay is gone, and its
   click must not land on an invisible Instagram/TikTok/X link underneath.
   Keyboard focus is unaffected. */
html.intro-pending .kanji,
html.intro-pending .name,
html.intro-pending .social,
html.is-intro:not(.is-revealed) .kanji,
html.is-intro:not(.is-revealed) .name,
html.is-intro:not(.is-revealed) .social,
html.intro-fast .kanji,
html.intro-fast .name,
html.intro-fast .social { pointer-events: none; }

/* ---------- Hero layout --------------------------------------------------- */

.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Exactly one screen: the stage below gives up height before the page
     would ever scroll (short laptop windows, landscape phones). */
  height: 100vh;
  height: 100svh;
  --hero-pad-b: calc(var(--safe-b) + 1.25rem);
  padding: var(--safe-t) var(--gutter-r) var(--hero-pad-b) var(--gutter-l);
  pointer-events: none; /* let the canvas receive pointer events in empty space */
}

/* Reserved for the 3D piece: scene.js measures this box and keeps the piece
   and its pool reflection inside it (default framing ends ~52%, so 56svh +
   the top inset leaves a clear band above the kanji). Shrinks (down to
   min-height) only when the type would otherwise push the page past 100svh. */
.hero__stage {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  height: 56vh;
  height: 56svh;
  min-height: 40vh;
  min-height: 40svh;
}

.hero__content {
  position: relative;
  flex: none;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 44rem;
  text-align: center;
}

/* Soft local scrim so the type always reads over the fog. */
.hero__content::before {
  content: "";
  position: absolute;
  inset: -14% 0 -18%;
  /* Never reach past the hero's bottom padding: that would make the page
     scroll by a few px on short screens. */
  bottom: max(-18%, -1 * var(--hero-pad-b));
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 5, 5, .62), rgba(5, 5, 5, .28) 60%, rgba(5, 5, 5, 0));
}

/* ---------- Kanji accent -------------------------------------------------- */

.kanji {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  margin: 0 0 clamp(.6rem, 1.6vh, 1rem);
  font-family: var(--display);
  font-weight: 700;
  /* 15px on phones: 呪 (eight strokes) stays open at this weight. */
  font-size: clamp(.9375rem, .86rem + .3vw, 1.0625rem);
  line-height: 1;
  letter-spacing: .5em;
  /* Ember, not blood, for the glyphs: ~5.3:1 on the void (blood is ~3.3:1).
     No glow: crisp strokes read better at this size. */
  color: var(--ember);
  pointer-events: auto;
}
.kanji > span { margin-right: -.5em; } /* cancel trailing tracking: optically centred */
.kanji::before,
.kanji::after {
  content: "";
  flex: none;
  width: clamp(1.25rem, 6vw, 2.5rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(193, 18, 31, 0), rgba(193, 18, 31, .6));
}
.kanji::after { transform: scaleX(-1); }

/* ---------- Name ---------------------------------------------------------- */

.name {
  position: relative;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  /* Pull the line box in to the ink (cap top ≈ .19em below the box top,
     baseline ≈ .93em) so the kanji and links sit at optical distances.
     Less at the bottom: g and J descend ~.2em and must clear the links. */
  margin: -.07em auto -.05em;
  font-family: var(--display);
  font-weight: 700;
  font-style: normal;
  /* 15.5vw: 288px wide at 375, 246px at 320 (of 288px between the gutters). */
  font-size: clamp(2.5rem, 15.5vw, 7rem);
  font-size: clamp(2.5rem, min(15.5vw, 13.5vh), 7rem);
  font-size: clamp(2.5rem, min(15.5vw, 13.5svh), 7rem);
  /* Line box taller than the ink (cap .74em, descender .2em) so J and g stay
     inside the gradient-clipped box. */
  line-height: 1.2;
  /* Text-sized spacing, tightened for display: the heavy stems need less air. */
  letter-spacing: -.018em;
  /* Shippori Mincho B1 has no kerning table, so ui.js kerns the loose pairs
     (o|J, e|K, K|i) by hand with per-letter margins, on the name, its cleave
     halves and the intro's split letters alike (KERN in ui.js). font-kerning
     stays on for the fallback faces, which do have pairs. */
  font-kerning: normal;
  font-variant-ligatures: none;
  font-synthesis: none;
  white-space: nowrap;
  cursor: default;
  pointer-events: auto;
}

/* Bone ink with a very subtle top-to-bottom tone. Horizontal padding keeps
   overhanging glyph parts (J, K) inside the painted background box. */
.name__ink,
.name .ch {
  display: block;
  padding: 0 .1em;
  margin: 0 -.1em;
  background-image: linear-gradient(180deg, #f8f5ef 22%, #e9e4da 52%, #b4ac9f 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.name .ch { display: inline-block; }
.name__base.is-split { background: none; }

/* "Cleave" layers (created by ui.js): two copies cut along one diagonal. */
.name__half {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -.1em;
  right: -.1em;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.name__half--a {
  -webkit-clip-path: polygon(-10% -60%, 110% -60%, 110% 24%, -10% 88%);
  clip-path: polygon(-10% -60%, 110% -60%, 110% 24%, -10% 88%);
}
.name__half--b {
  -webkit-clip-path: polygon(-10% 88%, 110% 24%, 110% 160%, -10% 160%);
  clip-path: polygon(-10% 88%, 110% 24%, 110% 160%, -10% 160%);
}
.name__cut {
  position: absolute;
  top: 0;
  left: -.1em;
  width: calc(100% + .2em);
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(255, 31, 45, .95)) drop-shadow(0 0 9px rgba(193, 18, 31, .55));
}

.name.is-cleaving .name__base { opacity: 0; }
.name.is-cleaving .name__half { opacity: 1; }
.name.is-cleaving .name__half--a { animation: cleave-a 640ms both; }
.name.is-cleaving .name__half--b { animation: cleave-b 640ms both; }
.name.is-cleaving .name__cut { animation: cleave-cut 640ms both; }

/* Halves slide a few px along the cut, hold, then snap back. */
@keyframes cleave-a {
  0%        { transform: translate3d(0, 0, 0); animation-timing-function: cubic-bezier(.2, .9, .25, 1); }
  14%       { transform: translate3d(.07em, -.03em, 0); animation-timing-function: linear; }
  50%       { transform: translate3d(.078em, -.034em, 0); animation-timing-function: cubic-bezier(.55, 0, .85, .35); }
  66%, 100% { transform: translate3d(0, 0, 0); }
}
@keyframes cleave-b {
  0%        { transform: translate3d(0, 0, 0); animation-timing-function: cubic-bezier(.2, .9, .25, 1); }
  14%       { transform: translate3d(-.07em, .03em, 0); animation-timing-function: linear; }
  50%       { transform: translate3d(-.078em, .034em, 0); animation-timing-function: cubic-bezier(.55, 0, .85, .35); }
  66%, 100% { transform: translate3d(0, 0, 0); }
}
@keyframes cleave-cut {
  0% {
    opacity: 1;
    -webkit-clip-path: inset(-60% 115% -60% -15%);
    clip-path: inset(-60% 115% -60% -15%);
    animation-timing-function: cubic-bezier(.7, 0, .2, 1);
  }
  16%, 42% {
    opacity: 1;
    -webkit-clip-path: inset(-60% -15% -60% -15%);
    clip-path: inset(-60% -15% -60% -15%);
  }
  100% {
    opacity: 0;
    -webkit-clip-path: inset(-60% -15% -60% -15%);
    clip-path: inset(-60% -15% -60% -15%);
  }
}
@keyframes cleave-cut-still {
  0%, 100% { opacity: 0; }
  20%      { opacity: 1; }
}

/* ---------- Social links -------------------------------------------------- */

/* Three equal tiles at every width. Phones: icon over label (below). */
.socials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 30rem);
  margin-top: clamp(1.5rem, 4.2vh, 2.5rem);
}

.social {
  --i: 0;
  --nudge-label: translate3d(3px, 0, 0);
  --nudge-icon: translate3d(-1px, 0, 0);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 44px;
  padding: 0 .85rem;
  overflow: hidden;
  border: 1px solid var(--bone-15);
  border-radius: 0;
  background-color: rgba(10, 10, 11, .88); /* solid fallback, no backdrop-filter */
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .6875rem;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.social:nth-child(2) { --i: 1; }
.social:nth-child(3) { --i: 2; }

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .social {
    background-color: rgba(10, 10, 11, .4);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    backdrop-filter: blur(12px) saturate(1.15);
  }
}

html.is-ready .social {
  transition: border-color .35s ease, background-color .35s ease;
}

.social__icon {
  flex: none;
  width: 15px;
  height: 15px;
  opacity: .9;
  transition: opacity .3s ease, transform .45s var(--ease-out);
}
.social__icon--x { width: 13px; height: 13px; }

.social__label {
  display: block;
  margin-right: -.2em; /* cancel trailing tracking */
  transition: transform .4s var(--ease-out);
}

/* The sweeping slash: a 1px diagonal hairline carried across the button. */
.social__cut {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-80%);
}
.social__cut::before {
  content: "";
  position: absolute;
  top: -45%;
  left: 50%;
  width: 1px;
  height: 190%;
  background: linear-gradient(180deg, rgba(255, 31, 45, 0) 8%, var(--ember) 32%, #ffb3b6 50%, var(--ember) 68%, rgba(255, 31, 45, 0) 92%);
  transform: rotate(30deg);
  filter: drop-shadow(0 0 3px rgba(255, 31, 45, .85));
}

@keyframes social-cleave {
  0%   { opacity: 0; transform: translateX(-80%); }
  14%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(80%); }
}

/* Hover (fine pointers), keyboard focus, and touch taps share one look. */
@media (hover: hover) {
  .social:hover {
    border-color: rgba(255, 31, 45, .72);
    background-color: rgba(26, 6, 8, .5);
  }
  .social:hover .social__cut { animation: social-cleave 560ms var(--ease-cut) both; }
  .social:hover .social__label { transform: var(--nudge-label); transition-delay: .12s; }
  .social:hover .social__icon { opacity: 1; transform: var(--nudge-icon); }
}
.social:focus-visible,
.social.is-tapped {
  border-color: rgba(255, 31, 45, .72);
  background-color: rgba(26, 6, 8, .5);
}
.social:focus-visible .social__cut,
.social.is-tapped .social__cut { animation: social-cleave 560ms var(--ease-cut) both; }
.social:focus-visible .social__label,
.social.is-tapped .social__label { transform: var(--nudge-label); transition-delay: .12s; }
.social:focus-visible .social__icon,
.social.is-tapped .social__icon { opacity: 1; transform: var(--nudge-icon); }

.social:focus { outline: none; }
.social:focus-visible {
  outline: 1px solid var(--ember);
  outline-offset: 3px;
}

/* ---------- Intro "Dismantle" (overlay is created by ui.js) --------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  contain: layout paint;
  pointer-events: auto;
}
.intro__half {
  position: absolute;
  top: -25%;
  left: -25%;
  width: 150%;
  height: 150%;
  background: var(--void);
  will-change: transform;
}
.intro__flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(70% 45% at 50% 49%, rgba(255, 31, 45, .14), rgba(255, 31, 45, 0) 70%);
}
.intro__slash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Content states while the intro runs. */
html.is-intro .kanji,
html.is-intro .name .ch,
html.is-intro .social { opacity: 0; }
html.is-intro .kanji { transform: translate3d(0, .5rem, 0); }
html.is-intro .name .ch { transform: translate3d(0, .22em, 0); will-change: transform, opacity; }
html.is-intro .social { transform: translate3d(0, .5rem, 0); }

html.is-revealed .kanji,
html.is-revealed .name .ch,
html.is-revealed .social { opacity: 1; transform: none; }

html.is-revealed .kanji {
  transition: opacity .6s ease .25s, transform .9s var(--ease-out) .25s;
}
html.is-revealed .name .ch {
  transition:
    opacity .55s ease calc(.32s + var(--i, 0) * 36ms),
    transform 1s var(--ease-out) calc(.32s + var(--i, 0) * 36ms);
}
html.is-revealed .social {
  transition:
    opacity .5s ease calc(.64s + var(--i) * 70ms),
    transform .8s var(--ease-out) calc(.64s + var(--i) * 70ms),
    border-color .35s ease,
    background-color .35s ease;
}

/* Skipped intro: same states, quick and without stagger. */
html.intro-fast.is-revealed .kanji,
html.intro-fast.is-revealed .name .ch,
html.intro-fast.is-revealed .social {
  transition: opacity .35s ease, transform .45s var(--ease-out);
}

/* ---------- Long-press cue (created by ui.js) ----------------------------- */

/* A hairline ring around the finger that fills over the hold, so the press
   reads as deliberate. Centred on the touch point by a transform. */
.press-ring {
  --ring: 64px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 26;
  width: var(--ring);
  height: var(--ring);
  margin: calc(var(--ring) / -2) 0 0 calc(var(--ring) / -2);
  opacity: 0;
  pointer-events: none;
}
.press-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg); /* the arc starts at 12 o'clock */
}
.press-ring circle { fill: none; vector-effect: non-scaling-stroke; }
.press-ring__track { stroke: rgba(233, 228, 218, .16); stroke-width: 1; }
.press-ring__arc {
  stroke: var(--ember);
  stroke-width: 1.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(255, 31, 45, .85));
}

/* While a press is held, nothing on the page starts a selection or callout. */
html.is-holding body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- Easter egg "Domain Expansion" (overlay is created by ui.js) --- */

/* Above the type (the slashes cut across it), below the grain. Purely
   decorative: never takes a hit, never holds focus. */
.domain {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}
/* The red wash sits under the type (above the vignette, same z-index, later
   in the DOM), so the name and links stay bone while the world turns red.
   Over the 3D flood it only warms the vignette's black edges. */
.domain-wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(120% 85% at 50% var(--domain-y, 40%), rgba(193, 18, 31, 0) 40%, rgba(150, 10, 20, .3) 100%);
}
html.no-webgl .domain-wash,
html:not(.has-scene) .domain-wash {
  /* No 3D flood behind it: the wash carries the red alone. */
  background: radial-gradient(110% 80% at 50% var(--domain-y, 40%), rgba(193, 18, 31, .42), rgba(120, 8, 16, .34) 50%, rgba(50, 2, 6, .6) 100%);
}
.domain__line {
  position: absolute;
  top: var(--domain-y, 40%);
  left: 0;
  width: 100%;
  height: 1px;
  margin-top: -.5px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 31, 45, 0), var(--ember) 16%, #ffe1e2 50%, var(--ember) 84%, rgba(255, 31, 45, 0));
  box-shadow: 0 0 12px 1px rgba(255, 31, 45, .6);
  transform: scaleX(0);
}
.domain__slashes {
  position: absolute;
  inset: 0;
}
/* One cut: a 1.5px hairline that ui.js places, rotates and draws by scaleX
   from its left end (transform and opacity only: compositor work). */
.domain__slash {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.5px;
  margin-top: -.75px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(255, 31, 45, 0), var(--ember) 20%, #ffe1e2 50%, var(--blood) 80%, rgba(193, 18, 31, 0));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
/* Its glow, thinning out towards both ends; painted once with the cut. */
.domain__slash::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 8px;
  margin-top: -4px;
  background: radial-gradient(closest-side, rgba(255, 31, 45, .3), rgba(255, 31, 45, 0));
}
/* 領域展開, set vertically beside the piece: an accent, smaller than the
   name and shorter than the piece. Bone on the red flood, separated from it
   by a dark halo rather than a neon rim; the bloom-in carries the energy.
   ui.js sets its top so the column stays on screen. */
.domain__kanji {
  position: absolute;
  top: var(--domain-y, 40%);
  left: calc(50% + clamp(5.5rem, 22vw, 18rem));
  margin: 0;
  -webkit-writing-mode: vertical-rl;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 7.5vh, 5rem);
  font-size: clamp(2.5rem, min(13vw, 7.5svh), 5rem);
  line-height: 1;
  letter-spacing: .16em;
  white-space: nowrap;
  color: var(--bone-88);
  text-shadow: 0 0 .45em rgba(90, 4, 10, .7);
  opacity: 0;
  transform: translate3d(0, -50%, 0);
}

/* ---------- No-WebGL fallback: static glow + one closed cut -------------- */

html.no-webgl #scene { display: none; }
html.no-webgl .vignette {
  background:
    radial-gradient(70% 42% at 50% 38%, rgba(193, 18, 31, .2), rgba(120, 8, 16, .07) 45%, rgba(5, 5, 5, 0) 72%),
    radial-gradient(120% 85% at 50% 40%, rgba(5, 5, 5, 0) 55%, rgba(5, 5, 5, .72) 100%);
}
html.no-webgl .hero__stage::after {
  content: "";
  position: absolute;
  top: 70%;
  left: 50%;
  width: min(72vw, 26rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(193, 18, 31, 0), var(--blood) 28%, #ff7a82 50%, var(--blood) 72%, rgba(193, 18, 31, 0));
  transform: translate(-50%, -50%) rotate(-28deg);
  filter: drop-shadow(0 0 6px rgba(255, 31, 45, .7));
  animation: ember-breathe 5s ease-in-out infinite;
}
@keyframes ember-breathe {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}

/* ---------- Responsive ---------------------------------------------------- */

/* Phones: equal tiles with the icon over the label, so "Instagram" and "X"
   get the same footprint (104px each at 360px wide). */
@media (max-width: 479.98px) {
  .social {
    --nudge-label: none;
    --nudge-icon: translate3d(0, -1px, 0);
    flex-direction: column;
    gap: .5rem;
    min-height: 64px;
    padding: .7rem .25rem;
    letter-spacing: .16em;
  }
  .social__label { margin-right: -.16em; }
  .social__icon--x { margin-block: 1px; } /* same 15px icon box as the others: labels align */
}

/* Very narrow phones (< 360px): keep "INSTAGRAM" inside its tile. */
@media (max-width: 359.98px) {
  .socials { gap: 6px; }
  .social { font-size: .625rem; letter-spacing: .14em; }
  .social__label { margin-right: -.14em; }
}

/* Wider screens: icon beside label in three equal columns. */
@media (min-width: 480px) {
  .socials { gap: 10px; }
}

@media (min-width: 768px) {
  .social { min-height: 48px; font-size: .72rem; }
  .hero__stage { height: 57vh; height: 57svh; }
}

/* Short landscape phones / short windows: tighter type so the text still
   starts below the piece's pool line instead of over the piece. */
@media (orientation: landscape) and (max-height: 540px) {
  .hero { --hero-pad-b: var(--safe-b); }
  .hero__stage { min-height: 30vh; min-height: 30svh; }
  .kanji { margin-bottom: .45rem; }
  .name {
    font-size: clamp(2rem, 11.5vh, 7rem);
    font-size: clamp(2rem, min(15.5vw, 11.5svh), 7rem);
  }
  .socials { margin-top: 1rem; } /* clear of the g and J tails */
}

@media (hover: none) {
  .name {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

/* ---------- ?og: still render for the 1200×630 share image --------------- */

/* Set by the head script for ?og. Everything is shown in its final state at
   once (no intro, no transitions), composed as a centred banner: the piece
   over the kanji and the name, sized to read at preview thumbnail sizes
   (~300px wide). No links: at that size they are noise, and og:description
   already lists them. The centred stack survives the square crops some apps
   make of the preview (the name stays inside the middle 630px). */
html.og-mode *,
html.og-mode *::before,
html.og-mode *::after {
  transition: none !important;
  animation: none !important;
}
/* No grain on the still: previews are downscaled and re-encoded, where it only
   turns to mush, and it bloats the file (og.jpg must stay well under 300 KB:
   WhatsApp drops larger previews). */
html.og-mode .grain { display: none; }
html.og-mode .hero {
  --hero-pad-b: 24px;
  padding-top: 28px;
}
/* The scene fills this box with the piece and its reflection (stillMode). */
html.og-mode .hero__stage { flex: none; height: 60vh; min-height: 0; }
html.og-mode .kanji { margin: 10px 0 12px; font-size: 24px; }
html.og-mode .name { font-size: 116px; }
html.og-mode .socials { display: none; }

/* ---------- Reduced motion ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  #scene { transition: none; }
  .social__cut { display: none; }
  .social__label,
  .social__icon { transition: opacity .2s ease; transform: none !important; }
  .name.is-cleaving .name__base { opacity: 1; }
  .name.is-cleaving .name__half { opacity: 0; animation: none; }
  .name.is-cleaving .name__cut {
    -webkit-clip-path: none;
    clip-path: none;
    animation: cleave-cut-still 700ms ease both;
  }
  html.no-webgl .hero__stage::after { animation: none; }
  html.intro-pending body::after { animation-duration: .01s; }
}
