/* Glint — landing page
   Black, white, italic emphasis. Instrument Serif display over a system sans. Type and photography carry the page. */

:root {
  --bg: #000;
  --bg-elevated: #0a0a0a;
  --fg: #fff;
  --fg-secondary: rgba(255, 255, 255, 0.72);
  --fg-tertiary: rgba(255, 255, 255, 0.48);
  --rule: rgba(255, 255, 255, 0.14);
  --accent: #fff;
  --hover: #ff3b30;
  --error: #f0a6a0;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Inter, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 38ch;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-page: cubic-bezier(0.76, 0, 0.24, 1);
  --t-fast: 180ms;
  --t-slow: 900ms;
  --t-page: 800ms;
}

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/InstrumentSerif-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--fg);
  color-scheme: dark;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

::selection { background: var(--fg); color: #000; }

/* Emphasised words: italic, same colour as the surrounding text. */
.accent {
  font-style: italic;
  color: inherit;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--fg);
  color: #000;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  transform: translateY(-200%);
  z-index: 100;
}
.skip-link:focus { transform: none; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  transition: opacity var(--t-fast) var(--ease-out);
}
.wordmark:hover { opacity: 0.7; }

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}
.hero__media,
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__media img {
  object-fit: cover;
  object-position: 50% 50%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* Vignette: keeps the light on the runner at the centre of the frame. */
    radial-gradient(ellipse 70% 60% at 50% 46%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 22%),
    linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.78) 16%, rgba(0, 0, 0, 0.35) 32%, rgba(0, 0, 0, 0) 46%),
    rgba(0, 0, 0, 0.1);
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) clamp(2.5rem, 8vh, 5.5rem);
}
.hero__wordmark {
  font-size: clamp(1.75rem, 2.1vw, 2.125rem);
  align-self: flex-start;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 8.2vw, 9.5rem);
  letter-spacing: -0.01em;
  line-height: 0.98;
  text-wrap: balance;
}
/* One centred line on desktop, two left-aligned lines on phones. */
@media (min-width: 768px) {
  .hero__title {
    white-space: nowrap;
    align-self: center;
    text-align: center;
  }
  .hero__break { display: none; }
}
@media (max-width: 767px) {
  .hero__title { font-size: clamp(3.25rem, 14vw, 5rem); }
}

/* Entrance: only on load, only when motion is welcome. */
.hero__wordmark, .hero__title {
  animation: rise var(--t-slow) var(--ease-out) both;
}
.hero__title { animation-delay: 120ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Paged layout ----------
   JS adds html.paged. The document no longer scrolls: the two pages sit on
   top of each other and slide as a unit, so there is never a half-state.
   Without JS the page is an ordinary scrolling document. */
html.paged,
html.paged body {
  height: 100%;
  overflow: hidden;
}
html.paged body {
  height: 100vh;
  height: 100svh;
}
.paged .pages {
  position: relative;
  height: 100%;
}
.paged .page {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
  transition: transform var(--t-page) var(--ease-page), opacity var(--t-page) var(--ease-page);
  will-change: transform;
}
.paged .page--hero {
  min-height: 0;
  overflow: hidden;   /* nothing to scroll inside: any wheel tick pages */
  z-index: 1;
}
/* The hero recedes slightly as the second page covers it. */
.paged .page--hero.is-behind {
  transform: translateY(-10%) scale(0.98);
  opacity: 0.45;
}
.paged .page--waitlist {
  z-index: 2;
  transform: translateY(100%);
  background: var(--bg);
  box-shadow: 0 -40px 120px rgba(0, 0, 0, 0.6);
}
.paged .page--waitlist.is-active {
  transform: translateY(0);
}

/* Page 2 fills the viewport: content centred, footer pinned to the bottom. */
.page--waitlist {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.page__main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}

/* ---------- 2. Waitlist ---------- */
.waitlist {
  width: 100%;
  padding: clamp(4rem, 10vh, 8rem) var(--gutter);
}
.waitlist__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.waitlist__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 6.4vw, 7.5rem);
  letter-spacing: -0.01em;
  line-height: 0.98;
}
.waitlist__lede {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1.5vw, 1.4375rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--fg-secondary);
  text-wrap: pretty;
}

/* Form */
.form {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  max-width: 620px;
}
.form__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__label {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--fg-tertiary);
  margin-bottom: 0.25rem;
}
.form__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .form__row {
    flex-direction: row;
    align-items: flex-end;
    gap: 1.5rem;
  }
}
.form__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  color: var(--fg);
  font: inherit;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  caret-color: var(--fg);
  transition: border-color var(--t-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.form__input::placeholder { color: rgba(255, 255, 255, 0.34); }
.form__input:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
.form__input:focus { outline: none; border-bottom-color: var(--fg); }
.form__input[aria-invalid="true"] { border-bottom-color: var(--error); }
.form__input:-webkit-autofill,
.form__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px #000 inset;
  transition: background-color 9999s ease-out;
}

/* Outline button: transparent, 1px border, only the border reacts on hover. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 2rem;
  background: transparent;
  border: 1px solid var(--fg);
  border-radius: 0;
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 200ms var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.btn:hover { border-color: var(--hover); }
.btn:active { border-color: var(--hover); opacity: 0.8; }
.btn:focus-visible { outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.45;
  border-color: var(--fg);
}
.btn[aria-disabled="true"] { pointer-events: none; }

.form__submit { flex: 0 0 auto; }
.btn__busy {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.btn[aria-busy="true"] { opacity: 0.85; cursor: progress; }
.btn[aria-busy="true"] .btn__label { opacity: 0; }
.btn[aria-busy="true"] .btn__busy { opacity: 1; }

.form__error {
  min-height: 1.5em;
  margin-top: 0.875rem;
  font-size: 0.9375rem;
  color: var(--error);
}
.form__error:empty { display: none; }
noscript .form__error { display: block; }

.form-done {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  max-width: 620px;
}
.form-done:focus,
.form-done:focus-visible { outline: none; }
.form-done__title {
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.form-done__text {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--fg-secondary);
}
.form-done__link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--t-fast) var(--ease-out);
}
.form-done__link:hover { text-decoration-color: currentColor; }
.form-done__link:not([href]) { display: none; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.reveal:nth-child(2) { transition-delay: 90ms; }
.reveal:nth-child(3) { transition-delay: 180ms; }
.reveal.is-visible,
html.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- 3. Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem var(--gutter) max(2.5rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
  color: var(--fg-tertiary);
}
.footer__copy { justify-self: start; }
.footer__wordmark {
  justify-self: center;
  font-size: 1.625rem;
  color: var(--fg);
}
.footer__links {
  justify-self: end;
  display: flex;
  gap: 1.75rem;
}
.footer__link {
  position: relative;
  color: var(--fg-secondary);
  transition: color var(--t-fast) var(--ease-out);
}
.footer__link[href]:hover { color: var(--fg); }
.footer__link:not([href]) {
  color: var(--fg-tertiary);
  cursor: default;
}
.footer__link:not([href])::after {
  content: " · not configured";
  font-size: 0.8125rem;
  color: var(--error);
}
@media (max-width: 639px) {
  .footer {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .footer__wordmark { justify-self: start; order: -1; }
  .footer__links { justify-self: start; }
}

/* ---------- Success modal ---------- */
.modal {
  --modal-pad: clamp(2rem, 6vw, 3.5rem);
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: min(90vh, 90svh);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--fg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: auto;
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.modal[open] {
  animation: modal-in 280ms var(--ease-out) both;
}
.modal[open]::backdrop {
  animation: backdrop-in 280ms var(--ease-out) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal__body {
  padding: var(--modal-pad);
  padding-top: calc(var(--modal-pad) + 0.5rem);
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.modal__close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  letter-spacing: -0.01em;
  line-height: 1;
}
.modal__kicker {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.1;
  color: var(--fg);
}
.modal__text {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--fg-secondary);
  text-wrap: pretty;
}
.modal__cta {
  margin-top: 2rem;
  width: 100%;
}
@media (min-width: 480px) {
  .modal__cta { width: auto; }
}
.modal__note {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--error);
}

html.modal-open { overflow: hidden; }

@media print {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .paged .page { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero__wordmark, .hero__title { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
