:root {
  color-scheme: dark;
  --surface: #100c18;
  --panel: rgb(16 12 24 / 88%);
  --text: #f4edf5;
  --muted: #d1bfcf;
  --accent: #ff8fbf;
  --highlight: #42233a;
  --separator: rgb(255 143 191 / 55%);
}

* {
  box-sizing: border-box;
}

body {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: #181a1b;
  background-image: linear-gradient(135deg, #2a1822 0%, #1a1419 55%, #141518 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
  font-family: "Comic Sans MS", "Segoe UI", "Quicksand", ui-rounded, "Hiragino Maru Gothic ProN", system-ui, sans-serif;
}

#waifu {
  position: fixed;
  right: 2vw;
  bottom: 0;
  height: 92vh;
  max-width: 46vw;
  object-fit: contain;
  object-position: bottom right;
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 22%);
  mask-image: linear-gradient(to top, transparent 0%, #000 22%);
}

@media (max-width: 640px) {
  #waifu {
    height: 70vh;
    max-width: 90vw;
    right: 0;
    opacity: 0.12;
  }
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

.container {
  width: min(calc(100% - 2rem), 45rem);
  margin-inline: auto;
}

.site-footer {
  background: var(--panel);
}

.site-header,
main {
  background: var(--panel);
  border: 1px solid var(--accent);
}

.header-inner,
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.header-inner {
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.75rem;
}

nav {
  gap: 0.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-name,
nav a {
  text-decoration: none;
}

nav a,
.links span.muted {
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

.site-name {
  font-weight: 700;
}

nav a {
  padding: 0.375rem 0.625rem;
}

nav a:hover,
nav a[aria-current="page"] {
  background: var(--highlight);
}

nav a[aria-current="page"] {
  font-weight: 700;
}

main {
  flex: 1;
  margin-block: 1rem;
  padding-block: clamp(2.5rem, 8vw, 5rem);
  padding-inline: clamp(1rem, 4vw, 2rem);
}

main.home {
  text-align: center;
}

.video-wrap {
  max-width: 560px;
  margin: 1.25rem auto 0;
  border: 2px solid var(--accent);
  line-height: 0;
}

.video-wrap iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
}

#enter-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: linear-gradient(135deg, #2a1822 0%, #1a1419 55%, #141518 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.gate-hidden {
  opacity: 0;
  pointer-events: none;
}

.gate-name {
  font-size: 2rem;
}

.gate-prompt,
#music-toggle {
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
  color: var(--accent);
}

.gate-prompt {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  animation: gate-pulse 2s ease-in-out infinite alternate;
}

@keyframes gate-pulse {
  to {
    opacity: 0.65;
  }
}

#enter-gate:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

#music-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.375rem 0.625rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  #enter-gate {
    transition: none;
  }

  .gate-prompt {
    animation: none;
  }
}

h1,
h2 {
  margin: 0;
  color: var(--accent);
  line-height: 1.25;
}

h1 {
  font-size: clamp(1.75rem, 7vw, 3rem);
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.25rem;
}

p,
.links {
  margin-block: 0.75rem 0;
}

section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--separator);
}

.links {
  padding-inline-start: 1.25rem;
}

.links li + li {
  margin-top: 0.375rem;
}

.muted,
.site-footer {
  color: var(--muted);
}

.site-footer {
  padding-block: 1rem;
  border-top: 1px dashed var(--separator);
  font-size: 0.875rem;
}

.background-credit {
  display: block;
}
