/* Riffmigo landing page.
 *
 * Every color, radius and spacing value below is taken from DESIGN.md (the normative source)
 * via design/tokens.json. The only deliberate extension is the display type scale: DESIGN.md's
 * sizes are mobile logical units, so headings here use clamp() to scale up on wide screens while
 * keeping the same hierarchy (display > headline > title > body > label > caption).
 */

:root {
  /* Brand palette — DESIGN.md frontmatter */
  --primary: #2453f5;
  --primary-pressed: #193dc2;
  --accent: #d6f65a;
  --ink: #11181c;

  /* Semantic roles — light scheme */
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-subtle: #e9edf0;
  --text: #11181c;
  --text-secondary: #596273;
  --action: #2453f5;
  --action-pressed: #193dc2;
  --on-action: #ffffff;
  --on-accent: #11181c;
  --outline: #727e91;
  --divider: #d9dee5;
  --error: #b42318;
  --tone-card: #11181c;
  --on-tone-card: #ffffff;

  /* Radii */
  --r-sm: 8px;
  --r-control: 16px;
  --r-card: 24px;
  --r-pill: 999px;

  /* Spacing */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-page: 20px;
  --s-section: 24px;
  --s-major: 32px;

  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* dark-* roles from DESIGN.md: keep the brand, never a plain inversion */
    --bg: #11181c;
    --surface: #1c2630;
    --surface-subtle: #1c2630;
    --text: #f4f6f3;
    --text-secondary: #b6c0cf;
    --action: #a9bcff;
    --action-pressed: #2453f5;
    --on-action: #11181c;
    --outline: #b6c0cf;
    --divider: #727e91;
    --tone-card: #1c2630;
    --on-tone-card: #f4f6f3;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-page);
}

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

.skip {
  position: absolute;
  left: var(--s-page);
  top: -100px;
  z-index: 10;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-control);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
}

.skip:focus {
  top: var(--s-md);
}

:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- Brand mark ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  min-height: 44px;
}

.mark {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex: none;
}

@media (prefers-color-scheme: dark) {
  .mark {
    color: var(--accent);
  }
}

/* The real wordmark is a drawn logotype (DESIGN.md "Typography"); this is a plain-text
   stand-in, deliberately not a skewed system font pretending to be it. */
.wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}

.head-row {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
  min-height: 64px;
}

.nav-links {
  display: none;
  gap: var(--s-section);
  margin-inline-start: var(--s-major);
  font-size: 14px;
  font-weight: 600;
}

.nav-links a {
  color: var(--text-secondary);
  padding: var(--s-sm) 0;
}

.nav-links a:hover {
  color: var(--text);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  margin-inline-start: auto;
}

.head-actions .btn {
  display: none;
}

@media (min-width: 640px) {
  .head-actions {
    gap: var(--s-md);
  }
  .head-actions .btn {
    display: inline-flex;
  }
}

/* ---------- Language dropdown ---------- */

.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--divider);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: all 120ms ease;
}

.lang-trigger::-webkit-details-marker {
  display: none;
}

.lang-trigger:hover {
  background: var(--surface);
  border-color: var(--outline);
}

.lang-dropdown[open] .lang-trigger {
  background: var(--surface);
  border-color: var(--action);
  box-shadow: 0 0 0 1px var(--action);
}

.lang-icon {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lang-current {
  display: inline-block;
  line-height: 1;
}

.lang-chevron {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  transition: transform 150ms ease;
  flex-shrink: 0;
}

.lang-dropdown[open] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 6px;
  min-width: 148px;
  border-radius: var(--r-control);
  background: var(--surface);
  border: 1px solid var(--divider);
  box-shadow: 0 12px 28px rgb(17 24 28 / 14%);
  list-style: none;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-foot .lang-menu {
  top: auto;
  bottom: calc(100% + 6px);
  right: auto;
  left: 0;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-sm);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 100ms ease, color 100ms ease;
}

.lang-option:hover {
  background: var(--surface-subtle);
  color: var(--action);
}

.lang-option.active {
  font-weight: 700;
  color: var(--action);
  background: color-mix(in srgb, var(--action) 10%, transparent);
}

.lang-check {
  width: 15px;
  height: 15px;
  color: var(--action);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: 52px;
  padding: var(--s-lg) var(--s-section);
  border: 0;
  border-radius: var(--r-control);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.btn-primary {
  background: var(--action);
  color: var(--on-action);
}

.btn-primary:hover {
  background: var(--action-pressed);
}

.btn-sm {
  min-height: 44px;
  padding: var(--s-md) var(--s-lg);
}

.btn-nav {
  display: none;
}

@media (min-width: 640px) {
  .btn-nav {
    display: inline-flex;
  }
}

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

.hero {
  padding: clamp(32px, 7vw, 88px) 0 clamp(24px, 5vw, 64px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: clamp(32px, 6vw, 56px);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s-lg);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(34px, 6.2vw, 64px);
  font-weight: 800;
  line-height: 1.08;
}

.hero h1 .hl {
  color: var(--action);
}

.lede {
  margin-top: var(--s-section);
  max-width: 34em;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text-secondary);
}

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

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-major);
  max-width: 520px;
}

.waitlist input {
  flex: 1 1 220px;
  min-height: 52px;
  padding: var(--s-lg);
  border: 1px solid var(--divider);
  border-radius: var(--r-control);
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.waitlist input::placeholder {
  color: var(--text-secondary);
}

.waitlist input:focus-visible {
  border-color: var(--action);
}

.waitlist button {
  flex: 0 0 auto;
  min-height: 52px;
  padding: var(--s-lg) var(--s-section);
  border: 0;
  border-radius: var(--r-control);
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.waitlist button:hover {
  background: var(--action-pressed);
}

.waitlist-status {
  flex: 1 0 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.waitlist-status[data-state="error"] {
  color: var(--error);
}

.form-note {
  margin-top: var(--s-md);
  font-size: 12px;
  color: var(--text-secondary);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-section);
}

.badge {
  display: flex;
  flex-direction: column;
  padding: 10px var(--s-lg);
  border: 1px solid var(--outline);
  border-radius: var(--r-control);
  color: var(--text-secondary);
}

.badge-store {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.badge-status {
  font-size: 12px;
}

/* ---------- Phone mockups ---------- */

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  gap: var(--s-lg);
}

.phone {
  width: 268px;
  flex: none;
  padding: 10px;
  border-radius: 40px;
  background: var(--ink);
  box-shadow: 0 18px 44px rgb(17 24 28 / 18%);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  height: 540px;
  padding: var(--s-lg) 14px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--bg);
}

.hero-art .phone-b {
  display: none;
  margin-top: 48px;
}

.mock-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.mock-title {
  font-size: 22px;
  font-weight: 800;
}

.mock-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.mock-search {
  padding: 12px;
  border-radius: var(--r-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.mock-chips {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.mock-chips li {
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mock-chips li.on {
  background: var(--action);
  color: var(--on-action);
}

.mock-rig {
  padding: var(--s-md);
  border-radius: var(--r-card);
  background: var(--accent);
  color: var(--on-accent);
}

.mock-rig-title {
  font-size: 12px;
  font-weight: 700;
}

.mock-rig-line {
  font-size: 10px;
  opacity: 0.85;
}

.mock-card {
  padding: var(--s-md);
  border-radius: var(--r-card);
  background: var(--tone-card);
  color: var(--on-tone-card);
  border: 1px solid #2a3740;
}

.mock-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

.mock-dash {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.mock-card h4 {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
}

.mock-artist {
  font-size: 12px;
  opacity: 0.86;
}

.mock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--s-sm);
}

.mock-tags li {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid #3a4852;
  font-size: 9px;
  font-weight: 600;
}

.mock-tags li.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.mock-tabs {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
  padding-top: var(--s-md);
  border-top: 1px solid var(--divider);
}

.mock-tabs li {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mock-tabs li.on {
  color: var(--action);
}

.mock-panel {
  padding: var(--s-md);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
}

.mock-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-sm);
  margin-bottom: var(--s-sm);
}

.mock-panel-head h4 {
  font-size: 14px;
  font-weight: 700;
}

.mock-evidence {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.mock-controls {
  margin: 0;
}

.mock-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  padding: 7px 0;
  border-top: 1px solid var(--divider);
}

.mock-control dt {
  font-size: 12px;
}

.mock-control dt span {
  display: block;
  font-size: 9px;
  color: var(--text-secondary);
}

.mock-control dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--action);
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(48px, 8vw, 96px) 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.section h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  max-width: 20em;
}

.section-lede {
  margin-top: var(--s-lg);
  max-width: 44em;
  color: var(--text-secondary);
}

.steps {
  display: grid;
  gap: var(--s-section);
  margin-top: var(--s-major);
}

.steps li {
  padding: var(--s-section);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
}

.section-alt .steps li,
.section-alt .card {
  background: var(--bg);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: var(--s-md);
  border-radius: var(--r-pill);
  background: var(--action);
  color: var(--on-action);
  font-size: 16px;
  font-weight: 800;
}

.steps h3,
.card h3,
.grid-3 h3 {
  font-size: 18px;
  font-weight: 700;
}

.steps p,
.card p,
.grid-3 p {
  margin-top: var(--s-sm);
  color: var(--text-secondary);
  font-size: 16px;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--s-section);
  margin-top: var(--s-major);
}

.card {
  padding: var(--s-section);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
}

.grid-3 li {
  padding-top: var(--s-lg);
  border-top: 3px solid var(--accent);
}

/* ---------- Trust band (ink) ---------- */

.band {
  background: var(--ink);
  color: #ffffff;
}

.band .eyebrow {
  background: var(--accent);
  color: var(--on-accent);
}

.band .section-lede {
  color: #c9d2dc;
}

.checks {
  display: grid;
  gap: var(--s-lg);
  margin-top: var(--s-major);
  max-width: 56em;
}

.checks li {
  position: relative;
  padding-inline-start: var(--s-major);
  color: #e6ebf0;
}

.checks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 9px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---------- App band ---------- */

.app-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

.app-art {
  display: none;
  justify-content: center;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-top: var(--s-section);
}

.tab-list li {
  padding: 10px var(--s-lg);
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
}

.tab-list li.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.fineprint {
  margin-top: var(--s-lg);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Closing CTA ---------- */

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cta-inner .waitlist,
.cta-inner .badges {
  justify-content: center;
}

.cta-inner .section-lede {
  text-align: center;
}

/* ---------- Footer ---------- */

.site-foot {
  padding: clamp(40px, 6vw, 64px) 0 var(--s-major);
  background: var(--surface);
  border-top: 1px solid var(--divider);
}

.foot-grid {
  display: grid;
  gap: var(--s-major);
}

.foot-brand p {
  margin-top: var(--s-md);
  max-width: 24em;
  color: var(--text-secondary);
  font-size: 14px;
}

.site-foot h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--s-md);
}

.site-foot li a {
  display: inline-block;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.site-foot li a:hover {
  color: var(--text);
}

.lang-foot {
  display: inline-flex;
}

.foot-legal {
  margin-top: var(--s-major);
  padding-top: var(--s-section);
  border-top: 1px solid var(--divider);
}

/* ---------- Content & Legal Pages ---------- */

.page-article {
  padding: clamp(36px, 6vw, 68px) 0 clamp(48px, 8vw, 96px);
}

.page-article-inner {
  max-width: 820px;
  margin: 0 auto;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s-section);
  transition: color 120ms ease;
}

.page-back:hover {
  color: var(--action);
}

.page-header {
  margin-bottom: var(--s-major);
}

.page-header h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  line-height: 1.15;
}

.page-meta {
  margin-top: var(--s-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.page-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: var(--s-md);
}

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--s-section);
}

.prose section {
  padding: clamp(20px, 3.5vw, 32px);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
}

.prose h2 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: var(--s-md);
  color: var(--text);
}

.prose p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--s-md);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul {
  margin: var(--s-sm) 0 var(--s-md);
  padding-left: 20px;
  list-style: disc;
}

.prose li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--action-pressed);
}

/* Contact page specific cards */
.contact-hero-card {
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: var(--s-lg);
  margin-bottom: var(--s-major);
}

.contact-hero-card h2 {
  font-size: 20px;
  font-weight: 700;
}

.contact-email-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-md);
  padding: var(--s-lg);
  border-radius: var(--r-control);
  background: var(--surface-subtle);
  border: 1px solid var(--divider);
}

.contact-email-address {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 800;
  color: var(--action);
  font-family: monospace;
}

.contact-topics-head {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: var(--s-section);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-section);
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  padding: var(--s-section);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--divider);
}

.contact-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--s-sm);
  color: var(--text);
}

.contact-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 720px) {
  .steps,
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .foot-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .nav-links {
    display: flex;
  }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .hero-art .phone-b {
    display: block;
  }
  .hero-art {
    justify-content: flex-end;
  }
  .app-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .app-art {
    display: flex;
  }
}
