/* ============================================================
   Jazriel — Phantom-style menu
   ============================================================ */
:root {
  --red: #e3001b;
  --red-dark: #9c0012;
  --pink: #ff2e63;
  --black: #0c0c0c;
  --white: #f6f3ec;
  --yellow: #ffe14d;
  --font-head: "Anton", "Impact", sans-serif;
  --font-body: "Archivo", "Segoe UI", sans-serif;
  --ease-pop: cubic-bezier(.2, 1.6, .4, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  overflow: hidden;
  user-select: none;
}

/* ============ BACKGROUND ============ */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }

.bg-dots {
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,.28) 1.6px, transparent 1.8px) 0 0 / 11px 11px;
  -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 55%, #000 100%);
          mask-image: linear-gradient(115deg, #000 0%, transparent 55%, #000 100%);
}

.shard { position: absolute; background: var(--black); }
.shard-a { inset: 0; clip-path: polygon(0 0, 38% 0, 22% 100%, 0 100%); }
.shard-b { inset: 0; background: var(--red-dark); clip-path: polygon(38% 0, 41% 0, 25% 100%, 22% 100%); }
.shard-c { inset: 0; clip-path: polygon(78% 100%, 100% 55%, 100% 100%); }

.big-star {
  position: absolute; right: -12vmin; top: -14vmin;
  width: 70vmin; height: 70vmin;
  fill: none; stroke: var(--black); stroke-width: 2.2; stroke-linejoin: miter;
  opacity: .55;
  animation: spin 60s linear infinite;
}

.strip {
  position: absolute; left: -10%; width: 120%;
  background: var(--white); color: var(--black);
  font-family: var(--font-head); font-size: clamp(18px, 2.4vw, 30px); letter-spacing: .12em;
  white-space: nowrap; overflow: hidden; padding: 4px 0;
}
.strip-1 { bottom: 14%; transform: rotate(-7deg); }
.strip-2 { bottom: 4%; transform: rotate(-7deg); background: var(--black); color: var(--red); }
.strip-track { display: inline-flex; animation: marquee 30s linear infinite; }
.strip-track.reverse { animation-direction: reverse; animation-duration: 38s; }
.strip-track span { padding-right: 1em; }

body.no-motion .big-star,
body.no-motion .strip-track { animation-play-state: paused; }

/* Either setting off also stills the selected menu item */
body.no-motion .menu-item.active::before,
body.no-motion .menu-item.active::after,
body.no-motion .menu-item.pop .mi-label { animation: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ HUD ============ */
.hud-top { position: fixed; top: 18px; left: 18px; z-index: 5; }

.date-box {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
  align-items: end; column-gap: 8px;
  transform: rotate(-6deg);
  background: var(--white); color: var(--black);
  padding: 6px 18px 8px 14px;
  clip-path: polygon(0 8%, 100% 0, 96% 100%, 3% 92%);
}
.date-num { font-family: var(--font-head); font-size: clamp(30px, min(5vw, 7vh), 56px); line-height: .9; grid-row: span 2; }
.date-day { font-family: var(--font-head); font-size: 22px; background: var(--red); color: var(--white); padding: 0 6px; transform: skew(-10deg); }
.date-time { font-family: var(--font-head); font-size: 20px; }

/* ============ STAGE / LOGO ============ */
.stage {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: max(13vh, 100px) 0 22vh clamp(16px, 9vw, 160px);
}

.logo {
  position: relative; align-self: flex-start;
  font-family: var(--font-head); font-weight: 400; text-transform: uppercase;
  font-size: clamp(44px, min(10vw, 13vh), 132px);
  line-height: .9; letter-spacing: .04em;
  color: var(--white);
  transform: rotate(-8deg) skewX(-10deg);
  text-shadow: 6px 6px 0 var(--black), 10px 10px 0 var(--red);
  animation: logo-in .6s var(--ease-pop) both;
}
.logo::after {
  /* slash underline */
  content: ""; position: absolute; left: -2%; right: -6%; bottom: -6px; height: 10px;
  background: var(--red);
  clip-path: polygon(0 40%, 100% 0, 98% 100%, 1% 100%);
}
@keyframes logo-in {
  from { opacity: 0; transform: rotate(-8deg) skewX(-10deg) translateX(-60px) scale(1.3); }
}

.tagline {
  font-family: var(--font-head); font-size: clamp(14px, 1.6vw, 20px);
  color: var(--black); background: var(--white);
  display: inline-block; align-self: flex-start;
  padding: 2px 12px; margin: clamp(12px, 2.6vh, 26px) 0 clamp(16px, 3.6vh, 34px) 40px;
  transform: rotate(-8deg) skew(-8deg);
}

/* ============ MENU ============ */
.menu ul { list-style: none; transform: rotate(-8deg); transform-origin: left center; }

.menu-item {
  --idx: 0;
  position: relative;
  display: block; width: max-content;
  margin: clamp(4px, 1.1vh, 10px) 0 clamp(4px, 1.1vh, 10px) calc(var(--idx) * 26px);
  padding: 2px 34px 2px 18px;
  cursor: pointer; outline: none;
  transition: transform .18s var(--ease-pop), margin .18s;
}

.mi-bg {
  position: absolute; inset: 4px 0 4px 0;
  background: var(--black);
  clip-path: polygon(0 12%, 100% 0, 94% 100%, 4% 86%);
  transition: background .12s, clip-path .2s var(--ease-pop);
}

.mi-label {
  position: relative; display: inline-block;
  font-family: var(--font-head); text-transform: uppercase;
  font-size: clamp(26px, min(5.4vw, 6.6vh), 66px); line-height: 1.05; letter-spacing: .02em;
  color: var(--white);
  transition: color .12s, transform .18s var(--ease-pop);
}

.mi-sub {
  position: absolute; right: -8px; bottom: -6px;
  font-family: var(--font-head); font-size: 16px; letter-spacing: .03em;
  color: var(--black);
  padding: 1px 9px;
  white-space: nowrap;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  /* Text fades + slides in (never scaled, so it stays sharp);
     the yellow bar behind it wipes in on its own.
     (A clip-path wipe flashed for a frame in Chrome.) */
  opacity: 0; translate: -10px 0;
  transition: opacity .14s ease-out, translate .18s ease-out;
}
.mi-sub::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform .18s ease-out;
}

/* Active item */
.menu-item.active { transform: translateX(28px) scale(1.12); z-index: 2; }
.menu-item.active .mi-bg {
  background: var(--white);
  clip-path: polygon(0 0, 100% 10%, 97% 92%, 2% 100%);
  box-shadow: none;
}
.menu-item.active::before {
  /* red echo behind the white plate */
  content: ""; position: absolute; inset: 4px -10px -6px 10px;
  background: var(--pink);
  clip-path: polygon(0 6%, 100% 18%, 95% 100%, 5% 90%);
  z-index: -1;
  animation: jitter .25s steps(2) infinite;
}
.menu-item.active::after {
  /* pointer */
  content: ""; position: absolute; left: -46px; top: 50%;
  width: 40px; height: 34px; margin-top: -17px;
  background: var(--white);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 22% 50%);
  animation: nudge .5s ease-in-out infinite alternate;
}
.menu-item.active .mi-label { color: var(--red); transform: skew(-6deg); }
.menu-item.active .mi-sub { opacity: 1; translate: 0 0; }
.menu-item.active .mi-sub::before { transform: scaleX(1); }

.menu-item.pop .mi-label { animation: pop .3s var(--ease-pop); }

@keyframes jitter {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-3px, 2px); }
}
@keyframes nudge { to { transform: translateX(-8px); } }
@keyframes pop {
  0% { transform: skew(-6deg) scale(1.25); }
  100% { transform: skew(-6deg) scale(1); }
}

/* ============ PROMPTS ============ */
.prompts {
  position: fixed; right: 18px; bottom: 18px; z-index: 5;
  display: flex; gap: 14px;
  font-family: var(--font-head); font-size: 20px; letter-spacing: .06em;
  color: var(--white);
}
.prompts kbd {
  display: inline-block; min-width: 26px; margin-right: 4px; padding: 0 6px;
  background: var(--white); color: var(--black);
  font-family: var(--font-head); font-size: 18px; text-align: center;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

/* ============ WIPE TRANSITION ============ */
.wipe { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.wipe i {
  position: absolute; top: -20%; height: 140%; width: 60%;
  left: -80%;
  background: var(--black);
  transform: skewX(-18deg);
}
.wipe i:nth-child(2) { background: var(--red); width: 14%; }
.wipe i:nth-child(3) { background: var(--white); width: 4%; }
.wipe.run i { animation: wipe .55s cubic-bezier(.7, 0, .3, 1) forwards; }
.wipe.run i:nth-child(2) { animation-delay: .05s; }
.wipe.run i:nth-child(3) { animation-delay: .09s; }
@keyframes wipe { to { left: 140%; } }

/* ============ PANEL ============ */
.panel {
  position: fixed; z-index: 10;
  top: 6vh; right: 4vw; bottom: 6vh;
  width: min(760px, 92vw);
  display: flex; flex-direction: column;
  background: var(--white); color: var(--black);
  clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%);
  transform: translateX(120%) rotate(3deg);
  transition: transform .4s var(--ease-pop);
  filter: drop-shadow(-14px 14px 0 var(--black));
}
.panel[hidden] { display: flex; visibility: hidden; }
.panel.open { transform: translateX(0) rotate(-2deg); visibility: visible; }

.panel-head {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px 14px 64px;
  background: var(--black); color: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}
.panel-num {
  font-family: var(--font-head); font-size: 44px; line-height: 1;
  color: var(--red); -webkit-text-stroke: 1px var(--white);
}
.panel-title {
  font-family: var(--font-head); font-weight: 400; text-transform: uppercase;
  font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: .02em;
  transform: skew(-8deg);
}
.panel-close {
  margin-left: auto;
  width: 46px; height: 46px; border: 0; cursor: pointer;
  background: var(--red); color: var(--white);
  font-family: var(--font-head); font-size: 24px;
  clip-path: polygon(10% 0, 100% 8%, 90% 100%, 0 92%);
  transition: transform .15s var(--ease-pop);
}
.panel-close:hover, .panel-close:focus-visible { transform: scale(1.15) rotate(-8deg); outline: none; background: var(--black); outline: 3px solid var(--red); }

.panel-body {
  flex: 1; overflow-y: auto;
  padding: 26px 34px 34px 70px;
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
  background:
    radial-gradient(circle, rgba(0,0,0,.07) 1.4px, transparent 1.6px) 0 0 / 10px 10px;
}
.panel-body > * { animation: slide-up .45s var(--ease-pop) both .15s; }
@keyframes slide-up { from { opacity: 0; transform: translateY(30px) rotate(2deg); } }

/* --- Profile --- */
.profile { display: flex; gap: 28px; align-items: flex-start; }
.portrait {
  flex: none; width: 150px; height: 190px;
  background: var(--red);
  clip-path: polygon(8% 0, 100% 5%, 92% 100%, 0 94%);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 120px; color: var(--black);
  box-shadow: inset 0 0 0 6px var(--black);
}
.codename { font-family: var(--font-head); font-size: 28px; letter-spacing: .04em; margin-bottom: 8px; }
.codename strong { background: var(--red); color: var(--white); padding: 0 8px; font-weight: 400; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags li {
  font-family: var(--font-head); font-size: 20px; letter-spacing: .05em;
  background: var(--black); color: var(--white); padding: 2px 12px;
  transform: skew(-10deg);
}
.tags li:nth-child(even) { background: var(--red); }

/* --- Missions --- */
.missions { list-style: none; display: grid; gap: 14px; }
.mission {
  display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--black); color: var(--white);
  clip-path: polygon(0 0, 100% 6%, 99% 100%, 1% 94%);
  transition: transform .15s var(--ease-pop), background .15s;
}
.mission:hover { transform: translateX(10px) scale(1.02); background: var(--red); }
.mission h3 { font-family: var(--font-head); font-weight: 400; font-size: 26px; letter-spacing: .03em; text-transform: uppercase; }
.mission p { font-size: 15px; opacity: .85; }
.m-rank { color: var(--yellow); font-size: 18px; letter-spacing: 2px; }
.m-go {
  font-family: var(--font-head); font-size: 22px; text-decoration: none;
  background: var(--white); color: var(--black); padding: 4px 16px;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.m-go:hover, .m-go:focus-visible { background: var(--yellow); outline: none; }

/* --- Stats --- */
.stats { list-style: none; display: grid; gap: 16px; }
.stats li { display: grid; grid-template-columns: 170px 1fr 60px; align-items: center; gap: 14px; }
.s-name { font-family: var(--font-head); font-size: 24px; letter-spacing: .04em; }
.s-bar {
  height: 22px; background: var(--black);
  clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%);
  position: relative; overflow: hidden;
}
.s-bar i {
  position: absolute; inset: 3px auto 3px 3px;
  width: 0;
  background: repeating-linear-gradient(-60deg, var(--red) 0 10px, var(--pink) 10px 20px);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  animation: fill 0.9s var(--ease-pop) forwards .3s;
}
.stats li:nth-child(2) .s-bar i { animation-delay: .4s; }
.stats li:nth-child(3) .s-bar i { animation-delay: .5s; }
.stats li:nth-child(4) .s-bar i { animation-delay: .6s; }
.stats li:nth-child(5) .s-bar i { animation-delay: .7s; }
@keyframes fill { to { width: calc(var(--lv) / 5 * 100% - 6px); } }
.s-rank { font-family: var(--font-head); font-size: 20px; color: var(--red); }

/* --- Calling card --- */
.card {
  position: relative;
  background: var(--red); color: var(--white);
  padding: 28px 30px;
  clip-path: polygon(0 3%, 100% 0, 97% 100%, 2% 96%);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,.25) 1.5px, transparent 1.7px) 0 0 / 9px 9px;
  pointer-events: none;
}
.card > * { position: relative; }
.card-title {
  font-family: var(--font-head); font-size: 38px; color: var(--black);
  transform: rotate(-4deg); margin-bottom: 8px;
}
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.links a {
  display: inline-block;
  font-family: var(--font-head); font-size: 24px; letter-spacing: .03em; text-transform: uppercase; text-decoration: none;
  background: var(--black); color: var(--white); padding: 6px 18px;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  transition: transform .15s var(--ease-pop);
}
.links a:hover, .links a:focus-visible { transform: scale(1.1) rotate(-3deg); background: var(--white); color: var(--red); outline: none; }

/* --- Config --- */
.config { list-style: none; display: grid; gap: 14px; }
.config li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--black); color: var(--white);
  padding: 10px 18px;
  font-family: var(--font-head); font-size: 26px; letter-spacing: .04em;
  clip-path: polygon(0 0, 100% 8%, 99% 100%, 1% 92%);
}
.toggle {
  min-width: 80px; border: 0; cursor: pointer;
  font-family: var(--font-head); font-size: 20px;
  padding: 4px 14px;
  background: var(--red); color: var(--white);
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.toggle[aria-pressed="false"] { background: var(--white); color: var(--black); }
.toggle:focus-visible { outline: 3px solid var(--yellow); }

/* Dim stage while panel open */
body.panel-open .stage { filter: brightness(.55) blur(1px); transition: filter .3s; }
.stage { transition: filter .3s; }

/* ============ RESPONSIVE ============ */
@media (max-width: 700px) {
  body { overflow: auto; }
  .stage { padding: 140px 16px 150px; justify-content: flex-start; min-height: 100%; height: auto; }
  .logo { font-size: clamp(44px, 14vw, 72px); }
  .mi-label { font-size: clamp(28px, 9vw, 44px); }
  .tagline { margin-bottom: 40px; }
  .menu-item { margin-left: calc(var(--idx) * 12px); padding-right: 22px; }
  .menu-item.active { transform: translateX(18px) scale(1.06); }
  .menu-item.active::after { left: -30px; width: 26px; height: 24px; margin-top: -12px; }
  .prompts { display: none; }
  .panel { top: 2vh; right: 3vw; bottom: 2vh; width: 94vw; transform: translateX(120%); }
  .panel.open { transform: translateX(0) rotate(-1deg); }
  .panel-head { padding-left: 36px; }
  .panel-body { padding: 20px 18px 28px 30px; }
  .profile { flex-direction: column; }
  .stats li { grid-template-columns: 1fr 50px; }
  .stats .s-bar { grid-column: 1 / -1; grid-row: 2; }
  .mission { grid-template-columns: 1fr auto; }
  .m-rank { grid-column: 1 / -1; }
}

/* Config: animations off — everything holds still */
body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  animation: none !important;
  transition: none !important;
}
body.no-anim .s-bar i { width: calc(var(--lv) / 5 * 100% - 6px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
