/**
 * Hero World Module — RFDD.org · "Hero World" redesign (INDEX-REDESIGN P2)
 * Ported verbatim from the signed-off design file. Homepage-only (loaded via a
 * <link> in index.php). Design tokens (--neon-*, --line, --bg-panel, --font-mono
 * …) live in main.css :root. Fallback + reduced-motion render a complete hero.
 */

.hero-world { position: relative; width: 100%; height: 100vh; min-height: 560px; overflow: hidden; background: radial-gradient(120% 90% at 50% 110%, #0b1c12 0%, #060d0e 45%, #04070a 100%); }
.hero-world__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: crosshair; }
.hero-world__vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(3, 6, 5, .55) 100%); }
.hero-world__scan { position: absolute; inset: 0; pointer-events: none; opacity: .05; background: repeating-linear-gradient(0deg, transparent 0 2px, #39ff14 2px 3px); }

/* corner brackets — game-HUD frame */
.hero-world__frame { position: absolute; inset: 14px; pointer-events: none; }
.hero-world__frame::before, .hero-world__frame::after,
.hero-world__frame span::before, .hero-world__frame span::after {
  content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid var(--line);
}
.hero-world__frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero-world__frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hero-world__frame span::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hero-world__frame span::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ── top-left: identity ── (top:96px clears the floating pill nav) */
.hero-world__brand { position: absolute; top: 96px; left: 32px; z-index: 5; max-width: 520px; }
.hero-world__eyebrow { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .32em; color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0, 245, 255, .5); text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.hero-world__eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); animation: hw-blink 2.4s infinite; }
@keyframes hw-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.hero-world__title { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 54px); line-height: 1.04; margin-top: 10px; text-shadow: 0 0 28px rgba(57, 255, 20, .35); }
.hero-world__title em { font-style: normal; color: var(--neon-green); }
.hero-world__sub { margin-top: 10px; font-size: clamp(16px, 1.5vw, 18px); color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .55); max-width: 460px; line-height: 1.55; }

/* ── top-right: rank + streak ── */
.hero-world__status { position: absolute; top: 96px; right: 32px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.hero-world__chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); background: var(--bg-panel); backdrop-filter: blur(8px); font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.hero-world__chip--rank { color: var(--neon-green); border-color: rgba(57, 255, 20, .45); text-shadow: 0 0 8px rgba(57, 255, 20, .8); }
.hero-world__chip--streak { color: #ffb454; border-color: rgba(255, 180, 84, .35); }

/* ── bottom-left: telemetry ── */
.hero-world__telemetry { position: absolute; left: 32px; bottom: 30px; z-index: 5; width: min(340px, calc(100% - 64px)); padding: 16px 18px; border: 1px solid var(--line); background: var(--bg-panel); backdrop-filter: blur(10px); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.hero-world__tel-row { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); }
.hero-world__tel-label { font-size: 10px; letter-spacing: .26em; color: var(--text-dim); text-transform: uppercase; }
.hero-world__tel-value { font-size: 22px; font-weight: 700; color: var(--neon-green); text-shadow: 0 0 12px rgba(57, 255, 20, .6); }
.hero-world__tel-value small { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.hero-world__tel-sep { height: 1px; background: var(--line); margin: 10px 0; }
.hero-world__goal-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.hero-world__goal-head b { color: var(--neon-cyan); font-weight: 700; }
.hero-world__bar { height: 9px; border: 1px solid rgba(0, 245, 255, .35); background: rgba(0, 245, 255, .06); position: relative; overflow: hidden; }
.hero-world__bar-fill { position: absolute; inset: 1px auto 1px 1px; width: 0%; background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan) 60%, var(--iris-violet)); box-shadow: 0 0 14px rgba(0, 245, 255, .7); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.hero-world__bar-fill::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-55deg, transparent 0 8px, rgba(255, 255, 255, .16) 8px 12px); animation: hw-flow 1.1s linear infinite; }
@keyframes hw-flow { to { transform: translateX(14px); } }
.hero-world__pulses { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.hero-world__pulses b { color: var(--neon-cyan); font-size: 14px; transition: transform .15s; }
.hero-world__pulses b.hw-pop { transform: scale(1.4); }

/* ── bottom-right: leaderboard + CTAs ── */
.hero-world__social { position: absolute; right: 32px; bottom: 30px; z-index: 5; width: 280px; display: flex; flex-direction: column; gap: 10px; }
.hero-world__board { border: 1px solid var(--line); background: var(--bg-panel); backdrop-filter: blur(10px); padding: 12px 14px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.hero-world__board-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--neon-cyan); margin-bottom: 8px; }
.hero-world__board ol { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.hero-world__board li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; font-family: var(--font-mono); font-size: 12px; }
.hero-world__board li .hw-r { color: var(--text-dim); }
.hero-world__board li .hw-h { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-world__board li .hw-h i { font-style: normal; font-size: 9px; letter-spacing: .12em; color: var(--text-dim); margin-left: 6px; text-transform: uppercase; }
.hero-world__board li .hw-v { color: var(--neon-green); font-weight: 700; }
.hero-world__board li:first-child .hw-h { color: var(--neon-green); }
.hero-world__btns { display: flex; gap: 8px; }
.hero-world__btn { flex: 1; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 12px 10px; cursor: pointer; border: 1px solid; transition: box-shadow .2s, transform .1s; background: var(--bg-panel); backdrop-filter: blur(8px); }
.hero-world__btn:active { transform: translateY(1px); }
.hero-world__btn:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
.hero-world__btn--vs { color: var(--neon-cyan); border-color: rgba(0, 245, 255, .5); }
.hero-world__btn--vs:hover { box-shadow: 0 0 20px rgba(0, 245, 255, .35), inset 0 0 12px rgba(0, 245, 255, .12); }
.hero-world__btn--sponsor { color: var(--neon-green); border-color: rgba(57, 255, 20, .5); }
.hero-world__btn--sponsor:hover { box-shadow: 0 0 20px rgba(57, 255, 20, .35), inset 0 0 12px rgba(57, 255, 20, .12); }

/* ── VS overlay ── */
.hero-world__vs { position: absolute; top: 110px; left: 50%; transform: translateX(-50%) translateY(-16px); z-index: 6; width: min(460px, 86%); padding: 14px 18px; border: 1px solid rgba(0, 245, 255, .4); background: rgba(4, 10, 14, .82); backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s; clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px); }
.hero-world__vs.is-on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.hero-world__vs-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 10px; }
.hero-world__vs-head .hw-you { color: var(--neon-cyan); } .hero-world__vs-head .hw-sean { color: var(--neon-green); }
.hero-world__vs-head .hw-mid { font-family: var(--font-display); font-size: 18px; color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, .5); }
.hero-world__vs-track { height: 10px; position: relative; border: 1px solid rgba(255, 255, 255, .15); margin-bottom: 7px; background: rgba(255, 255, 255, .04); }
.hero-world__vs-fill { position: absolute; inset: 1px auto 1px 1px; width: 0%; }
.hero-world__vs-fill--you { background: linear-gradient(90deg, #007a86, var(--neon-cyan)); box-shadow: 0 0 12px rgba(0, 245, 255, .7); }
.hero-world__vs-fill--sean { background: linear-gradient(90deg, #1a8a0c, var(--neon-green)); box-shadow: 0 0 12px rgba(57, 255, 20, .7); }
.hero-world__vs-result { text-align: center; font-family: var(--font-display); font-size: 16px; letter-spacing: .06em; margin-top: 8px; min-height: 20px; color: #fff; }

/* scroll hint */
.hero-world__hint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 5; font-family: var(--font-mono); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: rgba(232, 255, 233, .35); }

/* fallback (no WebGL) */
.hero-world__fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; padding: 24px; }
.hero-world.is-fallback .hero-world__fallback { display: flex; }

@media (max-width: 1100px) {
  .hero-world__telemetry { width: min(300px, calc(100% - 64px)); padding: 14px 16px; }
  .hero-world__tel-value { font-size: 19px; }
  .hero-world__social { width: 244px; }
  .hero-world__board li { font-size: 11px; }
}
@media (max-width: 760px) {
  /* switch the HUD from pinned overlays to a flowing dock — nothing can overlap */
  .hero-world { display: flex; flex-direction: column; padding: 92px 20px 34px; min-height: 100vh; }
  .hero-world__brand, .hero-world__status, .hero-world__telemetry, .hero-world__social { position: relative; z-index: 5; inset: auto; }
  .hero-world__brand { order: 1; max-width: none; margin-bottom: auto; top: auto; left: auto; }
  .hero-world__sub { display: block; }  /* PATCH-01.2: readable now that it's larger — show on mobile */
  .hero-world__status { order: 2; flex-direction: row; justify-content: flex-start; margin-bottom: 10px; top: auto; right: auto; }
  .hero-world__telemetry { order: 3; width: 100%; margin-bottom: 10px; padding: 12px 14px; left: auto; bottom: auto; }
  .hero-world__tel-value { font-size: 18px; }
  .hero-world__social { order: 4; width: 100%; right: auto; bottom: auto; }
  .hero-world__board { display: none; }
  .hero-world__hint { display: none; }
  .hero-world__vs { top: 88px; }
  .hero-world__frame { inset: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-world__bar-fill::after, .hero-world__eyebrow::before { animation: none; }
}
