/* =====================================================================
   Runvex landing page · base styles
   Tokens, type, header, waitlist form, phone, wordmark, footer.
   Each version folder carries its own copy of this file.
   ===================================================================== */

/* ---------- Fonts (self-hosted, so no visitor data goes to Google) ---------- */
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/karla-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/karla-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #EEF0F6;
  --accent: #6026FF;
  --ink: #000000;
  --ink-2: rgba(0, 0, 0, 0.66);        /* muted text, 6.9:1 on --bg */
  --ink-3: rgba(0, 0, 0, 0.16);        /* soft rules */
  --accent-wash: rgba(96, 38, 255, 0.08);
  --on-accent: #EEF0F6;                /* text on accent fills, 5.7:1 */

  --display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --page: 1360px;
  --section: 96px;
  --radius-tile: 4px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --section: 128px; }
}

@media (min-width: 1200px) {
  :root { --gutter: 48px; --section: 160px; }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--on-accent); }

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus { transform: none; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */
.giant {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.045em;
  overflow-wrap: normal;
}

.label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  text-wrap: pretty;
}

.muted { color: var(--ink-2); }
.hl { color: var(--accent); }
.idx { color: var(--accent); margin-right: 10px; }

/* Placeholder copy that still needs confirming */
.ph {
  font-family: var(--body);
  color: var(--ink-2);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* ---------- Header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  min-height: 44px;
  padding-block: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 25px;
  height: 25px;
  fill: var(--accent);
  margin-right: -1px;
}

.brand__word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 0.8;
  letter-spacing: -0.03em;
}

/* Header right: launch note + language switch */
.top__end {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-right: -10px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .lang:hover { color: var(--accent); }
}

/* Small phones: the switch matters more than the note */
@media (max-width: 379px) {
  .top__note { display: none; }
}

/* ---------- Section head: rule, index label, title ---------- */
.head {
  display: grid;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  margin-bottom: 32px;
}

@media (min-width: 900px) {
  .head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 16px;
    margin-bottom: 48px;
  }
  .head > .label { grid-column: 1 / span 4; }
  .head > .title { grid-column: 5 / span 8; }
}

/* ---------- Phone with an app screenshot ---------- */
/* Black bezel; the screenshot already carries the status bar */
.device {
  aspect-ratio: 1206 / 2622;
  box-sizing: content-box;
  padding: 7px;
  border-radius: 13% / 6%;
  background: var(--ink);
}

.device__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11% / 5.1%;
  background: var(--bg);
}

/* ---------- Waitlist form ---------- */
.wl {
  --wl-field-bg: transparent;
  --wl-field-fg: var(--ink);
  --wl-field-border: var(--ink);
  --wl-placeholder: rgba(0, 0, 0, 0.45);
  --wl-focus: var(--accent);
  --wl-btn-bg: var(--accent);
  --wl-btn-fg: var(--on-accent);
  --wl-btn-hover: var(--ink);
  --wl-btn-hover-fg: var(--on-accent);
  --wl-btn-focus: var(--accent);
  --wl-text: var(--ink);
  --wl-note: var(--ink-2);
  --wl-msg-bg: var(--accent-wash);
  --wl-msg-fg: var(--ink);
  --wl-msg-rule: var(--accent);
  --wl-done-icon-bg: var(--accent);
  --wl-done-icon-fg: var(--on-accent);

  width: 100%;
  max-width: 560px;
  color: var(--wl-text);
}

.wl__label {
  display: block;
  margin-bottom: 10px;
}

.wl__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 560px) {
  .wl__row { flex-direction: row; }
}

.wl__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 24px;
  border: 1.5px solid var(--wl-field-border);
  border-radius: 999px;
  background: var(--wl-field-bg);
  color: var(--wl-field-fg);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px; /* 16px+ keeps iOS from zooming on focus */
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.wl__input::placeholder { color: var(--wl-placeholder); opacity: 1; }

.wl__input:focus,
.wl__input:focus-visible {
  outline: none;
  border-color: var(--wl-focus);
  box-shadow: inset 0 0 0 1.5px var(--wl-focus);
}

.wl__input[aria-invalid="true"] {
  border-color: var(--wl-msg-rule);
  box-shadow: inset 0 0 0 1.5px var(--wl-msg-rule);
}

.wl__input[readonly] { cursor: progress; }

.wl__btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  min-width: 196px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--wl-btn-bg);
  color: var(--wl-btn-fg);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 180ms var(--ease), transform 160ms var(--ease);
}

@media (hover: hover) {
  .wl__btn:hover { background: var(--wl-btn-hover); color: var(--wl-btn-hover-fg); }
}

.wl__btn:active { transform: scale(0.97); }

.wl__btn:focus-visible {
  outline: 2px solid var(--wl-btn-focus);
  outline-offset: 3px;
}

.wl[data-state="loading"] .wl__btn {
  cursor: progress;
  background: var(--wl-btn-hover);
  color: var(--wl-btn-hover-fg);
}

.wl__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: wl-spin 700ms linear infinite;
}

.wl[data-state="loading"] .wl__spinner { display: inline-block; }

/* Error / status line: always in the DOM so screen readers hear changes */
.wl__msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--wl-msg-fg);
  font-size: 15px;
  line-height: 1.4;
}

.wl__msg:not(:empty) {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--wl-msg-bg);
  border-left: 3px solid var(--wl-msg-rule);
  animation: wl-appear 240ms var(--ease);
}

.wl__msg svg {
  flex: 0 0 20px;
  margin-top: 0;
  color: var(--wl-msg-rule);
}

.wl__note {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--wl-note);
}

.wl__note a { text-underline-offset: 3px; }

/* Honeypot: off-screen for people, still filled in by bots */
.wl__trap-wrap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success */
.wl__done {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: var(--wl-msg-bg);
  border-left: 3px solid var(--wl-msg-rule);
  color: var(--wl-msg-fg);
  animation: wl-rise 240ms var(--ease);
}

.wl__done:focus { outline: none; }

.wl__done-icon {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--wl-done-icon-bg);
  color: var(--wl-done-icon-fg);
}

.wl__done-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.wl__done-text {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.45;
}

.wl__done-email { overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }

.wl__done > div { flex: 1 1 auto; min-width: 0; }

/* Share link in the success state */
.wl__share { margin-top: 14px; }

.wl__share-text {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.wl__share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.wl__share-link {
  flex: 1 1 200px;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--wl-field-border);
  border-radius: 999px;
  background: var(--wl-field-bg);
  color: var(--wl-field-fg);
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px; /* 16px+ keeps iOS from zooming on focus */
}

.wl__share-link:focus-visible {
  outline: none;
  border-color: var(--wl-focus);
  box-shadow: inset 0 0 0 1.5px var(--wl-focus);
}

.wl__share-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--wl-btn-bg);
  color: var(--wl-btn-fg);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 180ms var(--ease), transform 160ms var(--ease);
}

@media (hover: hover) {
  .wl__share-btn:hover { background: var(--wl-btn-hover); color: var(--wl-btn-hover-fg); }
}

.wl__share-btn:active { transform: scale(0.97); }

.wl__share-btn:focus-visible {
  outline: 2px solid var(--wl-btn-focus);
  outline-offset: 3px;
}

.wl__share-status:not(:empty) {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.wl__reset {
  min-height: 44px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@keyframes wl-appear { from { opacity: 0; transform: translateY(-4px); } }
@keyframes wl-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes wl-spin { to { transform: rotate(360deg); } }

/* ---------- Closing wordmark ---------- */
.wordmark-box {
  container-type: inline-size;
  overflow: hidden;
}

.wordmark {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  /* Measured: RUNVEX ink is 4.078em wide and starts 0.078em in at this tracking,
     so this size and offset put the letters edge to edge on the grid */
  font-size: 24.5cqw;
  line-height: 0.74;
  letter-spacing: -0.055em;
  padding-top: 0.04em;
  margin-left: -0.078em;
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-block: 20px 40px;
  border-top: 1px solid var(--ink);
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.4;
}

.foot .label { font-size: 11px; }

.foot a { text-underline-offset: 3px; }

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .wl[data-state="loading"] .wl__spinner { display: none; }
}
