@font-face {
  font-family: system-serif;
  src: local("Iowan Old Style"), local("Palatino Linotype"), local("Book Antiqua");
}

:root {
  color-scheme: light;
  --field: #df8a55;
  --ink: #321b1b;
  --muted: #6f3c35;
  --blue-deep: #071646;
  --pale: #ffedc7;
  --focus: #fff4cf;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--field);
}

body {
  position: fixed;
  inset: 0;
  min-width: 280px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

.experience {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at 14% 88%, rgb(255 220 177 / 0.26) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 13%, rgb(94 37 40 / 0.12) 0 1px, transparent 1.5px),
    linear-gradient(116deg, #e99b62 0%, var(--field) 45%, #d67b4c 100%);
  background-size: 26px 26px, 19px 19px, 100% 100%;
}

.intro {
  position: absolute;
  z-index: 4;
  top: clamp(26px, 5.5vh, 58px);
  left: clamp(24px, 4.7vw, 72px);
  max-width: min(27rem, 38vw);
}

h1 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.invitation {
  margin: 12px 0 0;
  max-width: 22rem;
  font-size: clamp(0.78rem, 1vw, 0.94rem);
  line-height: 1.4;
  color: var(--muted);
}

.aperture-shell {
  position: absolute;
  z-index: 1;
  width: min(74vw, 1110px);
  height: min(94vh, 870px);
  right: -7.5vw;
  top: 2.5vh;
  filter: drop-shadow(0 30px 58px rgb(70 24 36 / 0.24));
}

.aperture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  contain: strict;
  clip-path: polygon(8% 3%, 81% 0, 100% 19%, 94% 78%, 76% 100%, 17% 95%, 0 69%, 3% 25%);
  background: var(--blue-deep);
  box-shadow:
    inset 18px 0 42px rgb(3 11 43 / 0.55),
    inset -20px 0 50px rgb(74 103 183 / 0.16);
}

.aperture::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgb(2 8 39 / 0.38);
}

#dust-canvas {
  position: absolute;
  inset: -8%;
  display: block;
  width: 116%;
  height: 116%;
  transform: scale(1.03);
}

.depth-wash {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(132deg, rgb(2 8 37 / 0.30), transparent 28% 68%, rgb(2 8 37 / 0.42)),
    linear-gradient(108deg, rgb(85 125 204 / 0.12), transparent 34% 70%, rgb(2 8 42 / 0.25));
  mix-blend-mode: screen;
}

.depth-feedback {
  position: absolute;
  z-index: 5;
  left: clamp(24px, 4.7vw, 72px);
  bottom: clamp(84px, 11vh, 112px);
  width: clamp(150px, 15vw, 210px);
  color: var(--ink);
}

.depth-track {
  position: relative;
  height: 4px;
  margin: 0 0 12px;
  overflow: hidden;
  transform: skewX(-24deg);
  background: rgb(50 27 27 / 0.24);
}

.depth-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  background: currentColor;
  transform-origin: left;
}

.status {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
}

.experience.is-signature .status {
  color: var(--ink);
}

.hint,
.plane-controls span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hint {
  position: absolute;
  z-index: 5;
  left: clamp(24px, 4.7vw, 72px);
  bottom: clamp(32px, 4.2vh, 46px);
  margin: 0;
  color: var(--muted);
}

.hint span {
  display: inline-block;
  margin-right: 0.55em;
  font-size: 0.95rem;
}

.plane-controls {
  position: absolute;
  z-index: 6;
  right: clamp(18px, 3.4vw, 52px);
  bottom: clamp(18px, 4vh, 43px);
  display: flex;
  gap: 9px;
}

.plane-controls button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgb(255 235 203 / 0.76);
  border-radius: 12px 2px 12px 2px;
  color: var(--pale);
  background: rgb(8 24 75 / 0.88);
  box-shadow: 0 7px 25px rgb(29 15 27 / 0.17);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
}

.plane-controls button:hover {
  background: #1b3e99;
}

.plane-controls button:active {
  transform: scale(0.94);
}

.plane-controls button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.plane-controls svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plane-controls span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.poster {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--blue-deep);
  color: var(--pale);
}

.poster svg {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
}

.poster-haze {
  fill: #3567b8;
  opacity: 0.26;
}

.poster-dust {
  fill: none;
  stroke: #ffedc7;
  stroke-linecap: round;
  stroke-width: 5;
  stroke-dasharray: 0.5 5;
}

.poster-dust path + path {
  stroke: #69a4d5;
  stroke-width: 2;
  stroke-dasharray: 0.5 10;
  opacity: 0.48;
}

.poster p {
  position: absolute;
  bottom: 10%;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .intro {
    top: max(20px, calc(env(safe-area-inset-top) + 12px));
    left: 20px;
    max-width: calc(100vw - 40px);
  }

  h1 {
    font-size: 1.12rem;
  }

  .invitation {
    margin-top: 8px;
    max-width: 16rem;
    font-size: 0.75rem;
  }

  .aperture-shell {
    width: 119vw;
    height: 66vh;
    right: -27vw;
    top: 19vh;
  }

  .aperture {
    clip-path: polygon(10% 2%, 79% 0, 100% 23%, 91% 77%, 70% 100%, 13% 94%, 0 61%, 4% 23%);
  }

  #dust-canvas {
    transform: translateX(-7%) scale(1.04);
  }

  .depth-feedback {
    left: 20px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 68px));
    width: min(42vw, 164px);
  }

  .status {
    font-size: 0.76rem;
  }

  .hint {
    left: 20px;
    bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px));
    font-size: 0.55rem;
  }

  .plane-controls {
    right: 18px;
    bottom: max(19px, calc(env(safe-area-inset-bottom) + 12px));
  }

  .plane-controls button {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 370px), (max-height: 650px) {
  .invitation {
    display: none;
  }

  .aperture-shell {
    top: 17vh;
    height: 67vh;
  }

  .depth-feedback {
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
  }

  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :root {
    --field: Canvas;
    --ink: CanvasText;
    --muted: CanvasText;
    --pale: ButtonText;
  }

  .experience {
    background: Canvas;
  }

  .aperture {
    border: 2px solid CanvasText;
    forced-color-adjust: none;
  }

  .depth-feedback,
  .hint,
  .intro {
    forced-color-adjust: auto;
  }

  .plane-controls button {
    border: 2px solid ButtonText;
    color: ButtonText;
    background: ButtonFace;
    forced-color-adjust: auto;
  }

  .depth-track,
  .depth-fill {
    background: CanvasText;
  }
}
