:root {
  color-scheme: light dark;
  --fg: #243c52;
  --link: #145b91;
  --panel: #fff;
  --edge: #dcebf5;
  --cloud: rgba(255, 255, 255, 0.8);
  --shadow: 0 16px 48px rgba(46, 91, 127, 0.13);
  background: #eaf6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 72px 16px;
  isolation: isolate;
  overflow-x: hidden;
  overflow-x: clip;
  background: linear-gradient(165deg, #b8def8 0%, #e1f2ff 55%, #f4faff 100%);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Decorative layers stay behind the panels and cannot intercept links. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  width: 260px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 30% 65%, var(--cloud) 0 30%, transparent 31%),
    radial-gradient(ellipse at 53% 44%, var(--cloud) 0 37%, transparent 38%),
    radial-gradient(ellipse at 77% 66%, var(--cloud) 0 27%, transparent 28%);
  filter: blur(3px);
  animation: drift 75s ease-in-out infinite alternate;
}

body::before { top: 3vh; left: -40px; }
body::after {
  top: 64vh;
  right: -30px;
  width: 340px;
  height: 155px;
  opacity: 0.7;
  animation-duration: 95s;
  animation-delay: -35s;
  animation-direction: alternate-reverse;
}

@keyframes drift {
  from { transform: translateX(-24px); }
  to { transform: translateX(64px); }
}

main {
  max-width: 744px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--edge);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; border-radius: 2px; }
h1, h2, h3 {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 0.5rem 0 1rem; letter-spacing: -0.025em; }
h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
ul { padding-left: 1.4em; }
main > :first-child { margin-top: 0; }
main > :last-child { margin-bottom: 0; }

@media (max-width: 480px) {
  body { padding-block: 32px; }
  main { border-radius: 24px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e4edf7;
    --link: #9bd4ff;
    --panel: rgba(19, 35, 58, 0.94);
    --edge: #30465f;
    --cloud: rgba(140, 162, 191, 0.13);
    --shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    background: #080f20;
  }
  body {
    background:
      radial-gradient(circle at 12% 12%, #8c9db5 0 1px, transparent 1.5px),
      radial-gradient(circle at 82% 22%, #8c9db5 0 1px, transparent 1.5px),
      radial-gradient(circle at 36% 72%, #697b96 0 1px, transparent 1.5px),
      radial-gradient(circle at 92% 85%, #697b96 0 1px, transparent 1.5px),
      linear-gradient(165deg, #080f20, #162942);
    background-attachment: fixed;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}
