/* Colour tokens for both themes, shared by every page and sub-domain.
   Light is the default; html[data-theme="dark"] is the original night-sky look. */
:root{
  color-scheme:light;
  --bg:#f8f5ee;
  --bg2:#eee6d6;
  --bg-glow-1:rgba(240,196,98,.30);
  --bg-glow-2:rgba(126,156,224,.16);
  --surface:rgba(255,255,255,.72);
  --surface-hover:rgba(255,255,255,.95);
  --surface-solid:#fffdf8;
  --card-shadow:0 1px 2px rgba(70,52,18,.05),0 10px 30px rgba(70,52,18,.07);
  --line:rgba(23,28,47,.11);
  --line-strong:rgba(23,28,47,.2);
  --text:#161b2e;
  --text-body:#30374d;
  --muted:#585f74;
  --field-label:#4f566b;
  --placeholder:rgba(23,28,47,.4);
  --accent:#8a5800;
  --accent-strong:#7c5000;
  --glow-text:#a86b04;
  --kicker:#0a6c80;
  --gold:#f3c969;
  --gold-soft:#ffe9b0;
  --on-gold:#211904;
  --btn-grad:linear-gradient(120deg,#ecbd4f,#f8dc90);
  --btn-shadow:0 8px 22px rgba(176,125,18,.28);
  --btn-shadow-hover:0 14px 34px rgba(176,125,18,.4);
  --gold-line:rgba(176,125,18,.28);
  --gold-line-mid:rgba(176,125,18,.42);
  --gold-line-hover:rgba(176,125,18,.55);
  --gold-line-strong:#c4922f;
  --gold-tint:rgba(243,201,105,.22);
  --gold-tint-2:rgba(243,201,105,.08);
  --focus-ring:rgba(201,150,46,.25);
  --soft-glow:rgba(243,201,105,.55);
  --teal:#0a6c80;
  --teal-tint:rgba(10,108,128,.07);
  --teal-tint-hover:rgba(10,108,128,.13);
  --teal-line:rgba(10,108,128,.3);
  --on-teal:#ffffff;
  --teal-glow:rgba(10,108,128,.25);
  --violet-tint:rgba(250,248,255,.88);
  --violet-line:rgba(104,84,214,.24);
  --shadow:0 18px 44px rgba(70,52,18,.12);
  --shadow-strong:0 28px 70px rgba(70,52,18,.18);
  --nav-bg:rgba(250,247,241,.84);
  --menu-bg:#fffdf8;
  --panel-bg:rgba(251,248,242,.98);
  --dialog-bg:#fffdf8;
  --backdrop:rgba(40,32,15,.38);
  --input-bg:rgba(255,255,255,.82);
  --input-bg-focus:#ffffff;
  --star:#c4922f;
  --star-opacity:.5;
  --grain:.025;
  --ok:#7c5000;
  --error:#b42318;
  --video-shadow:0 22px 55px rgba(70,52,18,.18);
  --video-shadow-hover:0 30px 70px rgba(70,52,18,.26);
  --video-line-hover:rgba(10,108,128,.5);
  --notice-veil-1:rgba(248,245,238,.94);
  --notice-veil-2:rgba(248,245,238,.6);
  --notice-grad:linear-gradient(160deg,#d29a2c 5%,#a96c05 45%,#6e4500 100%);
  --notice-glow:0 0 18px rgba(243,201,105,.45);
  --notice-drop:drop-shadow(0 1px 0 rgba(255,255,255,.85));
  --selection:rgba(243,201,105,.45);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#04060f;
  --bg2:#0a0f24;
  --bg-glow-1:rgba(155,140,255,.25);
  --bg-glow-2:rgba(95,230,255,.12);
  --surface:rgba(255,255,255,.035);
  --surface-hover:rgba(255,255,255,.06);
  --surface-solid:#0b1027;
  --card-shadow:none;
  --line:rgba(255,255,255,.09);
  --line-strong:rgba(255,255,255,.14);
  --text:#e8ecf7;
  --text-body:#e1e6f3;
  --muted:#8b93ad;
  --field-label:rgba(232,236,247,.7);
  --placeholder:rgba(232,236,247,.42);
  --accent:#f3c969;
  --accent-strong:#ffe9b0;
  --glow-text:#ffe9b0;
  --kicker:#5fe6ff;
  --on-gold:#04060f;
  --btn-grad:linear-gradient(120deg,#f3c969,#ffe9b0);
  --btn-shadow:0 0 30px rgba(243,201,105,.45);
  --btn-shadow-hover:0 0 50px rgba(243,201,105,.7);
  --gold-line:rgba(243,201,105,.3);
  --gold-line-mid:rgba(243,201,105,.5);
  --gold-line-hover:rgba(243,201,105,.4);
  --gold-line-strong:#f3c969;
  --gold-tint:rgba(243,201,105,.14);
  --gold-tint-2:rgba(243,201,105,.04);
  --focus-ring:rgba(243,201,105,.18);
  --soft-glow:rgba(243,201,105,.4);
  --teal:#5fe6ff;
  --teal-tint:rgba(95,230,255,.07);
  --teal-tint-hover:rgba(95,230,255,.15);
  --teal-line:rgba(95,230,255,.25);
  --on-teal:#04060f;
  --teal-glow:rgba(95,230,255,.35);
  --violet-tint:rgba(155,140,255,.09);
  --violet-line:rgba(155,140,255,.3);
  --shadow:0 20px 50px rgba(0,0,0,.4);
  --shadow-strong:0 30px 80px rgba(0,0,0,.6);
  --nav-bg:rgba(4,6,15,.74);
  --menu-bg:#0d1330;
  --panel-bg:rgba(8,12,30,.97);
  --dialog-bg:#0b1027;
  --backdrop:rgba(2,3,10,.72);
  --input-bg:rgba(255,255,255,.05);
  --input-bg-focus:rgba(255,255,255,.08);
  --star:#ffffff;
  --star-opacity:1;
  --grain:.04;
  --ok:#ffe9b0;
  --error:#ff9e9e;
  --video-shadow:0 0 60px rgba(95,230,255,.12);
  --video-shadow-hover:0 0 80px rgba(95,230,255,.3);
  --video-line-hover:rgba(95,230,255,.55);
  --notice-veil-1:rgba(4,6,15,.86);
  --notice-veil-2:rgba(4,6,15,.45);
  --notice-grad:linear-gradient(160deg,#fff6c9 5%,#ffdf7f 42%,#eab63b 100%);
  --notice-glow:0 0 14px rgba(255,206,79,.22);
  --notice-drop:drop-shadow(0 2px 3px rgba(4,6,15,.95));
  --selection:rgba(243,201,105,.35);
}

/* ---------- base ---------- */
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:'Sora',sans-serif;background:var(--bg);color:var(--text);overflow-x:hidden;line-height:1.6}
::selection{background:var(--selection)}
:focus-visible{outline:2px solid var(--kicker);outline-offset:3px}

.bg-layer{position:fixed;inset:0;z-index:-2;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, var(--bg-glow-2), transparent 60%),
    linear-gradient(180deg,var(--bg),var(--bg2))}
.stars{position:fixed;inset:0;z-index:-1;overflow:hidden;opacity:var(--star-opacity)}
.star{position:absolute;background:var(--star);border-radius:50%;
  animation:twinkle var(--d) ease-in-out infinite alternate;opacity:.7}
@keyframes twinkle{from{opacity:.15;transform:scale(.6)}to{opacity:1;transform:scale(1.2)}}
.grain{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:var(--grain);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}

/* colours glide over when the theme is switched */
html.theme-switching,html.theme-switching *,html.theme-switching *::before,html.theme-switching *::after{
  transition:background-color .45s ease,color .45s ease,border-color .45s ease,box-shadow .45s ease,fill .45s ease!important}

/* ---------- theme switch button ---------- */
.theme-toggle{display:inline-grid;place-items:center;flex:none;width:42px;height:42px;border-radius:50%;
  cursor:pointer;color:var(--text);background:var(--surface);border:1px solid var(--line-strong);
  box-shadow:var(--card-shadow);transition:color .3s,border-color .3s,transform .3s}
.theme-toggle:hover{color:var(--accent);border-color:var(--gold-line-strong);transform:rotate(-12deg)}
.theme-toggle svg{width:20px;height:20px;grid-area:1/1}
.theme-toggle .i-sun{display:none}
html[data-theme="dark"] .theme-toggle .i-sun{display:block}
html[data-theme="dark"] .theme-toggle .i-moon{display:none}
