:root {
  --ink: #0B0A0D;
  --surface: #141217;
  --raised: #1C1920;
  --hairline: #26222B;
  --pumpkin: #FF7A1A;
  --pumpkin-light: #FFB27A;
  --pumpkin-shade: #2B1A10;
  --witch: #A88BF5;
  --witch-deep: #6E56C9;
  --witch-shade: #211A33;
  --night: #120B1C;
  --candle: #FFD27A;
  --bone: #F2E8DC;
  --ash: #9C938D;
  --blood: #E5484D;
  --leaf: #5BD38A;
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pumpkin-light); }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--witch); outline-offset: 2px; }

.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.sky-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 85% -5%, rgba(110, 86, 201, .38), transparent 70%),
    radial-gradient(60% 50% at 8% 108%, rgba(255, 122, 26, .20), transparent 70%),
    linear-gradient(180deg, rgba(18, 11, 28, .55), rgba(11, 10, 13, .9));
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: var(--pumpkin); color: #1A0F08; font-weight: 700; text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(14, 12, 18, .72); backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--bone); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(255, 122, 26, .45)); }
.brand small { display: block; color: var(--witch); font-size: 10.5px; letter-spacing: .16em; font-weight: 700; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: 12px; flex: 1; }
.nav a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--ash); font-weight: 600;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a:hover { color: var(--bone); background: var(--raised); }
.nav a[aria-current="page"] { color: var(--bone); background: var(--witch-shade); box-shadow: inset 0 0 0 1px rgba(168, 139, 245, .45); }
.user { position: relative; }
.user-button {
  display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline); transition: border-color .25s var(--ease);
}
.user-button:hover { border-color: var(--witch-deep); }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 13px;
  color: #1A0F08; background: linear-gradient(160deg, var(--pumpkin-light), var(--pumpkin));
}
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 8px; border-radius: 16px;
  background: rgba(20, 18, 23, .96); border: 1px solid var(--hairline); box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: rise .28s var(--ease);
}
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-radius: 10px; background: none;
  color: var(--bone); text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--raised); }
.menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 6px 0; }

.outlet { position: relative; z-index: 1; width: min(1180px, 100%); margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 80px; outline: none; }
.page { animation: page-in .5s var(--ease) both; }
.page.leaving { animation: page-out .18s ease-in both; }

.boot { display: grid; justify-items: center; gap: 14px; padding: 18vh 0; color: var(--ash); }
.boot img { animation: bob 2.4s ease-in-out infinite; }

.kicker { color: var(--witch); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.title { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; font-weight: 800; text-shadow: 0 2px 22px rgba(0, 0, 0, .8); }
.muted { color: var(--ash); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.noscript { padding: 40px; text-align: center; }

@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
