@font-face {
  font-family: 'Fraunces';
  src: url('./assets/fonts/fraunces-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('./assets/fonts/fraunces-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('./assets/fonts/jetbrains-mono.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
}

:root {
  --ink: #1b1b1d;
  --muted: #4f4f53;
  --paper: #f3f2ee;
  color-scheme: light;
}

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

html {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #f3f2ee;
}

html::before {
  content: "";
  position: fixed;
  z-index: -1;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100lvh;
  pointer-events: none;
  background-color: #f3f2ee;
  background-image:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.35) 28%, transparent 56%),
    radial-gradient(circle at 16% 86%, rgba(226, 224, 218, 0.55), transparent 46%);
  background-repeat: no-repeat;
}

body {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  background-color: #f3f2ee;
}

#experience { display: none; }

#static,
html.enhanced #experience {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

.copy {
  width: min(34rem, 100%);
  padding:
    calc(1.4rem + env(safe-area-inset-top))
    calc(1.2rem + env(safe-area-inset-right))
    1.2rem
    calc(1.2rem + env(safe-area-inset-left));
}

h1 {
  color: #1b1b1d;
  font-weight: 460;
  font-size: clamp(2.7rem, 12vw, 3.5rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
}

h1 br + * ,
.copy h1 {
  font-style: normal;
}

.tagline {
  max-width: 34ch;
  margin-top: 1.15rem;
  color: var(--muted);
  font-size: clamp(1rem, 4.2vw, 1.18rem);
  line-height: 1.45;
  font-weight: 430;
}

.tagline em {
  color: var(--ink);
  font-style: italic;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 100%;
  margin-top: 1.45rem;
  padding: 0.78rem 0.85rem 0.78rem 1.15rem;
  border: 1px solid rgba(27, 27, 29, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1b1b1d;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1;
}

.cta .arrow {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #1b1b1d;
  color: #fff;
  flex: none;
}

.cta svg { width: 0.95rem; height: 0.95rem; }

.stage {
  position: relative;
  width: 100%;
  min-height: 52dvh;
  height: 58dvh;
}

#webgl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  background: transparent;
}

html.is-mobile #webgl { pointer-events: none; }

html.enhanced #experience,
html.enhanced #experience .stage,
#webgl {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html.can-scroll,
html.can-scroll body {
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

html.can-scroll #experience,
html.can-scroll #webgl {
  touch-action: pan-y;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(243, 242, 238, 0.92);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

html.ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-line {
  width: min(9rem, 40vw);
  height: 2px;
  overflow: hidden;
  background: rgba(27, 27, 29, 0.12);
}

.loader-line span {
  display: block;
  width: 40%;
  height: 100%;
  background: #1b1b1d;
  animation: load 1.1s ease-in-out infinite;
}

@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

html.reduce-motion .loader-line span { animation: none; width: 100%; }

@media (min-width: 901px) {
  #static,
  html.enhanced #experience {
    display: grid;
    grid-template-columns: minmax(18rem, 36vw) minmax(0, 1fr);
    align-items: stretch;
  }

  .copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top) + 1.2rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 8vh);
    padding-left: calc(clamp(4.5rem, 9vw, 10.5rem) + env(safe-area-inset-left));
    padding-right: 1.2rem;
  }

  h1 { font-size: clamp(3.8rem, 6.15vw, 6.7rem); }

  .tagline { font-size: clamp(1.05rem, 1.35vw, 1.28rem); }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (max-width: 900px) {
  #static,
  html.enhanced #experience {
    display: block;
    min-height: 100dvh;
  }

  html.enhanced:not(.reduce-motion) .copy {
    position: relative;
    z-index: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top) + 0.4rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 11vh);
  }

  html.enhanced .cta {
    position: relative;
    z-index: 4;
  }

  html.enhanced:not(.reduce-motion) .stage {
    position: fixed;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    pointer-events: none;
  }
}

@media (max-width: 430px) {
  h1 { font-size: clamp(2.45rem, 12.4vw, 3.05rem); }
  .tagline { font-size: 0.98rem; }
  .cta { font-size: 0.62rem; letter-spacing: 0.11em; }
}

@media (max-width: 900px) and (max-height: 520px) {
  html.enhanced:not(.reduce-motion) .copy {
    padding-bottom: calc(env(safe-area-inset-bottom) + 4vh);
  }

  h1 { font-size: clamp(1.7rem, 8vh, 2.35rem); }
  .tagline { margin-top: 0.45rem; font-size: 0.86rem; }
  .cta { margin-top: 0.7rem; }
}

@media (max-height: 520px) and (orientation: landscape) and (min-width: 901px) {
  #static,
  html.enhanced #experience {
    display: grid;
    grid-template-columns: minmax(13.5rem, 46vw) minmax(0, 1fr);
    min-height: 100dvh;
  }

  .copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    padding-top: calc(0.7rem + env(safe-area-inset-top));
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
  }

  h1 { font-size: clamp(1.8rem, 6vh, 2.6rem); }
  .tagline { margin-top: 0.55rem; font-size: 0.86rem; }
  .cta { margin-top: 0.75rem; }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  h1 { font-size: 4.4rem; }
  .tagline { font-size: 1.2rem; }
  .stage { min-height: 62dvh; }
}

.credits-toggle {
  position: fixed;
  z-index: 6;
  right: calc(0.95rem + env(safe-area-inset-right));
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(27, 27, 29, 0.16);
  border-radius: 999px;
  background: rgba(243, 242, 238, 0.94);
  color: #1b1b1d;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(27, 27, 29, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.credits-toggle:hover {
  background: #fff;
  border-color: rgba(27, 27, 29, 0.32);
  transform: translateY(-1px);
}

.credits-toggle:focus-visible,
.credits-close:focus-visible,
.credits-sheet a:focus-visible {
  outline: 2px solid #1b1b1d;
  outline-offset: 3px;
}

.credits-dialog {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  background: rgba(27, 27, 29, 0.28);
  backdrop-filter: blur(8px);
  overscroll-behavior: none;
}

.credits-dialog[hidden] { display: none; }

html.credits-open,
html.credits-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.credits-sheet {
  width: min(36rem, 100%);
  max-height: min(82dvh, 44rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 12px 16px 0;
  border: 1px solid rgba(27, 27, 29, 0.12);
  border-radius: 1.35rem;
  background: #f7f6f2;
  color: #1b1b1d;
  box-shadow: 0 24px 70px rgba(27, 27, 29, 0.16);
}

.credits-head {
  position: relative;
  flex: none;
  padding: 1.3rem 5.4rem 0.85rem 1.4rem;
}

.credits-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0.15rem 1.15rem 1.25rem 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 27, 29, 0.38) transparent;
}

.credits-scroll::-webkit-scrollbar {
  width: 6px;
}

.credits-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 4px 12px 0;
}

.credits-scroll::-webkit-scrollbar-thumb {
  background: rgba(27, 27, 29, 0.38);
  border-radius: 999px;
}

.credits-close {
  position: absolute;
  top: 1.15rem;
  right: 1.05rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(27, 27, 29, 0.16);
  border-radius: 999px;
  background: transparent;
  color: #1b1b1d;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.credits-close:hover { background: #fff; }

.credits-kicker {
  margin: 0.15rem 0 0.35rem;
  color: #6a6a6e;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credits-sheet h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 480;
  letter-spacing: -0.03em;
  line-height: 1;
}

.credits-lead {
  max-width: 36ch;
  margin: 0 0 1.05rem;
  color: #4f4f53;
  font-size: 1.02rem;
  line-height: 1.4;
}

.credits-sheet section + section { margin-top: 1.15rem; }

.credits-sheet h3 {
  margin-bottom: 0.55rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credits-sheet article {
  padding: 0.75rem 0;
  border-top: 1px solid rgba(27, 27, 29, 0.1);
}

.credits-sheet h4 {
  font-size: 1.05rem;
  font-weight: 520;
  letter-spacing: -0.02em;
}

.credits-sheet article p {
  margin-top: 0.28rem;
  color: #3c3c40;
  font-size: 0.92rem;
  line-height: 1.4;
}

.credits-sheet a {
  color: #1b1b1d;
}

.credits-sheet .licence {
  color: #6a6a6e;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.credits-sign {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(27, 27, 29, 0.12);
  font-size: 0.95rem;
}

@media (min-width: 760px) {
  .credits-dialog { place-items: center; }
  .credits-head { padding: 1.5rem 5.6rem 0.9rem 1.7rem; }
  .credits-scroll { padding: 0.2rem 1.35rem 1.4rem 1.7rem; }
  .credits-close { top: 1.35rem; right: 1.25rem; }
}
