:root {
  color-scheme: dark;
  --bg: #0a0c13;
  --surface: #111722;
  --raised: #151c2a;
  --border: #2b3445;
  --text: #f3f5f7;
  --muted: #aab5c6;
  --aqua: #54def0;
  --gold: #ffc171;
  --coral: #ff7790;
  --violet: #bd9bff;
  --wrap: 73rem;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--aqua); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
p { color: var(--muted); line-height: 1.65; }
h2 { font-size: clamp(2.15rem, 4vw, 3.35rem); line-height: 1.04; letter-spacing: -.045em; }
h3 { font-size: 1.25rem; letter-spacing: -.017em; line-height: 1.3; }
code { font-family: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace; }
.wrap { width: min(var(--wrap), 100% - clamp(2rem, 8vw, 6rem)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 30; top: 1rem; left: 1rem; padding: .75rem 1rem; background: var(--aqua); color: var(--bg); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 10; background: #0a0c13ee; border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.header-inner { min-height: 4.65rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 900; letter-spacing: .09em; text-decoration: none; line-height: 1.12; }
.brand img { width: 2.6rem; height: 2.6rem; border-radius: .55rem; }
.brand small { display: block; margin-top: .3rem; color: var(--aqua); font-size: .72rem; font-weight: 750; letter-spacing: .13em; }
nav { display: flex; align-items: center; gap: clamp(.8rem, 2.45vw, 1.65rem); }
nav a { color: var(--muted); font-size: .94rem; font-weight: 650; text-decoration: none; }
nav a:hover, .text-link:hover { color: var(--aqua); }
.menu-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: .45rem; min-height: 2.7rem; padding: .45rem .85rem; cursor: pointer; }

.hero { border-bottom: 1px solid var(--border); background: radial-gradient(ellipse at 80% 15%, #1b1a35 0%, transparent 52%), var(--bg); }
.hero-content { display: grid; grid-template-columns: minmax(0, .98fr) minmax(0, 1.03fr); align-items: center; gap: clamp(2rem, 4.5vw, 4.75rem); padding-block: clamp(3.9rem, 8.8vw, 8rem); }
.hero h1 { margin-top: 1rem; font-size: clamp(2.85rem, 6.6vw, 6.1rem); font-weight: 900; line-height: .98; letter-spacing: -.065em; }
.hero em { color: var(--violet); background: linear-gradient(95deg, #75e9ff, #b9a0ff 50%, #ff8196 92%); background-clip: text; -webkit-text-fill-color: transparent; font-style: normal; }
.eyebrow { color: var(--aqua); font-weight: 750; font-size: .88rem; letter-spacing: .075em; line-height: 1.4; }
.lead { max-width: 35rem; font-size: clamp(1.02rem, 1.5vw, 1.2rem); margin-top: 1.45rem; }
.actions, .connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.actions { margin-top: 1.75rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; padding: .67rem 1.02rem; border: 1px solid transparent; border-radius: .55rem; font-size: .94rem; font-weight: 760; line-height: 1.22; text-align: center; text-decoration: none; cursor: pointer; }
.button-small { min-height: 2.55rem; padding: .42rem .7rem; }
.button-primary { color: #11101d; background: linear-gradient(105deg, #a7e9ff, #c3adff 68%, #f4aed2); }
.button-primary:hover { background: #d2bfff; color: #10131c; }
.button-outline { color: var(--text); border-color: var(--border); background: #151b269a; }
.button-outline:hover { border-color: var(--aqua); color: var(--aqua); }
.hero-visual { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid #48516e; border-radius: .85rem; background: #182235; box-shadow: 0 24px 75px #070910ba; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: 57% center; }
.hero-visual::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 2.25rem #09121c40; pointer-events: none; }

.section { padding-block: clamp(3.4rem, 7vw, 6.85rem); }
.section-raised { background: var(--surface); border-block: 1px solid var(--border); }
.section :is(h2, h3) + p { margin-top: .78rem; }
.section .eyebrow + h2 { margin-top: .51rem; }
.section p + p { margin-top: .72rem; }
.connection { padding-block: clamp(2.6rem, 5vw, 4.75rem); background: linear-gradient(110deg, #13202b, #17192a 65%, #21192d); border-bottom: 1px solid var(--border); }
.connection-grid, .feature-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); align-items: center; gap: clamp(1.55rem, 4.5vw, 4.75rem); }
.connection-card { padding: clamp(.9rem, 2.4vw, 1.35rem); border: 1px solid #3f4b65; border-radius: .72rem; background: #0c1220bf; }
.server-connection { display: flex; flex-wrap: wrap; gap: .8rem 1rem; justify-content: space-between; align-items: center; padding: .82rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--bg); }
.server-address span { display: block; color: var(--muted); font-size: .88rem; }
.server-address code { display: block; color: var(--text); font-size: clamp(1rem, 3.8vw, 1.48rem); font-weight: 700; margin-top: .25rem; overflow-wrap: anywhere; user-select: all; }
.copy-feedback { padding-block: .36rem; min-height: 1.5rem; color: var(--aqua); font-size: .88rem; }
.copy-feedback:empty { min-height: .75rem; padding: 0; }
.text-link { color: var(--text); text-underline-offset: .23em; font-weight: 680; font-size: .94rem; }

.section-heading { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: end; gap: clamp(.9rem, 4.1vw, 3.5rem); }
.world-grid, .roles-grid { display: grid; margin-top: clamp(1.35rem, 3vw, 2.5rem); gap: .9rem; }
.world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.world-card { --card-accent: var(--aqua); padding: 1.45rem; background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--card-accent); border-radius: .6rem; }
.world-card.emergency { --card-accent: var(--coral); }
.world-card.underworld { --card-accent: var(--violet); }
.world-card h3 { color: var(--card-accent); }
.roles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.roles-grid article { border-left: 2px solid var(--border); padding: .15rem 0 .2rem .9rem; }
.roles-grid article:nth-child(2) { border-color: var(--coral); }
.roles-grid article:nth-child(3) { border-color: var(--gold); }
.roles-grid article:nth-child(4) { border-color: var(--violet); }

.system-list { border: 1px solid var(--border); border-radius: .65rem; background: var(--bg); }
.system-list details + details { border-top: 1px solid var(--border); }
.system-list summary { position: relative; min-height: 3.1rem; padding: .9rem 2.85rem .9rem 1.15rem; font-weight: 700; list-style: none; cursor: pointer; }
.system-list summary::-webkit-details-marker { display: none; }
.system-list summary::after { content: ''; position: absolute; right: 1.25rem; top: 1.24rem; width: .53rem; height: .53rem; border: solid var(--aqua); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.system-list details[open] summary::after { transform: translateY(.23rem) rotate(225deg); }
.system-list details p { padding: 0 1.15rem .95rem; }
.rules-links { display: grid; gap: .7rem; }
.rules-links a { display: grid; gap: .35rem; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--raised); text-decoration: none; }
.rules-links a:hover { border-color: var(--aqua); }
.rules-links strong { color: var(--aqua); }
.rules-links span { color: var(--muted); font-size: .95rem; }

.footer-inner { min-height: 6.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner > small { color: var(--muted); font-size: .85rem; }

@media (max-width: 850px) {
  .header-inner { flex-wrap: wrap; padding-block: .65rem; }
  .enhanced .header-inner { position: relative; }
  .enhanced #navigation { display: none; }
  .enhanced #navigation.open { position: absolute; top: calc(100% + 1px); right: 0; width: min(18rem, 100%); padding: 1rem; display: flex; flex-direction: column; align-items: stretch; gap: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 .6rem .6rem; box-shadow: 0 14px 45px #0008; }
  html:not(.enhanced) .site-header { position: static; }
  html:not(.enhanced) #navigation { flex-wrap: wrap; width: 100%; }
  .hero-content { grid-template-columns: minmax(0, 1fr); gap: 1.7rem; padding-block: 3rem; }
  .hero-visual { max-height: 27rem; }
  .roles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.35rem 1rem; }
}

@media (max-width: 620px) {
  .section-heading, .connection-grid, .feature-grid, .world-grid { grid-template-columns: minmax(0, 1fr); }
  .section-heading { gap: .72rem; }
  .footer-inner { flex-wrap: wrap; justify-content: flex-start; padding-block: 1.3rem; }
  .footer-inner .brand { width: 100%; }
  .footer-inner nav { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
