/* ---------- Tokens ---------- */
:root {
  --ink: #04070d;
  --panel: #0a1018;
  --panel-2: #101a26;
  --line: rgba(255, 255, 255, .12);
  --text: #eef4f8;
  --muted: #a8b6c3;
  --cyan: #00c8ff;
  --blue: #006abb;
  --accent: var(--cyan);
  --chrome: linear-gradient(100deg, #3b3b3b, #8a8a8a 40%, #ececec);
  --checker: conic-gradient(rgba(255, 255, 255, .07) 25%, transparent 0 50%, rgba(255, 255, 255, .07) 0 75%, transparent 0) 0 0 / 28px 28px;
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --wrap: min(1160px, 100% - 40px);
  --radius: 22px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 500 1.0625rem/1.7 var(--body);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(4, 7, 13, .35), rgba(4, 7, 13, .78)), url("/assets/img/space.webp") center / cover;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.08; text-transform: uppercase; letter-spacing: .01em; }
h2 { font-size: clamp(2rem, 5vw, 3.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 8px 14px; background: var(--cyan); color: #00131c; font-weight: 800; border-radius: 8px; }
.skip:focus { top: 12px; }
.lede { color: var(--muted); font-size: 1.15rem; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { display: flex; align-items: center; gap: 22px; margin-bottom: 34px; }
.section-head::after { content: ""; flex: 1; height: 5px; border-radius: 5px; background: linear-gradient(90deg, #fff, transparent); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; padding: 12px 0; }
.bar {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 10px 8px 16px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(rgba(8, 13, 20, .92), rgba(8, 13, 20, .92)) padding-box, var(--chrome) border-box;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font: 700 1.15rem var(--display); text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.brand img { width: 38px; height: 38px; }
.brand .brand-logo { width: auto; height: 34px; }
.menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.menu a { display: block; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: .98rem; text-decoration: none; transition: background .2s, color .2s; }
.menu a:hover { background: rgba(255, 255, 255, .1); }
.menu a[aria-current="page"] { color: var(--cyan); }
.menu .cta { margin-left: 6px; background: var(--cyan); color: #00131c; }
.menu .cta:hover { background: #fff; }
.toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.toggle span, .toggle span::before, .toggle span::after { display: block; width: 20px; height: 3px; margin: auto; border-radius: 3px; background: currentColor; content: ""; }
.toggle span { position: relative; }
.toggle span::before { position: absolute; top: -7px; }
.toggle span::after { position: absolute; top: 7px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px;
  border: 3px solid transparent;
  border-radius: 999px;
  font: 700 1.05rem var(--display);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-3px); }
.btn-main { background: linear-gradient(180deg, #2bdcff, #0093e6); color: #00131c; box-shadow: 0 8px 26px rgba(0, 200, 255, .32); }
.btn-main:hover { box-shadow: 0 12px 34px rgba(0, 200, 255, .55); }
.btn-ghost { background: linear-gradient(#0a1018, #0a1018) padding-box, var(--chrome) border-box; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 24px; min-height: calc(100vh - 90px); padding-block: 32px 48px; }
.hero-face { width: min(300px, 62%); margin-bottom: 22px; }
.hero h1 img { width: min(600px, 100%); }
.hero .lede { max-width: 46ch; margin-top: 22px; }
.hero-art { position: relative; justify-self: center; width: min(460px, 100%); }
.hero-art::before { content: ""; position: absolute; inset: 8% 2%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(0, 200, 255, .5), transparent 68%); }
.hero-art img { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-16px) rotate(-1.5deg); } }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  padding: clamp(24px, 4vw, 42px);
  border: 5px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(10, 16, 24, .95), rgba(16, 26, 38, .95)) padding-box, var(--chrome) border-box;
}
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: stretch; }
.trailer { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 5px solid transparent; border-radius: var(--radius); background: linear-gradient(#000, #000) padding-box, var(--chrome) border-box; cursor: pointer; color: #fff; }
.trailer img, .trailer iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.trailer img { transition: transform .4s, opacity .3s; opacity: .82; }
.trailer:hover img { transform: scale(1.04); opacity: 1; }
.play { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 10px rgba(0, 200, 255, .22); transition: transform .2s; }
.play::after { content: ""; position: absolute; left: 33px; top: 24px; border-style: solid; border-width: 18px 0 18px 28px; border-color: transparent transparent transparent #00131c; }
.trailer:hover .play { transform: scale(1.1); }
.updates { overflow: hidden; }
.updates h3 { font-size: 1.7rem; margin-bottom: 14px; }
.updates p { color: var(--muted); }
.updates .peek { position: absolute; right: -14px; bottom: -26px; width: 120px; transform: rotate(-8deg); }
.updates p:last-of-type { padding-bottom: 72px; }

/* ---------- Roster ---------- */
.roster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.roster.full { gap: 18px 22px; }
.banner { display: block; border-radius: 16px; transition: transform .2s, filter .2s; }
.banner:hover { transform: translateY(-4px) scale(1.015); filter: drop-shadow(0 8px 20px var(--accent)); }
.banner img { width: 100%; aspect-ratio: 1600 / 299; }

/* ---------- Social ---------- */
.socials { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.socials a { display: grid; justify-items: center; gap: 10px; padding: 20px 8px; border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 16, 24, .72); font: 600 1rem var(--display); text-decoration: none; transition: transform .2s, background .2s, border-color .2s; }
.socials a:hover, .socials a:focus-visible { transform: translateY(-4px); border-color: var(--brand); background: var(--brand); }
.socials svg { width: 52px; height: 52px; }

/* ---------- Page heads ---------- */
.page-head { padding-block: clamp(36px, 7vw, 72px) 10px; text-align: center; }
.page-head h1 { font-size: clamp(2.8rem, 9vw, 5.2rem); text-shadow: 0 4px 0 #004f8c; }
.page-head .lede { max-width: 58ch; margin: 14px auto 0; }
.page-head .wordmark { width: min(620px, 100%); margin: 0 auto; filter: drop-shadow(0 0 22px rgba(0, 200, 255, .55)); }

/* ---------- Pandora ---------- */
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.perk { padding: 24px 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 16, 24, .78); }
.perk strong { display: block; margin-bottom: 8px; color: var(--cyan); font: 700 2rem var(--display); }
.perk h3 { margin-bottom: 8px; font-size: 1.1rem; }
.perk p { color: var(--muted); font-size: 1rem; }
.feature { display: grid; grid-template-columns: 200px 1fr; gap: 34px; align-items: center; }
.feature img { width: 100%; }
.feature h2 { margin-bottom: 14px; }
.feature p { color: var(--muted); }
.join { position: relative; overflow: hidden; text-align: center; }
.join::before { content: ""; position: absolute; inset: 0; background: var(--checker); }
.join > * { position: relative; }
.join p { max-width: 48ch; margin: 14px auto 0; color: var(--muted); }
.join .btn-row { justify-content: center; }
.join img { width: 84px; margin: 0 auto 10px; image-rendering: pixelated; }

/* ---------- Character profile ---------- */
.profile { --accent: var(--cyan); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 56px); align-items: center; padding-block: 28px 56px; }
.stage { position: relative; display: grid; place-items: center; min-height: 560px; padding: 24px; overflow: hidden; border: 5px solid transparent; border-radius: var(--radius); background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 72%, transparent), rgba(5, 9, 15, .96) 72%) padding-box, var(--chrome) border-box; }
.stage::before { content: ""; position: absolute; inset: 0; background: var(--checker); }
.stage img { position: relative; max-height: 620px; width: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .6)); }
.profile h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.profile .title-banner { width: 100%; margin-bottom: 24px; }
.stage.duo { display: flex; align-items: flex-end; justify-content: center; gap: 4%; }
.stage.duo img { max-height: none; width: auto; }
.stage.duo .jim { height: min(620px, 118vw); }
.stage.duo .tim { height: min(200px, 30vw); }
.hint { color: var(--muted); font-style: italic; }
.ages { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.ages div { display: flex; align-items: baseline; gap: 10px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(10, 16, 24, .8); }
.ages dt { color: var(--muted); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.ages dd { margin: 0; color: color-mix(in srgb, var(--accent) 40%, #fff); font: 700 1.3rem var(--display); }
.ages div:has(.age-flag) { align-items: center; }
.ages .age-flag img { width: 42px; height: 28px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.flags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.flags img { width: 66px; height: 44px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.back { display: inline-block; margin-top: 14px; font-weight: 800; color: var(--cyan); text-decoration: none; }
.back:hover { text-decoration: underline; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 72px; }
.pager span { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
.pager div:last-child { text-align: right; }
.variants { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.variants img { padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 16, 24, .75); transition: transform .2s; }
.variants img:hover { transform: translateY(-5px) rotate(-3deg); }

/* ---------- Gallery ---------- */
.tv { position: relative; width: min(520px, 100%); margin: 26px auto 0; padding: 0; }
.tv-screen { position: absolute; inset: 21% 4% 3%; display: grid; place-items: center; overflow: hidden; text-align: center; background: repeating-linear-gradient(0deg, rgba(0, 200, 255, .14) 0 3px, rgba(0, 200, 255, .03) 3px 6px); animation: flicker 3.5s steps(2) infinite; }
.tv-screen strong { font: 700 clamp(1.5rem, 6vw, 2.5rem) var(--display); text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 16px rgba(0, 200, 255, .8); }
.tv img { position: relative; filter: drop-shadow(0 0 16px rgba(0, 200, 255, .6)); }
@keyframes flicker { 50% { opacity: .78; } }
.tv-404 { width: min(380px, 78%); margin-top: 0; }
.tv-404 .tv-screen strong { font-size: clamp(3.4rem, 13vw, 5.4rem); }
.nf-title { margin-top: 32px; }

/* ---------- Fanart ---------- */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rules-note { margin: 24px 0 0; color: var(--muted); text-align: center; }
.fan-grid { columns: 3; column-gap: 18px; }
.fan-card { break-inside: avoid; margin: 0 0 18px; padding: 8px 8px 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 16, 24, .82); }
.fan-open { display: block; overflow: hidden; border-radius: 12px; cursor: zoom-in; }
.fan-open img { width: 100%; transition: transform .25s; }
.fan-open:hover img { transform: scale(1.03); }
.fan-card figcaption { padding: 10px 6px 0; color: var(--muted); font-size: .98rem; text-align: center; }
.fan-card figcaption a, .lightbox figcaption a { color: var(--cyan); font-weight: 800; text-decoration: none; }
.fan-card figcaption a:hover, .lightbox figcaption a:hover { text-decoration: underline; }
.platform { display: inline-flex; margin-left: 8px; color: var(--text); vertical-align: -2px; }
.platform svg { width: 16px; height: 16px; }
.lightbox figcaption { text-align: center; }
.lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 16px; border: 0; background: rgba(2, 4, 8, .93); color: var(--text); }
.lightbox[open] { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 10px; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { grid-column: 2; display: grid; justify-items: center; gap: 12px; margin: 0; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 92px); width: auto; height: auto; border-radius: 10px; }
.lb-nav, .lb-close { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font: 800 1.4rem var(--body); cursor: pointer; }
.lb-nav:hover, .lb-close:hover { background: var(--cyan); color: #00131c; }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 1; }

/* ---------- Discord rules ---------- */
html { scroll-padding-top: 96px; }
.rule-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.rule-jump a { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(10, 16, 24, .8); font-weight: 800; text-decoration: none; transition: border-color .2s, color .2s; }
.rule-jump a:hover { border-color: var(--cyan); color: var(--cyan); }
.rules-sec { padding-top: 34px; }
.rule-intro { margin: 12px 0 0; color: var(--muted); }
.rule-sub { margin-top: 32px; font-size: 1.15rem; color: var(--cyan); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 26px 34px; margin-top: 24px; }
.rule-title { margin: 0 0 8px; font: 700 1.1rem var(--display); text-transform: none; letter-spacing: 0; }
.rule-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 1rem; }
.rule-list li { margin-bottom: 6px; }
.rule-list li::marker { color: var(--cyan); }
.rule-list code { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .12); color: var(--text); font-size: .92em; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.action { padding: 22px 20px; border: 1px solid var(--line); border-top: 4px solid var(--level); border-radius: 16px; background: rgba(4, 7, 13, .55); }
.action-minor { --level: #7cb95a; }
.action-serious { --level: #ffcf52; }
.action-heavy { --level: #e5364a; }
.action h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 1.05rem; }
.action p { color: var(--muted); font-size: 1rem; }
.dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--level); }
.rules-end { padding-block: 44px 72px; text-align: center; }
.join p a { color: var(--cyan); font-weight: 800; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 30px; padding: 34px 0; border-top: 1px solid var(--line); background: rgba(4, 7, 13, .86); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .95rem; }
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.foot a { font-weight: 800; text-decoration: none; }
.foot a:hover { color: var(--cyan); }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s, transform .55s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .toggle { display: grid; place-items: center; }
  .menu { position: absolute; top: calc(100% + 2px); left: 20px; right: 20px; display: none; flex-direction: column; align-items: stretch; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8, 13, 20, .98); }
  .menu.open { display: flex; }
  .menu a { padding: 11px 16px; }
  .menu .cta { margin: 6px 0 0; text-align: center; }
  .site-header .wrap { position: static; }
  .site-header { position: sticky; }
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero-face, .hero .lede { margin-inline: auto; }
  .hero .btn-row { justify-content: center; }
  .hero-art { width: min(340px, 78%); }
  .split, .profile-grid { grid-template-columns: 1fr; }
  .stage { min-height: 420px; }
  .stage img { max-height: 460px; }
  .perks { grid-template-columns: repeat(2, 1fr); }
  .variants { grid-template-columns: repeat(3, 1fr); }
  .fan-grid { columns: 2; }
  .actions { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .roster { grid-template-columns: 1fr; }
  .socials { grid-template-columns: repeat(2, 1fr); }
  .socials li:last-child { grid-column: 1 / -1; }
  .perks, .rules { grid-template-columns: 1fr; }
  .fan-grid { columns: 1; }
  .lightbox[open] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; }
  .lightbox img { max-height: calc(100dvh - 160px); }
  .lb-prev { grid-column: 1; grid-row: 2; justify-self: end; }
  .lb-next { grid-column: 2; grid-row: 2; }
  .feature { grid-template-columns: 1fr; text-align: center; }
  .feature img { width: 150px; margin-inline: auto; }
  .section-head { gap: 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager div:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
