/* ==========================================================================
   WAYA Launch RSVP — styles
   Tokens and component styles are carried over verbatim from the WAYA design
   system (design/_ds/…). Values here are the design's values; change tokens
   rather than hard-coding new ones.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

@font-face {
  font-family: "Bodoni FLF";
  src: url("assets/fonts/BodoniFLF-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- tokens: colors -------------------------------------------------- */
:root {
  /* base neutrals — WAYA is black & white */
  --waya-black: #000000; --waya-off-black: #111111; --waya-ink-700: #2E2E2E;
  --waya-ink-500: #5C5C5C; --waya-ink-400: #8A8A8A; --waya-ink-300: #BDBDBD;
  --waya-line: #E4E1DD; --waya-mist: #F4F2EF; --waya-paper: #FAF9F7; --waya-white: #FFFFFF;

  /* Skin by WAYA — the only chromatic family in the system */
  --skin-clay: #B19475; --skin-clay-dark: #8E7458; --skin-clay-mid: #C4AB90;

  /* semantic status (retail utility only, used sparingly) */
  --status-success: #3F6B4F; --status-warning: #B07B2C; --status-error: #9B2C21; --status-info: #2E4A6B;

  /* semantic aliases */
  --text-primary: var(--waya-black); --text-secondary: var(--waya-ink-500);
  --text-muted: var(--waya-ink-400); --text-inverse: var(--waya-white);
  --surface-page: var(--waya-white);
  --border-default: var(--waya-line); --border-strong: var(--waya-black);

  --action-primary-bg: var(--waya-black); --action-primary-fg: var(--waya-white);
  --action-primary-bg-hover: var(--waya-ink-700);
  --action-secondary-fg: var(--waya-black); --action-secondary-border: var(--waya-black);
  --focus-ring: var(--waya-black);

  /* --- tokens: typography --- */
  --font-display: "Bodoni FLF", "Bodoni MT", "Didot", Georgia, serif;
  --font-sans: "Inter", "Helvetica Neue", Helvetica, sans-serif;
  --fs-100: 11px; --fs-200: 12px; --fs-300: 14px; --fs-400: 16px; --fs-500: 18px;
  --fw-medium: 500; --fw-bold: 700;
  --tracking-tight: -0.01em; --tracking-wide: 0.08em;

  /* --- tokens: spacing / radius / elevation / motion --- */
  --space-2: 8px;
  --radius-button: 0; --radius-input: 0;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
  --ease-standard: cubic-bezier(.2, 0, .2, 1);
  --duration-fast: 120ms;
  --transition-hover: color var(--duration-fast) linear, background-color var(--duration-fast) linear,
    border-color var(--duration-fast) linear, opacity var(--duration-fast) linear;
}

/* --- base ------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body { margin: 0; background: #000; }
* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .65; }

.page {
  font-family: var(--font-sans);
  color: var(--waya-black);
  background: var(--waya-white);
  overflow-x: clip;
  width: 100%;
}

@keyframes waya-marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes waya-stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.4); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes waya-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: .5; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* --- shared -------------------------------------------------------- */
.logo { width: auto; display: block; }
.logo--knockout { filter: brightness(0) invert(1); }

.eyebrow {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow--tight { letter-spacing: .22em; }

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease-standard), transform .9s var(--ease-standard);
}
.reveal--md { transform: translateY(26px); }
.reveal--lg { transform: translateY(30px); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-marquee] { animation: none !important; }
}

/* --- chrome ---------------------------------------------------------- */
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: #fff;
  z-index: 60;
  mix-blend-mode: difference;
}

.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  mix-blend-mode: difference;
  pointer-events: none;
}
.header-meta {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #fff;
}

/* --- hero ------------------------------------------------------------ */
.hero { height: 460vh; position: relative; background: var(--waya-black); }

.hero__pin {
  position: sticky; top: 0;
  height: 100vh;
  /* dvh tracks the *visible* viewport: on phones 100vh is the URL-bar-hidden
     height, which pushes the hero's bottom line and scroll hint off-screen. */
  height: 100dvh;
  overflow: hidden;
  background: var(--waya-black);
}

/* the wordmark IS the window: the mask grows until the deck fills the screen */
.hero__white {
  position: absolute; inset: 0;
  background: var(--waya-white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(20px, 4vh, 44px);
  -webkit-mask-image: url(assets/waya-logo-mask.svg);
  mask-image: url(assets/waya-logo-mask.svg);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 48.9% 49.9%; mask-position: 48.9% 49.9%;
  -webkit-mask-size: min(344px, 62vw) auto; mask-size: min(344px, 62vw) auto;
  will-change: mask-size;
}

.carousel {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(16px, 3vh, 36px);
  opacity: 0;
  will-change: opacity;
}

.carousel__caps {
  position: relative;
  width: 100%; max-width: 22ch;
  text-align: center;
  font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  font-size: clamp(20px, 2.8vw, 38px);
  height: 2.4em;
  padding: 0 20px;
}
.carousel__caps span {
  position: absolute; left: 0; right: 0; top: 0;
  opacity: 0;
  will-change: opacity, transform;
}

/* Scroll-driven only — no drag affordances, and no touch-action override that
   would compete with the page's own scrolling. */
.carousel__stage {
  position: relative;
  width: 100%; height: min(58vh, 440px);
  perspective: 1200px;
}
.carousel__ring { position: absolute; inset: 0; transform-style: preserve-3d; }

.card {
  position: absolute; left: 50%; top: 50%;
  width: 300px; aspect-ratio: 3 / 4;
  background-size: cover; background-position: 50% 30%;
  background-color: var(--waya-mist);
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.card--intro {
  background: var(--waya-black);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.card--intro span { font-size: 13px; letter-spacing: .32em; text-transform: uppercase; }

.hero__line {
  position: absolute; left: 0; right: 0;
  bottom: calc(clamp(56px, 10vh, 104px) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 24px; text-align: center;
  will-change: opacity, transform;
}
.hero__line span {
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
}

.hero__hint {
  position: absolute; left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  animation: waya-hint 2.4s var(--ease-standard) infinite;
}
.hero__hint span {
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
}

/* --- lands in Nairobi ------------------------------------------------ */
.lands {
  background: var(--waya-white);
  padding: clamp(96px, 16vh, 180px) clamp(20px, 4vw, 48px) clamp(56px, 8vh, 96px);
}
.lands__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  text-align: center;
}
.lands__title {
  margin: 0;
  font-weight: 700; letter-spacing: -.03em; line-height: .98;
  font-size: clamp(44px, 9vw, 132px);
  text-wrap: balance;
}
.lands__title span { display: block; }

/* --- countdown ------------------------------------------------------- */
.countdown {
  background: var(--waya-white);
  padding: clamp(88px, 14vh, 160px) clamp(20px, 4vw, 48px);
}
.countdown__inner {
  max-width: 1360px; margin: 0 auto;
  display: flex; flex-direction: column; gap: clamp(32px, 5vh, 56px);
}
.countdown__head {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 20px;
}
.countdown__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 32px);
}
.countdown__unit { display: flex; flex-direction: column; gap: 10px; }
.countdown__num {
  font-size: clamp(38px, 12.5vw, 168px);
  font-weight: 700; letter-spacing: -.04em; line-height: .9;
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-muted);
}

/* --- key info -------------------------------------------------------- */
.keyinfo {
  background: var(--waya-black); color: #fff;
  padding: clamp(52px, 7vh, 88px) 0 clamp(48px, 7vh, 80px);
  overflow: hidden;
}
.keyinfo__inner {
  max-width: 1360px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: grid; gap: clamp(28px, 4vw, 72px);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: end;
}
.keyinfo__date { display: flex; flex-direction: column; gap: 10px; }
.keyinfo__eyebrow {
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.keyinfo__big {
  font-weight: 700; letter-spacing: -.05em; line-height: 1;
  font-size: clamp(34px, 4.6vw, 68px);
  white-space: nowrap;
}
.keyinfo__big span { color: rgba(255, 255, 255, .42); }

.keyinfo__rows { display: flex; flex-direction: column; }
.keyinfo__row {
  display: grid; grid-template-columns: 84px 1fr; gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.keyinfo__row--last { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.keyinfo__key {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.keyinfo__val {
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
}

.marquee {
  margin-top: clamp(56px, 8vh, 96px);
  border-top: 1px solid rgba(255, 255, 255, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  padding: 18px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex; gap: 48px;
  animation: waya-marquee 26s linear infinite;
  will-change: transform;
}
.marquee__track span {
  font-size: clamp(18px, 2.6vw, 32px);
  font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}

/* --- RSVP ------------------------------------------------------------ */
.rsvp {
  background: var(--waya-mist);
  padding: clamp(88px, 14vh, 160px) clamp(20px, 4vw, 48px) clamp(72px, 10vh, 120px);
}
.rsvp__inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(32px, 5vh, 56px);
}
.rsvp__head {
  text-align: center;
  display: flex; flex-direction: column; gap: 16px; align-items: center;
  width: 100%; max-width: 100%; min-width: 0;
}
.rsvp__title {
  margin: 0;
  font-weight: 700; letter-spacing: -.02em; line-height: 1.05;
  font-size: clamp(30px, 5.2vw, 64px);
  max-width: 100%;
  text-wrap: balance;
}
.rsvp__sub {
  margin: 0;
  max-width: min(50ch, 100%);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}
/* The closing CTA is a link styled as a button, so it needs the reveal
   transition to survive .btn's own transition shorthand. */
.rsvp__inner > .btn.reveal {
  transition: opacity .9s var(--ease-standard), transform .9s var(--ease-standard),
              background-color var(--duration-fast) linear, color var(--duration-fast) linear;
}

/* --- ticket ---------------------------------------------------------- */
.ticket__perspective { width: 100%; perspective: 1400px; }

.ticket {
  display: grid;
  /* minmax(0, 1fr), not 1fr: a bare 1fr floors at the content's min-content
     width, so a long address pushed the whole ticket wider than its container
     and everything spilled past the padding. */
  grid-template-columns: clamp(64px, 17vw, 108px) minmax(0, 1fr);
  background: var(--waya-white);
  box-shadow: var(--shadow-md);
  transform: rotateX(16deg) translateY(48px);
  opacity: 0;
  transform-origin: 50% 100%;
  transition: box-shadow .3s linear;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.ticket__stub {
  background: var(--waya-black); color: #fff;
  padding: clamp(16px, 3vw, 22px) clamp(8px, 2vw, 14px);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 16px;
}
.ticket__stub-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  white-space: nowrap;
}
.ticket__barcode { display: flex; gap: 2px; align-items: flex-end; height: 34px; }
.ticket__barcode span { height: 100%; background: #fff; }

.ticket__body {
  position: relative;
  padding: clamp(24px, 3.4vw, 44px);
  display: flex; flex-direction: column; gap: 26px;
  border-left: 1px dashed var(--waya-ink-300);
}
.ticket__meta {
  display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between;
}
.ticket__field { display: grid; gap: 6px; }
.ticket__field--right { text-align: right; margin-left: auto; }
.ticket__label {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-muted);
}
.ticket__value {
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
}
.ticket__note { font-size: 14px; color: var(--text-secondary); }

/* --- form ------------------------------------------------------------ */
.rsvp-form {
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--border-default);
  padding-top: 24px;
}
.rsvp-form__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rsvp-form__field { flex: 1 1 260px; }
.rsvp-form__fine { font-size: 13px; color: var(--text-muted); }

/* design-system Input */
.field {
  display: flex; flex-direction: column; gap: var(--space-2);
  font-family: var(--font-sans);
  width: 100%;
}
.field__label {
  font-size: var(--fs-200);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field__box {
  display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  background: var(--surface-page);
  padding: 0 14px;
}
.field__box input {
  flex: 1;
  border: 0; outline: none; background: transparent;
  padding: 13px 0;
  font-family: var(--font-sans);
  font-size: var(--fs-300);
  color: var(--text-primary);
  min-width: 0;
}
.field__error { font-size: var(--fs-200); color: var(--status-error); }
.field.is-error .field__box { border-color: var(--status-error); }

/* design-system Button */
.btn {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  width: auto;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: var(--transition-hover);
  line-height: 1.1;
  text-decoration: none;
  box-sizing: border-box;
}
.btn:disabled { cursor: not-allowed; opacity: .35; }
.btn--md { font-size: var(--fs-300); padding: 13px 26px; letter-spacing: var(--tracking-wide); }
.btn--lg { font-size: var(--fs-300); padding: 17px 36px; letter-spacing: var(--tracking-wide); }
.btn--primary {
  background: var(--action-primary-bg);
  color: var(--action-primary-fg);
  border: 1px solid var(--action-primary-bg);
}
.btn--primary:hover:not(:disabled) {
  background: var(--action-primary-bg-hover);
  border-color: var(--action-primary-bg-hover);
}
.btn--secondary {
  background: transparent;
  color: var(--action-secondary-fg);
  border: 1px solid var(--action-secondary-border);
}
.btn--secondary:hover:not(:disabled) { opacity: .65; }
.btn:focus-visible,
.field__box:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* --- confirmed ------------------------------------------------------- */
.confirmed {
  border-top: 1px solid var(--border-default);
  padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: flex-end; justify-content: space-between;
}
.confirmed[hidden] { display: none; }
/* Shrinks rather than wraps: at its natural width the code block plus the
   stamp and button overflow the row by a few pixels once the note carries a
   real address, which dropped the buttons onto their own line. */
.confirmed__left { display: grid; gap: 8px; min-width: 0; flex: 1 1 260px; }
.confirmed__eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--status-success);
}
/* Addresses have no spaces to break at, and we don't control how long they are. */
.confirmed__code {
  font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.confirmed__note {
  font-size: 14px; color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.confirmed__right { display: flex; align-items: center; gap: 20px; }

.stamp {
  border: 2px solid var(--status-success);
  color: var(--status-success);
  padding: 8px 14px;
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-8deg);
  animation: waya-stamp .34s var(--ease-standard) both;
}

/* ==========================================================================
   Phones
   The desktop composition is the design as drawn. On a narrow screen the
   type ran too small and the countdown's four columns were unreadable, so
   both are re-proportioned here. Breakpoint matches the carousel's own
   `wide` threshold in app.js — keep the two in step.
   ========================================================================== */
@media (max-width: 699px) {

  /* The mark reads as the hero's headline, so it earns more of the width.
     Mirrored by heroMaskBase() in app.js — change both together. */
  .hero__white {
    -webkit-mask-size: min(344px, 74vw) auto;
    mask-size: min(344px, 74vw) auto;
  }

  /* Captions carry the brand lines; at the shared floor they were barely
     larger than body copy. Taller box so a two-line caption still fits. */
  .carousel__caps {
    font-size: clamp(26px, 7.2vw, 38px);
    max-width: 17ch;
    height: 3.1em;
  }

  .lands__title { font-size: clamp(48px, 15vw, 96px); }

  /* Four columns leave ~85px per number on a phone. Two rows of two gives
     each one room to land like the display type it is. */
  /* No top rule — the header's bottom border already closes the block above. */
  .countdown__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }
  .countdown__unit {
    gap: 2px;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-default);
  }
  .countdown__unit:nth-child(odd) {
    padding-right: 18px;
    border-right: 1px solid var(--border-default);
  }
  .countdown__unit:nth-child(even) { padding-left: 18px; }
  .countdown__num { font-size: 21vw; line-height: .86; }
  .countdown__label { font-size: 10px; letter-spacing: .24em; }

  /* --- ticket ---------------------------------------------------------
     Side by side, the stamp and "Add to calendar" need ~347px of a ~235px
     content column, so they stack. The button goes full width, which also
     makes it a far better tap target. */
  .ticket__body { padding: 22px 18px; gap: 20px; }

  .confirmed { gap: 18px; }
  .confirmed__right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .confirmed__right .btn { width: 100%; }

  /* The barcode is a fixed 73px of bars and gaps in a 48px stub. Scaling keeps
     the drawn proportions rather than dropping bars to sub-pixel widths. */
  .ticket__barcode { transform: scale(.62); transform-origin: 50% 100%; }
}
