:root {
  --sky-deep: #0B0E14;
  --sky-mid: #141A26;
  --panel: #1A2030;
  --panel-border: #2A3344;
  --steel: #5B7C99;
  --cream: #E8DCC8;
  --cream-dim: #9CA3AF;
  --warn: #FF6B47;
  --good: #4ADE80;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--sky-deep);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.storm-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(91, 124, 153, 0.35), transparent),
    linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-mid) 50%, var(--sky-deep) 100%);
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, #000 40%, transparent 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem);
  background: rgba(11, 14, 20, 0.85);
  border-bottom: 1px solid var(--panel-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cream);
  text-decoration: none;
}

.logo-mark { width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; }

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--cream-dim);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] { color: var(--cream); }

.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--warn); text-underline-offset: 6px; }

.nav-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--cream);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.page-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
}

.page-head h1 {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
}

.page-head p {
  margin-top: 0.75rem;
  color: var(--cream-dim);
  font-size: 1.05rem;
  max-width: 60ch;
}

footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  border-top: 1px solid var(--panel-border);
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--cream-dim);
}

footer a { color: var(--cream-dim); text-decoration: none; }
footer a:hover { color: var(--cream); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }

code, kbd {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(91, 124, 153, 0.14);
  border: 1px solid rgba(91, 124, 153, 0.28);
  padding: 0.05em 0.35em;
  color: var(--cream);
  white-space: nowrap;
}

a.inline { color: var(--cream); text-decoration: underline; text-decoration-color: var(--warn); text-underline-offset: 3px; }
a.inline:hover { color: var(--warn); }

@media (max-width: 1020px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sky-mid);
    border-bottom: 1px solid var(--panel-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.9rem clamp(1.5rem, 5vw, 4rem); display: block; }
  .nav-mobile-toggle { display: block; }
}
