:root {
  color-scheme: dark;
  --bg: #07131a;
  --bg-soft: #0b1c24;
  --surface: #102832;
  --surface-solid: #132f3a;
  --text: #edf7f8;
  --muted: #a7bcc1;
  --line: rgba(179, 224, 230, 0.18);
  --accent: #42cad5;
  --accent-strong: #89edf1;
  --accent-ink: #052127;
  --danger: #ff8d86;
  --radius: 8px;
  --shell: min(1400px, calc(100% - 64px));
  font-family: "Segoe UI Variable", "Aptos", "Trebuchet MS", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
body.dialog-open { overflow: hidden; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 12px 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); }
.skip-link:focus { top: 12px; }

.site-header { position: absolute; inset: 0 0 auto; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.12); }
.nav { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; width: max-content; }
.nav-logo { display: block; width: 128px; height: 60px; object-fit: contain; flex: 0 0 128px; }
.nav-links { display: flex; align-items: center; gap: 32px; color: #d7e5e8; font-size: 14px; }
.nav-links a, .text-button { transition: color .2s ease; }
.nav-links a:hover, .text-button:hover { color: var(--accent-strong); }
.nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.text-button { background: transparent; border: 0; color: #d7e5e8; padding: 10px 0; cursor: pointer; }
.button { display: inline-flex; min-height: 50px; padding: 0 24px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 750; white-space: nowrap; cursor: pointer; transition: transform .22s ease, background .22s ease, border-color .22s ease; }
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-2px); }
.button:active { transform: translateY(1px) scale(.98); }
.button-small { min-height: 40px; padding-inline: 18px; font-size: 14px; }
.button-ghost { background: rgba(5, 20, 27, .5); color: var(--text); border-color: rgba(255,255,255,.36); backdrop-filter: blur(10px); }
.button-ghost:hover { color: var(--accent-ink); }
.menu-button { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7,19,26,.8); }
.menu-button span { display: block; width: 18px; height: 1px; margin: 5px auto; background: var(--text); }

.hero { position: relative; min-height: min(900px, 100dvh); display: flex; align-items: center; overflow: hidden; }
.hero-image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; animation: hero-camera 16s ease-in-out infinite alternate; }
.hero-shade { position: absolute; z-index: 2; inset: 0; background: linear-gradient(90deg, rgba(4,14,20,.98) 0%, rgba(4,14,20,.79) 33%, rgba(4,14,20,.14) 66%, rgba(4,14,20,.3) 100%), linear-gradient(0deg, rgba(7,19,26,.8), transparent 36%); pointer-events: none; }
.hero-content { position: relative; z-index: 4; padding-top: 72px; pointer-events: none; }
.hero-actions { pointer-events: auto; }
.eyebrow { margin: 0 0 18px; color: var(--accent-strong); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.hero h1 { max-width: 660px; margin: 0; font-size: clamp(44px, 5.2vw, 76px); line-height: .98; letter-spacing: 0; font-weight: 720; text-wrap: balance; animation: hero-arrive .9s .18s cubic-bezier(.16,1,.3,1) both; }
.hero-copy { max-width: 520px; margin: 26px 0 0; color: #d3e1e4; font-size: clamp(18px, 2vw, 23px); line-height: 1.5; animation: hero-arrive .9s .3s cubic-bezier(.16,1,.3,1) both; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; animation: hero-arrive .9s .42s cubic-bezier(.16,1,.3,1) both; }
.hero-creatures { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.scene-creature { position: absolute; width: clamp(203px, 16.8vw, 315px); aspect-ratio: 1; padding: 0; border: 0; background: transparent; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .18s ease, filter .18s ease; }
.scene-creature::after { content: ""; position: absolute; z-index: -1; left: 22%; right: 22%; bottom: 18%; height: 9%; border-radius: 50%; background: rgba(0,5,8,.56); filter: blur(7px); }
.scene-creature canvas { display: block; width: 100%; height: 100%; filter: drop-shadow(0 12px 9px rgba(0,7,12,.42)); }
.scene-creature:hover { filter: brightness(1.08); }
.scene-creature:active { transform: scale(.96); }
.scene-creature:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 50%; }
.scene-creature-one { left: 34%; bottom: 2%; }
.scene-creature-two { left: 49%; bottom: 7%; }
.scene-creature-three { left: 65%; top: 35%; width: clamp(224px, 18.2vw, 343px); }
.scene-creature-four { right: 4%; bottom: 6%; width: clamp(231px, 19.6vw, 364px); }
@keyframes hero-arrive { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-camera { from { transform: scale(1); } to { transform: scale(1.035); } }
.mote-field { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.mote { position: absolute; width: var(--size); height: var(--size); left: var(--left); bottom: -20px; border-radius: 50%; background: var(--accent-strong); opacity: 0; box-shadow: 0 0 10px rgba(137,237,241,.42); animation: mote-rise var(--duration) var(--delay) linear infinite; }
@keyframes mote-rise { 0% { opacity: 0; transform: translate3d(0,0,0); } 18% { opacity: .55; } 82% { opacity: .16; } 100% { opacity: 0; transform: translate3d(var(--drift), -88vh, 0); } }

.signal { border-block: 1px solid var(--line); background: #091820; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.signal-grid div { min-height: 120px; padding: 28px 36px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.signal-grid div:first-child { padding-left: 0; }
.signal-grid div:last-child { border-right: 0; }
.signal strong { font-size: 17px; }
.signal span { margin-top: 7px; color: var(--muted); font-size: 14px; }

.section { padding-block: 128px; }
.section-heading { max-width: 760px; margin-bottom: 58px; }
.section h2 { margin: 0; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: 0; }
.section-heading p, .adventure-copy > p, .server-panel > div > p, .registration-content > p { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.world-grid { display: grid; grid-template-columns: 1.7fr .85fr; grid-template-rows: auto auto; gap: 18px; }
.world-feature { grid-row: 1 / 3; position: relative; min-height: 650px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: #0b1c24; }
.world-feature::before { content: ""; position: absolute; width: 52%; aspect-ratio: 1; right: -8%; top: 9%; border: 1px solid rgba(66,202,213,.42); transform: rotate(45deg); }
.world-feature::after { content: ""; position: absolute; width: 31%; aspect-ratio: 1; right: 17%; top: 27%; border: 1px solid rgba(137,237,241,.18); transform: rotate(45deg); }
.world-copy { position: absolute; z-index: 2; inset: auto 38px 38px; }
.world-copy h3, .world-detail h3 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; }
.world-copy p, .world-detail p { margin: 10px 0 0; color: #d4e3e5; line-height: 1.55; }
.area-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.area-list span { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: 12px; }
.world-detail { padding: 42px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; justify-content: flex-end; min-height: 310px; }
.area-index { color: var(--accent-strong); font-size: 13px; font-weight: 750; margin-bottom: auto; }
.channel-map { border-radius: var(--radius); border: 1px solid var(--line); background: #091820; padding: 14px 28px; }
.channel { min-height: 68px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); }
.channel:last-child { border: 0; }
.channel strong { font-size: 12px; color: var(--muted); }
.channel-active span { color: var(--text); font-weight: 700; }
.channel-active strong { color: var(--accent-strong); }

.adventure { background: var(--bg-soft); }
.adventure-layout { display: grid; grid-template-columns: .78fr 1.5fr; align-items: center; gap: 72px; }
.adventure-copy { padding-left: max(0px, 5vw); }
.route { margin-top: 42px; display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 12px; color: #d7e6e8; font-size: 13px; }
.route i { display: block; height: 1px; background: var(--accent); opacity: .6; }
.route i::after { content: ""; display: block; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--accent-strong); animation: route-pulse 2.2s ease-in-out infinite; }
.route i:nth-of-type(2)::after { animation-delay: 1.1s; }
@keyframes route-pulse { 0%, 100% { opacity: .2; transform: translateX(0) scale(.7); } 50% { opacity: 1; transform: translateX(calc(100% - 9px)) scale(1); } }
.realm-statement { min-height: 610px; padding: 68px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.realm-statement strong { font-size: clamp(42px, 6vw, 86px); line-height: .95; color: #c9d9dc; }
.realm-statement strong:nth-child(2) { color: var(--accent-strong); }

.server-panel { display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: end; padding: 64px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(120deg, #0d222b, #091820); box-shadow: 0 30px 80px rgba(0, 10, 14, .3); }
.server-panel h2 { font-size: clamp(36px, 4vw, 58px); }
.server-status { min-height: 112px; display: flex; align-items: center; gap: 18px; padding: 24px; border-left: 1px solid var(--line); }
.status-light { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: #829399; box-shadow: 0 0 0 7px rgba(130,147,153,.1); }
.status-light.online { background: var(--accent); box-shadow: 0 0 0 7px rgba(66,202,213,.12); }
.status-light.online { animation: status-pulse 2.4s ease-in-out infinite; }
@keyframes status-pulse { 0%, 100% { box-shadow: 0 0 0 7px rgba(66,202,213,.1); } 50% { box-shadow: 0 0 0 13px rgba(66,202,213,.025); } }
.status-light.offline { background: var(--danger); box-shadow: 0 0 0 7px rgba(255,141,134,.1); }
.server-status div { display: flex; flex-direction: column; gap: 7px; }
.server-status span { color: var(--muted); font-size: 14px; }

.registration { position: relative; overflow: hidden; min-height: 560px; display: flex; align-items: center; border-top: 1px solid var(--line); background: #091820; }
.registration-content { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding-left: 38%; }
.registration-content h2 { max-width: 600px; }
.registration-content .button { margin-top: 30px; }

.footer { border-top: 1px solid var(--line); padding-block: 42px; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: var(--muted); font-size: 13px; }
.footer-grid p { margin: 0; text-align: center; }
.footer-grid > div { display: flex; justify-content: flex-end; gap: 22px; }
.footer-logo { width: 128px; height: 70px; object-fit: contain; }

.auth-dialog { width: min(500px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-solid); color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.58); }
.auth-dialog::backdrop { background: rgba(1,8,11,.82); backdrop-filter: blur(8px); }
.dialog-inner { position: relative; padding: 46px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--text); font-size: 24px; cursor: pointer; }
.dialog-brand { display: flex; align-items: center; gap: 11px; color: var(--accent-strong); font-weight: 750; font-size: 13px; }
.auth-dialog h2 { margin: 34px 0 8px; font-size: 38px; }
.auth-dialog p { color: var(--muted); line-height: 1.5; }
.auth-dialog form { display: grid; gap: 9px; margin-top: 30px; }
.auth-dialog label { margin-top: 10px; color: #d8e7e9; font-size: 13px; font-weight: 650; }
.auth-dialog input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #52717a; border-radius: var(--radius); background: #081a21; color: var(--text); outline: none; }
.auth-dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(66,202,213,.18); }
.form-message { min-height: 23px; margin: 10px 0 2px !important; color: var(--danger) !important; font-size: 13px; }
.form-message.success { color: var(--accent-strong) !important; }
.button-full { width: 100%; margin-top: 2px; }

.account-page { min-height: 100dvh; background: #07131a; }
.account-header { position: relative; border-bottom: 1px solid var(--line); background: rgba(7,19,26,.96); }
.account-main { position: relative; min-height: calc(100dvh - 73px); display: grid; place-items: center; padding: 70px 16px; overflow: hidden; }
.account-main::before { content: ""; position: absolute; inset: 0; background: url('/assets/hero-monbud-characters.png') center / cover; opacity: .3; }
.account-main::after { content: ""; position: absolute; inset: 0; background: rgba(4,14,20,.72); backdrop-filter: blur(3px); }
.account-panel { position: relative; z-index: 2; width: min(560px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(9,24,32,.94); box-shadow: 0 30px 80px rgba(0,8,12,.42); }
.account-panel-wide { width: min(760px, 100%); }
.account-panel h1 { margin: 0; font-size: clamp(34px, 6vw, 52px); line-height: 1.04; }
.account-intro { margin: 12px 0 30px; color: var(--muted); line-height: 1.55; }
.account-form { display: grid; gap: 9px; }
.field { display: grid; gap: 7px; margin-top: 8px; }
.field label, .checkbox-field label { color: #d8e7e9; font-size: 13px; font-weight: 700; }
.field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #52717a; border-radius: var(--radius); background: #081a21; color: var(--text); outline: none; }
.field input:focus, .password-toggle:focus-visible, .checkbox-field input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(66,202,213,.2); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 18px; margin: 0; color: #ffaaa5; font-size: 12px; line-height: 1.4; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 82px; }
.password-toggle { position: absolute; top: 6px; right: 6px; min-width: 68px; height: 38px; border: 0; border-radius: 6px; background: #183640; color: #dcebee; font-size: 12px; cursor: pointer; }
.checkbox-field { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin-top: 12px; }
.checkbox-field input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.checkbox-field a, .account-link, .legal-copy a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.checkbox-error { grid-column: 2; }
.form-status { min-height: 24px; margin: 8px 0 0; color: #ffaaa5; font-size: 13px; line-height: 1.45; }
.form-status.success { color: var(--accent-strong); }
.account-form .button:disabled { cursor: wait; opacity: .65; transform: none; }
.account-secondary { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.legal-copy { color: #c6d7da; line-height: 1.7; }
.legal-copy h2 { margin: 30px 0 8px; color: var(--text); font-size: 22px; }
.legal-note { padding: 14px 16px; border-left: 3px solid var(--accent); background: #102832; color: var(--muted); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  :root { --shell: min(100% - 32px, 720px); }
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; position: absolute; top: 72px; left: 16px; right: 16px; padding: 18px; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); background: #091820; }
  .nav-links.open { display: flex; }
  .nav-actions .text-button, .nav-actions .button { display: none; }
  .menu-button { display: block; }
  .hero { min-height: calc(100dvh - 72px); align-items: flex-start; border-bottom: 1px solid var(--line); }
  .hero-content { padding: 120px 0 48px; }
  .scene-creature { width: clamp(151px, 29.4vw, 218px); }
  .scene-creature-one { left: 2%; top: 22%; bottom: auto; }
  .scene-creature-two { left: 34%; top: 34%; bottom: auto; }
  .scene-creature-three { left: auto; right: 5%; top: 17%; width: clamp(165px, 32.2vw, 238px); }
  .scene-creature-four { left: 48%; right: auto; top: 46%; bottom: auto; width: clamp(171px, 33.6vw, 246px); }
  .hero-image { object-position: 62% center; }
  .hero-shade { background: linear-gradient(0deg, rgba(4,14,20,.98) 12%, rgba(4,14,20,.72) 56%, rgba(4,14,20,.18)); }
  .hero h1 { max-width: 620px; font-size: clamp(45px, 11vw, 72px); }
  .signal-grid { grid-template-columns: 1fr; }
  .signal-grid div { min-height: 94px; padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-grid div:last-child { border: 0; }
  .section { padding-block: 88px; }
  .world-grid, .adventure-layout, .server-panel { grid-template-columns: 1fr; }
  .world-feature { grid-row: auto; min-height: 520px; }
  .world-detail { min-height: 270px; }
  .adventure-layout { gap: 46px; }
  .adventure-copy { padding-left: 0; }
  .realm-statement { min-height: 390px; padding: 42px 0; border-left: 0; border-top: 1px solid var(--line); }
  .server-panel { gap: 34px; padding: 38px; }
  .server-status { border-left: 0; border-top: 1px solid var(--line); padding-inline: 0; }
  .registration { min-height: 520px; align-items: center; }
  .registration-content { padding: 80px 0; }
  .footer-grid { grid-template-columns: 1fr; justify-items: start; }
  .footer-grid p { text-align: left; }
  .footer-grid > div { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .hero { min-height: calc(100dvh - 72px); }
  .hero-content { padding-top: 104px; padding-bottom: 36px; }
  .hero h1 { font-size: 43px; }
  .hero-copy { font-size: 17px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .scene-creature-one { left: -3%; top: 20%; bottom: auto; }
  .scene-creature-two { left: 29%; top: 31%; bottom: auto; }
  .scene-creature-three { right: -2%; top: 14%; }
  .scene-creature-four { left: 48%; right: auto; top: 44%; bottom: auto; }
  .button { width: 100%; }
  .world-feature { min-height: 430px; }
  .world-copy { inset: auto 22px 22px; }
  .world-detail { padding: 28px; }
  .realm-statement { min-height: 320px; }
  .route { grid-template-columns: auto 1fr auto; }
  .route i:nth-of-type(2), .route span:last-child { display: none; }
  .server-panel { padding: 26px; }
  .dialog-inner { padding: 34px 24px 26px; }
  .account-main { padding: 38px 12px; align-items: start; }
  .account-panel { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .mote-field { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .button-ghost, .auth-dialog::backdrop { backdrop-filter: none; }
}
