@font-face {
  font-family: Wonton;
  src: url('/font/wonton.woff') format('woff');
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #b8c1d1;
  --veil: linear-gradient(115deg, #dce1ee97, #c6ccdf40 65%, #65738b24);
  --surface: #e9edf7;
  --surface-end: #c4cee4;
  --border: #f8f9ffe0;
  --text: #1d2636;
  --muted: #45546a;
  --accent: #8e301f;
  --focus: #313dae;
  --logo-shadow: #302722d9;
  --shadow: #11182e52;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    color-scheme: dark;
    --bg: #151d30;
    --veil: linear-gradient(115deg, #10192bb5, #111b2e64 65%, #1017275e);
    --surface: #151e2e;
    --surface-end: #233149;
    --border: #586781;
    --text: #f6f5ff;
    --muted: #c1cadf;
    --accent: #ffb595;
    --focus: #adb7ff;
    --logo-shadow: #101827a8;
    --shadow: #070b16a6;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #151d30;
  --veil: linear-gradient(115deg, #10192bb5, #111b2e64 65%, #1017275e);
  --surface: #151e2e;
  --surface-end: #233149;
  --border: #586781;
  --text: #f6f5ff;
  --muted: #c1cadf;
  --accent: #ffb595;
  --focus: #adb7ff;
  --logo-shadow: #101827a8;
  --shadow: #070b16a6;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 'Trebuchet MS', Arial, system-ui, sans-serif;
}

a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.scene, .scene picture, .scene picture img, .scene::after, .drift {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene { position: fixed; overflow: hidden; pointer-events: none; }
.scene picture img { display: block; object-fit: cover; }
.scene::after { content: ''; background: var(--veil); }
.drift { position: fixed; z-index: 1; overflow: hidden; pointer-events: none; }

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(20px, 4vh, 38px);
  min-height: 100vh;
  min-height: 100dvh;
  width: min(100%, 1424px);
  margin-inline: auto;
  padding: clamp(18px, 3.8vh, 42px) clamp(16px, 3vw, 44px);
  pointer-events: none;
}

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header nav, main { pointer-events: auto; }

.logo {
  display: block;
  width: clamp(114px, 18vw, 174px);
  height: auto;
  filter: drop-shadow(0 2px 4px var(--logo-shadow));
}

nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

nav a {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

nav a:hover, nav [aria-current] {
  border-color: var(--border);
  background: var(--surface-end);
  color: var(--text);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-self: start;
  min-height: clamp(400px, 38vw, 520px);
  margin-block-start: clamp(14px, 5vh, 58px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(18px, 2.4vw, 30px);
  background: linear-gradient(110deg, var(--surface) 42%, var(--surface-end));
  box-shadow: 0 28px 75px var(--shadow);
}

.content {
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
  padding: clamp(28px, 4.5vw, 64px) 8px clamp(28px, 4.5vw, 64px) clamp(28px, 4.5vw, 64px);
}

.art {
  position: relative;
  min-width: 0;
  margin-left: -18%;
  mask-image: linear-gradient(90deg, transparent, #000 34%);
}

.art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 60%;
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 400 clamp(34px, 3.95vw, 56px)/1.13 Wonton, 'Trebuchet MS', sans-serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.lead, .detail { max-width: 46ch; margin: 0; color: var(--muted); }
.lead { margin-top: 20px; font-size: clamp(16px, 1.55vw, 19px); }
.detail { margin-top: 8px; font-size: 15px; }
.community { margin-top: 24px; }

.discord {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 10px 20px;
  overflow: hidden;
  border: 1px solid #5966d9;
  border-radius: 12px;
  background: #2b378e;
  box-shadow: 0 6px 18px #141d703d;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.discord img { display: block; flex: none; }

.discord::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: linear-gradient(105deg, #303de1, #3c50d5 55%, #3c5bcd 89%, #4f65e3);
  transform: translateX(-101%);
}

.discord:is(:hover, :focus-visible)::before { transform: translateX(0); }

.drift i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  visibility: hidden;
}

.drift i::before {
  position: absolute;
  inset: 15% 0;
  clip-path: polygon(0 50%, 25% 36%, 18% 16%, 47% 32%, 59% 0, 67% 33%, 91% 22%, 83% 47%, 100% 55%, 63% 68%, 55% 100%, 45% 70%, 17% 79%);
  background: var(--leaf, #d26947);
  content: '';
}

.drift i:nth-child(1) { --x: 4%; --size: 16px; --start: 9vh; --sway: 11vw; }
.drift i:nth-child(2) { --x: 14%; --size: 12px; --start: 52vh; --sway: -6vw; --leaf: #f0ac67; }
.drift i:nth-child(3) { --x: 25%; --size: 20px; --start: 28vh; --sway: 8vw; }
.drift i:nth-child(4) { --x: 39%; --size: 11px; --start: 64vh; --sway: -8vw; }
.drift i:nth-child(5) { --x: 48%; --size: 13px; --start: 5vh; --sway: 10vw; --leaf: #f0ac67; }
.drift i:nth-child(6) { --x: 60%; --size: 17px; --start: 45vh; --sway: -10vw; }
.drift i:nth-child(7) { --x: 71%; --size: 12px; --start: 21vh; --sway: 8vw; }
.drift i:nth-child(8) { --x: 80%; --size: 22px; --start: 55vh; --sway: -13vw; --leaf: #f0ac67; }
.drift i:nth-child(9) { --x: 88%; --size: 15px; --start: 12vh; --sway: -12vw; }
.drift i:nth-child(10) { --x: 97%; --size: 12px; --start: 34vh; --sway: -9vw; }

@media (prefers-reduced-motion: no-preference) {
  .discord::before { transition: transform 450ms cubic-bezier(.2, .7, .25, 1); }
  .drift i { animation: fall 4.8s linear both; pointer-events: auto; }
  .drift i[data-broken] { animation-play-state: paused; pointer-events: none; }
  .drift i[data-broken]::before { visibility: hidden; }
  .drift i[data-broken]::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    color: var(--leaf, #d26947);
    background: currentColor;
    box-shadow: -7px 4px, 5px -8px, 7px 6px, -5px -6px;
    content: '';
    animation: scatter 380ms ease-out both;
  }
}

@keyframes fall {
  0% { transform: translate3d(0, var(--start), 0) rotate(-25deg); }
  1%, 97% { visibility: visible; }
  12%, 74% { opacity: .72; }
  100% { transform: translate3d(var(--sway), calc(var(--start) + 48vh), 0) rotate(135deg); }
}

@keyframes scatter {
  to { opacity: 0; transform: scale(3.5) rotate(32deg); }
}

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 720px);
    min-height: 0;
    margin-inline: auto;
    margin-block-start: 0;
  }

  .content { padding: clamp(22px, 5vw, 42px) clamp(20px, 5vw, 42px) 0; }
  h1 { font-size: clamp(30px, 6.3vw, 50px); }
  .art {
    min-height: clamp(180px, 61vw, 345px);
    margin: 8px 0 0;
    mask-image: linear-gradient(180deg, transparent, #000 27%);
  }

  .art img { object-position: 62% 58%; }
}
