/* smirk.co — single-viewport interactive hero.
   Dark-first, flat, minimal: near-black page (#0D0D0F), white text, #A0A0A1
   secondary, #222224 hairlines, and one accent (#F04438) reserved for the
   Join button, the accented headline words, the ticker dots, and the active
   tab. Albert Sans
   (same face as the app), no build step.

   Layout contract: at >= 900px the page is exactly one viewport tall and
   never scrolls (html/body overflow hidden). Below 900px the hero stacks and
   is sized to fit a 390x844 viewport without scrolling; smaller phones may
   scroll a little rather than clip. */

@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d0d0f;
  --ink: #ffffff;
  --muted: #a0a0a1;
  --faint: #5c5c60;
  --line: #222224;
  --surface: #121214;
  --field: #1a1a1c;
  --field-line: #37373c;
  --accent: #f04438;
  --accent-soft: rgba(240, 68, 56, 0.14);
  --error: #f97066;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Shell ------------------------------------------------------------- */

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  padding: 28px 64px 0;
  position: relative;
  z-index: 6;
}

.wordmark {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

/* ---- Hero grid ---------------------------------------------------------- */

.hero {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  align-items: center;
  gap: 24px;
}

.hero-left {
  position: relative;
  z-index: 3;
  max-width: 540px;
}

/* ---- Headline ------------------------------------------------------------ */

h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.07;
}

.hl-accent {
  color: var(--accent);
}

.hero-sub {
  margin-top: 20px;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 30em;
}

/* ---- Waitlist form ------------------------------------------------------- */

.waitlist-form {
  margin-top: 30px;
}

.waitlist-row {
  display: flex;
  gap: 10px;
  max-width: 440px;
}

.waitlist-row input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.waitlist-row input::placeholder {
  color: var(--faint);
}

.waitlist-row input:focus {
  outline: none;
  border-color: var(--ink);
}

/* Known, ACCEPTED WCAG deviation: #fff on #F04438 measures 3.76:1 — above
   the 3:1 large-text bar but below the 4.5:1 AA bar for text this size.
   White-on-accent is smirk's established design language (same as the app
   and the booking page), so this is a deliberate trade-off, not an
   oversight. Revisit if the accent ever darkens. */
.join-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.join-btn:hover {
  filter: brightness(0.95);
}

.join-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.join-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-note {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.form-note.ok {
  color: var(--ink);
  font-weight: 600;
}

.form-note.err {
  color: var(--error);
}

/* Success: the row disappears, the confirmation stands alone. */
.waitlist-form.done .waitlist-row {
  display: none;
}

.waitlist-form.done .form-note {
  margin-top: 0;
  font-size: 1.05rem;
}

/* ---- Feature ticker -------------------------------------------------------- */
/* Two rows of pill chips scrolling in opposite directions on an infinite
   seamless loop. Each row holds two identical .ticker-track groups; each
   group's width includes its own trailing gap (padding-left mirrors the flex
   gap), so translating the pair by -50% lands exactly one group over and the
   loop has no seam. The reversed row just plays the same animation backwards.
   Hover pauses both rows; reduced motion stops the scroll, hides the
   duplicate groups, and wraps the chips statically. */

.ticker {
  margin-top: 34px;
  display: grid;
  gap: 10px;
  max-width: 540px;
  overflow: hidden;
  /* The rows are thousands of px wide; without this their intrinsic width
     propagates up and blows the column out (visible as mobile zoom-out). */
  contain: inline-size;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

.ticker-row {
  display: flex;
  width: max-content;
}

.ticker-track {
  list-style: none;
  display: flex;
  gap: 8px;
  padding-left: 8px; /* trailing gap between the two groups — keeps -50% exact */
  animation: ticker-scroll 36s linear infinite;
}

.ticker-row--rev .ticker-track {
  animation-direction: reverse;
  animation-duration: 42s; /* slightly different speed so the rows desync */
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  to { transform: translateX(-100%); }
}

.ticker-track li {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 7px 13px;
  background: #151517;
  border: 1px solid #26262a;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.ticker-track li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---- Stage: phone + tabs + ambience -------------------------------------- */

.stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* No gap: the tab bar's own negative margin docks it onto the phone's
     bottom edge (see .tabbar). */
  gap: 0;
  perspective: 1100px;
}

/* Faint red ambient glow pooled behind the phone. */
.stage::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(620px, 64vh);
  aspect-ratio: 1;
  transform: translate(-50%, -55%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 68, 56, 0.17), transparent 62%);
  pointer-events: none;
}

.phone-tilt {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---- Phone frame ---------------------------------------------------------- */
/* Thin CSS bezel around the raw capture. The screens box keeps the capture's
   exact 1206:2622 ratio — width scales, height follows, no distortion.
   Width is height-capped so phone + tab bar always fit one viewport. */

.phone {
  width: min(320px, 36dvh);
  padding: 11px;
  border-radius: 54px;
  background: #1a1a1c;
  border: 1px solid #2c2c30;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 32px 80px -24px rgba(0, 0, 0, 0.7),
    0 0 110px -16px rgba(240, 68, 56, 0.3);
}

.screens {
  position: relative;
  aspect-ratio: 1206 / 2622;
  border-radius: 43px;
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.45s ease, transform 0.6s ease;
}

.screen.is-active {
  opacity: 1;
  transform: none;
}

/* ---- Tab bar (the app's own floating pill bar) ----------------------------- */
/* Docked straddling the phone's bottom edge: the negative top margin pulls
   the pill up by half its own height (44px tab + 2×7px padding + 2×1px
   border = 60px tall), so its midline sits on the frame's bottom edge —
   half over the bezel, half below. z-index 3 keeps it clickable above the
   phone (z-index 2); the drop shadow sells the float. */

.tabbar {
  position: relative;
  z-index: 3;
  margin-top: -30px;
  display: flex;
  gap: 6px;
  padding: 7px;
  background: #161618;
  border: 1px solid #26262a;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  width: 54px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* The app's real tab icons (see index.html), tinted via mask + currentColor.
   Each tab carries two variants, exactly like the app: an outlined glyph when
   inactive and a filled one when active. The copied SVGs have their baked-in
   stroke-opacity stripped, so the mask alpha is solid and the tint is pure. */
.tab-icon {
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: var(--tab-icon-inactive) center / contain no-repeat;
  mask: var(--tab-icon-inactive) center / contain no-repeat;
}

.tab.is-active .tab-icon {
  -webkit-mask-image: var(--tab-icon-active);
  mask-image: var(--tab-icon-active);
}

.tab--home {
  --tab-icon-inactive: url("/assets/icons/home_tab_inactive.svg");
  --tab-icon-active: url("/assets/icons/home_tab.svg");
}

.tab--calendar {
  --tab-icon-inactive: url("/assets/icons/calendar_tab_inactive.svg");
  --tab-icon-active: url("/assets/icons/calendar_tab.svg");
}

.tab--contacts {
  --tab-icon-inactive: url("/assets/icons/contact_tab_inactive.svg");
  --tab-icon-active: url("/assets/icons/contact_tab.svg");
}

.tab--todos {
  --tab-icon-inactive: url("/assets/icons/task_tab_inactive.svg");
  --tab-icon-active: url("/assets/icons/task_tab.svg");
}

.tab:hover {
  color: var(--ink);
}

/* Active = accent icon on a subtle neutral pill — the same treatment as the
   app's BottomTabBar (accent foreground, quiet glass background), not
   white-on-accent. */
.tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.tab.is-active:hover {
  color: var(--accent);
}

.tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- Floating fragments ------------------------------------------------------ */
/* Small self-built cards in the app's visual language, drifting at different
   parallax depths. Decorative only: aria-hidden, pointer-events none, hidden
   on small screens and under prefers-reduced-motion they simply hold still. */

.frag {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.frag-inner {
  background: #151517;
  border: 1px solid #26262a;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
  animation: bob 7s ease-in-out infinite alternate;
}

@keyframes bob {
  from { transform: translateY(-5px); }
  to   { transform: translateY(5px); }
}

/* Anchored to the stage's horizontal center so they hug the phone at any
   viewport width instead of drifting to the column edges. */
.frag--event { top: 18%; left: calc(50% - 322px); opacity: 0.92; }
.frag--event .frag-inner { animation-duration: 8s; }

.frag--bday { top: 11%; left: calc(50% + 170px); opacity: 0.9; }
.frag--bday .frag-inner { animation-delay: -2.4s; }

/* The todo card shares the form's vertical band, so its leftward reach is
   clamped: -8px from the stage edge keeps the card (plus the 12.1px worst-
   case parallax excursion at depth 0.55) clear of the 24px column gap and
   therefore out of the waitlist form's box at every desktop width. */
.frag--todo { bottom: 23%; left: max(-8px, calc(50% - 344px)); opacity: 0.92; }
.frag--todo .frag-inner { animation-delay: -4.8s; animation-duration: 7.6s; }

.frag--tag { top: 49%; left: calc(50% + 196px); opacity: 0.8; }
.frag--tag .frag-inner { animation-delay: -1.6s; animation-duration: 6.4s; }

.frag--soon { bottom: 15%; left: calc(50% + 150px); opacity: 0.85; }
.frag--soon .frag-inner { animation-delay: -3.5s; animation-duration: 8.4s; }

.frag-event {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.frag-bar {
  width: 3px;
  border-radius: 2px;
  background: #12b76a;
  flex-shrink: 0;
}

.frag-title {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
}

.frag-sub {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.frag-todo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.frag-check {
  width: 17px;
  height: 17px;
  border: 1.5px solid #3a3a3f;
  border-radius: 50%;
  flex-shrink: 0;
}

.frag-bangs {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.frag-chip {
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--muted);
  font-weight: 500;
}

.frag-pill {
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-color: transparent;
  color: #ff9089;
  font-weight: 600;
  font-size: 0.76rem;
}

/* ---- Quiet footer -------------------------------------------------------------- */

.hero-foot {
  position: fixed;
  left: 64px;
  bottom: 22px;
  z-index: 5;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--faint);
}

/* ---- Desktop: hard one-viewport lock -------------------------------------------- */

@media (min-width: 900px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .page {
    height: 100dvh;
  }
}

/* ---- Mobile / narrow: stacked hero ------------------------------------------------ */

@media (max-width: 899px) {
  .frag {
    display: none;
  }

  .top {
    padding: 16px 20px 0;
    justify-content: center;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0;
    padding: 0 20px;
  }

  .hero-left {
    max-width: 460px;
    margin: 0 auto;
  }

  h1 {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  .hero-sub {
    margin: 10px auto 0;
    font-size: 0.95rem;
    max-width: 30em;
  }

  .waitlist-form {
    margin-top: 16px;
  }

  .waitlist-row {
    margin: 0 auto;
    max-width: 400px;
  }

  /* iOS zooms focused inputs under 16px — keep the field at 16px+. */
  .waitlist-row input {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .join-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .form-note {
    margin-top: 8px;
    font-size: 0.85rem;
  }

  .ticker {
    margin-top: 12px;
    gap: 7px;
  }

  .ticker-track li {
    padding: 5px 11px;
    font-size: 12px;
  }

  .stage {
    flex: none;
    height: auto;
    margin-top: 12px;
    gap: 0;
    perspective: none;
  }

  .stage::before {
    width: min(420px, 48vh);
  }

  .phone {
    width: min(56vw, 24.5dvh);
    padding: 8px;
    border-radius: 38px;
  }

  .screens {
    border-radius: 31px;
  }

  /* 40px tab + 2×6px padding + 2×1px border = 54px tall → -27px centers the
     pill on the phone's bottom edge, same straddle as desktop. */
  .tabbar {
    margin-top: -27px;
    padding: 6px;
    gap: 4px;
  }

  .tab {
    width: 50px;
    height: 40px;
  }

  .tab-icon {
    width: 20px;
    height: 20px;
  }

  .hero-foot {
    position: static;
    text-align: center;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  }
}

/* ---- Reduced motion ----------------------------------------------------------------- */
/* Tilt, parallax, and auto-advance are gated in JS too; this kills the
   CSS-side motion (bob, ticker scroll, screen slide). Tab switching still
   works — the screens simply cut between states. The ticker stops scrolling:
   the duplicate groups disappear and the first group wraps statically. */

@media (prefers-reduced-motion: reduce) {
  .frag-inner {
    animation: none;
  }

  .screen,
  .tab {
    transition: none;
  }

  .screen {
    transform: none;
  }

  .ticker {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .ticker-row {
    width: auto;
  }

  .ticker-track {
    animation: none;
    flex-wrap: wrap;
    padding-left: 0;
  }

  .ticker-track[aria-hidden="true"] {
    display: none;
  }
}
