:root {
  --bg: #050507;
  --ink: #f2f1ee;
  --mute: rgba(242, 241, 238, .55);
  --line: rgba(242, 241, 238, .18);
  --a: #d2dcff;
  --b: #f7e3c4;
  --sans: "SpaceGrotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "InstrumentSerif", Georgia, serif;
  --mono: "JetBrainsMono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(18px, 3vw, 44px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); height: 100%; }
body { font-family: var(--sans); font-weight: 300; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; background: #fff; opacity: 0; }
.flash.go { animation: flash 1.1s ease-out forwards; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.sep { margin: 0 10px; opacity: .5; }

/* bar */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 18px var(--gutter); transition: opacity 1s; }
body.is-loading .bar { opacity: 0; }
.bar__brand { font-weight: 500; letter-spacing: .02em; font-size: 14px; }
.bar__link, .link { background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); cursor: pointer; border-bottom: 1px solid transparent; transition: color .25s, border-color .25s; }
.bar__link:hover, .link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* stages: everything sits in the bottom band, moon above */
.stage { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: 120px var(--gutter) clamp(28px, 5vh, 56px); display: grid; justify-items: center; text-align: center; gap: 18px;
  background: linear-gradient(to top, rgba(5,5,7,.92) 0%, rgba(5,5,7,.55) 55%, rgba(5,5,7,0) 100%); pointer-events: none; }
.stage > * { pointer-events: auto; }
.stage.out { animation: stageOut .5s cubic-bezier(.76,0,.24,1) forwards; }
.stage.in > * { opacity: 0; transform: translateY(16px); animation: up .9s cubic-bezier(.2,.7,.2,1) forwards; }
.stage.in > :nth-child(2) { animation-delay: .12s; } .stage.in > :nth-child(3) { animation-delay: .24s; } .stage.in > :nth-child(4) { animation-delay: .36s; }
@keyframes up { to { opacity: 1; transform: none; } }
@keyframes stageOut { to { opacity: 0; transform: translateY(12px); } }

/* intro */
.title { font-weight: 300; font-size: clamp(50px, 7vw, 112px); line-height: .9; letter-spacing: -.04em; margin: 0; }
.title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.title .w { display: inline-block; opacity: 0; transform: translateY(110%) rotate(2deg); }
.stage--intro.in .title .w { animation: word 1.2s cubic-bezier(.2,.8,.2,1) forwards; }
.title .w:nth-child(2) { animation-delay: .1s !important; } .title em .w:nth-child(1) { animation-delay: .22s !important; } .title em .w:nth-child(2) { animation-delay: .32s !important; }
@keyframes word { to { opacity: 1; transform: none; } }
.sub { margin: 0; max-width: 40ch; color: var(--mute); font-size: clamp(15px, 1.2vw, 19px); }

.cta { display: inline-flex; align-items: center; justify-content: space-between; gap: 40px; min-width: 260px; padding: 18px 22px;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); font-weight: 500; font-size: 15px; letter-spacing: .02em; cursor: pointer; position: relative; overflow: hidden; }
.cta span, .cta i { position: relative; z-index: 1; font-style: normal; transition: color .35s; }
.cta::before { content: ""; position: absolute; inset: 0; background: var(--bg); transform: translateX(-101%); transition: transform .45s cubic-bezier(.76,0,.24,1); }
.cta:hover::before { transform: translateX(0); }
.cta:hover span, .cta:hover i { color: var(--ink); }
.cta[disabled] { opacity: .5; pointer-events: none; }
.cta--small { min-width: 0; padding: 14px 18px; gap: 18px; }
.ghost { background: none; border: 1px solid var(--line); padding: 12px 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); cursor: pointer; transition: border-color .25s, background .25s, color .25s; }
.ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* dates */
#dates { display: grid; justify-items: center; gap: 22px; width: 100%; }
.pair { display: flex; align-items: flex-end; justify-content: center; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; }
.date { display: grid; gap: 8px; justify-items: center; text-align: center; }
.times { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3vw, 44px); color: var(--mute); padding-bottom: 10px; }
input[type="date"] { background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; font-size: clamp(26px, 3vw, 44px); font-weight: 300; letter-spacing: -.02em; border-radius: 0; outline: none; text-align: center; width: clamp(240px, 24vw, 340px); transition: border-color .25s; }
input[type="date"]:focus { border-bottom-color: var(--ink); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .45; cursor: pointer; }
.name { background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 6px 2px; font-size: 15px; color: var(--ink); text-align: center; width: 180px; outline: none; }
.name::placeholder { color: rgba(242,241,238,.3); }
.name:focus { border-bottom-color: var(--ink); }
.tonight { font-size: clamp(26px, 3vw, 44px); font-weight: 300; letter-spacing: -.02em; padding: 8px 2px; border-bottom: 1px solid var(--line); min-width: clamp(240px, 24vw, 340px); }
.links { margin: 0; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; }
.error { margin: 0; color: #ffb3a3; text-transform: none; }

/* result */
.eyebrow { margin: 0; }
.result__title { font-weight: 300; font-size: clamp(38px, 5.4vw, 92px); line-height: .95; letter-spacing: -.035em; margin: 0; }
.result__title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.result__stats { margin: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 0; color: var(--ink); }
.swatch { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.swatch--a { background: var(--a); box-shadow: 0 0 8px var(--a); }
.swatch--b { background: var(--b); box-shadow: 0 0 8px var(--b); }
.actions { display: grid; justify-items: center; gap: 14px; margin-top: 6px; }
.sizes { display: flex; align-items: center; gap: 14px; }
.size { background: none; border: 0; padding: 0 0 2px; font: inherit; color: var(--mute); cursor: pointer; border-bottom: 1px solid transparent; letter-spacing: inherit; text-transform: inherit; }
.size.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.size:hover { color: var(--ink); }
.tiny { margin: 0; min-height: 14px; text-transform: none; letter-spacing: .06em; }

/* preview */
.preview { position: fixed; inset: 0; z-index: 20; background: rgba(5,5,7,.94); padding: 72px var(--gutter) 24px; }
.preview__frame { height: calc(100dvh - 72px - 24px - 76px); display: flex; align-items: center; justify-content: center; }
.preview__frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border: 1px solid var(--line); box-shadow: 0 40px 120px rgba(0,0,0,.8); }
.preview__bar { height: 76px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.nojs { position: fixed; inset: 40% 20px auto; text-align: center; z-index: 30; }

@media (max-width: 720px) {
  .stage { padding: 90px 18px max(72px, calc(env(safe-area-inset-bottom) + 60px)); gap: 14px; }
  .title { font-size: clamp(48px, 15vw, 72px); }
  .pair { flex-direction: column; align-items: center; gap: 10px; }
  .times { padding: 0; font-size: 26px; line-height: 1; }
  input[type="date"], .tonight { width: min(86vw, 340px); min-width: 0; font-size: 30px; }
  .cta { width: min(86vw, 340px); min-width: 0; }
  .result__title { font-size: clamp(36px, 11vw, 60px); }
  .result__stats { font-size: 10px; }
  .preview { padding: 64px 14px 18px; } .preview__frame { height: calc(100dvh - 64px - 18px - 76px); }
}
@media (prefers-reduced-motion: reduce) { .stage.in > *, .title .w { animation: none !important; opacity: 1 !important; transform: none !important; } }
