@font-face {
  font-family: "Michroma";
  src: url("fonts/michroma-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Michroma";
  src: url("fonts/michroma-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}

:root {
  --night: #04070e;
  --pale: #f1ebdd;
  --soft: #d6cbb6;
  --dim: #b5a78e;
  --flame: #d9b36c;
  --sans: "Barlow", "Segoe UI", sans-serif;
  --title: "Michroma", "Eurostile", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse 75% 75% at 50% 42%, #0a1322 0%, var(--night) 70%);
  color: var(--pale);
  font-family: var(--sans);
  font-style: normal;
  font-synthesis: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("korn.png") 0 0 / 80px;
}

.door {
  --side: min(172vw, 100svh);
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--side);
  height: var(--side);
  margin: calc(var(--side) / -2) 0 0 calc(var(--side) / -2);
  container-type: size;
  text-align: center;
  transform-origin: 50% 34%;
  transition: transform 1.9s cubic-bezier(.6, 0, .85, .3), opacity 1.2s .7s ease;
}

.lock { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.glow { animation: light 4.5s .3s cubic-bezier(.3, 0, .4, 1) both, flicker 7.3s 4.8s ease-in-out infinite; }
@keyframes light {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  6% { opacity: .9; }
  9% { opacity: .98; }
  15% { opacity: .86; }
  19% { opacity: .96; }
  31% { opacity: 1; }
  38% { opacity: .82; }
  42% { opacity: .93; }
  47% { opacity: .87; }
  55% { opacity: .99; }
  63% { opacity: .92; }
  68% { opacity: .79; }
  72% { opacity: .94; }
  80% { opacity: 1; }
  86% { opacity: .89; }
  91% { opacity: .97; }
}

.shade { fill: #04060b; opacity: 0; transform: translate(708px, 40px) scale(.8); }

.edge, .seal { fill: none; vector-effect: non-scaling-stroke; }
.edge { stroke: rgba(217, 179, 108, .62); stroke-width: 1; }
.seal { stroke: rgba(217, 179, 108, .3); stroke-width: 1; }
.edge, .seal, .ring { animation: appear 2.2s 1.5s ease both; }
.ring {
  fill: var(--soft);
  font-family: var(--title);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1, .vow, .enter, .adult, .legal { position: absolute; left: 0; right: 0; }

h1 {
  top: 26%;
  font-family: var(--title);
  font-size: max(1.2rem, 3.1cqw);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .1em;
  margin-right: -.1em;
  text-transform: uppercase;
  animation: appear 2.2s 2.2s ease both;
}
.vow {
  top: 34.5%;
  color: var(--soft);
  font-size: max(1rem, 2cqw);
  letter-spacing: .01em;
  animation: appear 2.2s 3.1s ease both;
}
.enter {
  top: 64.5%;
  width: max-content;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  color: var(--pale);
  font-size: max(1.05rem, 2.15cqw);
  letter-spacing: .03em;
  text-decoration: underline;
  text-decoration-color: rgba(217, 179, 108, .7);
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
  transition: color .4s ease;
  animation: appear 1.8s 3.6s ease both;
}
.enter:hover { color: var(--flame); }
.adult {
  top: 86.5%;
  color: var(--dim);
  font-size: max(.75rem, 1.35cqw);
  line-height: 1.35;
  animation: appear 1.8s 3.6s ease both;
}
.legal {
  top: 92.5%;
  width: max-content;
  height: 7.5%;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 .75rem;
  display: flex;
  align-items: center;
  color: var(--dim);
  font-size: max(.75rem, 1.35cqw);
  text-decoration-color: rgba(217, 179, 108, .45);
  text-underline-offset: .25em;
  transition: color .4s ease;
  animation: appear 1.8s 3.6s ease both;
}
.legal:hover { color: var(--flame); }

:focus-visible { outline: 1px solid var(--flame); outline-offset: 3px; }
::selection { background: var(--flame); color: var(--night); }

.inside {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--soft);
  font-size: 1.25rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 0s 1.2s;
}
.inside a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--dim);
  font-size: 1rem;
}
.inside:target { opacity: 1; visibility: visible; transition: opacity 1.4s 1.5s ease; }
body:has(.inside:target) .door {
  transform: scale(8);
  opacity: 0;
  pointer-events: none;
  transition: transform 1.9s cubic-bezier(.6, 0, .85, .3), opacity 1s 1s ease;
}
body:has(.inside:target) .shade { animation: notice .8s .2s ease-in both; }
body:has(.inside:target) .glow { animation: dim 1s 1s ease-in-out both; }

@keyframes notice {
  from { opacity: 0; }
  to { opacity: .86; }
}
@keyframes dim {
  from { opacity: 1; }
  to { opacity: .4; }
}

@media (max-aspect-ratio: 3/4) {
  .shade { transform: translate(640px, 40px) scale(.8); }
}

@media (max-height: 520px) {
  .enter { top: 60%; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .adult {
    top: auto;
    bottom: 4%;
    left: calc(100% + .5rem);
    right: auto;
    width: min(11rem, calc(50vw - 50cqw - .75rem));
    text-align: left;
  }
  .adult br { display: none; }
  .legal {
    top: auto;
    bottom: 0;
    left: auto;
    right: calc(100% + .5rem);
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow, .edge, .seal, .ring, h1, .vow, .enter, .adult, .legal { animation: none; }
  .door, .inside, .inside:target { transition: none; }
  body:has(.inside:target) .door { transform: none; transition: none; }
  body:has(.inside:target) .shade, body:has(.inside:target) .glow { animation: none; }
}
