/* ─────────────────────────────────────────────────────────────────────────────
   misa.lol landing — base stylesheet
   Page-wide foundation every section builds on: design tokens, resets, the
   embedded display font, typography, layout primitives (.container/.section),
   and the components several sections share (.btn, .claim, .hint, .chip,
   .toast, .dag). Section files load after this one and may override it.
   Loads after navigation.css: never redeclare --nav-h here, navigation.css owns
   it (its media overrides would lose to a later unconditional declaration).
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Tokens ── */
:root {
  color-scheme: dark;
  --ink: #050606;
  --ink-2: #0a0b0c;
  --panel: #0e0f10;
  --panel-2: #141516;
  --panel-3: #1a1b1d;
  --ivory: #EEE8E2;
  --text: #F2F2F0;
  --ash: #A9A6A1;
  --mute: #807D78;
  --crimson: #F00646;
  --crimson-2: #d4053d;
  --crimson-deep: #8D001F;
  --crimson-glow: rgba(240,6,70,.22);
  --gold: #E6C36B;
  --gold-deep: #a8862f;
  --blue: #5aa9ff;
  --green: #22c55e;
  --violet: #8b7cf6;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --rule: rgba(255,255,255,.055);
  --font-ui: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --ease: cubic-bezier(.2,.7,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --container: 1520px;
  --gutter: clamp(16px, 3vw, 48px);
  --r: 14px;
}

/* ── Fonts ── */
/* The Misa Display face is embedded so it paints with the first frame (used by the
   cover title, the rule numerals, the pricing title and the Lovebirds preview). */
@font-face {
  font-family: "Misa Display";
  src: url("/fonts/misa-display.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Resets ── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

/* landing-scroll.js adds this class when it hands scrolling back to the browser. */
html.misa-native-scroll {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The body is a stacking root so the paper bands (hero.css) can sit behind everything at z-index:-1. */
body.landing-atmosphere {
  position: relative;
  isolation: isolate;
  display: flow-root;
  background: #000;
}

::selection {
  background: var(--crimson);
  color: #fff;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

img,
video {
  max-width: 100%;
  display: block;
}

canvas {
  max-width: 100%;
}

/* Declared before any component rule: its border-radius ties with single-class rules
   such as .btn and must lose to them by order. */
:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ── Layout primitives ── */
main {
  min-width: 0;
}

.container {
  min-width: 0;
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Grid and flex children may shrink below their content width. */
.container > *,
.constel > *,
.stage__grid > * {
  min-width: 0;
}

.section {
  position: relative;
  min-width: 0;
  padding-block: clamp(48px, 6vw, 88px);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section.container {
  width: 100%;
  max-width: 1520px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Anchor targets stop below the sticky navigation (--nav-h comes from navigation.css). */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ── Typography ── */
.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-hand);
  font-size: clamp(24px, 2vw, 36px);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--crimson);
}

h1,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

/* Section titles: the same heading reset, in the italic serif. */
h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(32px, 4vw, 72px);
  line-height: 1.1;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h2 em {
  font-style: normal;
  color: var(--crimson);
}

.section h2 {
  font-size: clamp(30px, 3.5vw, 54px);
  overflow-wrap: break-word;
}

.sub {
  max-width: 56ch;
  margin: 10px 0 0;
  font-size: inherit;
  color: var(--ash);
}

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: clamp(40px, 3.5vw, 60px);
}

.head .sub {
  margin-top: 8px;
}

.lede {
  max-width: 60ch;
  margin: 0;
  font-size: 15.5px;
  color: var(--ash);
}

.lede strong {
  color: var(--text);
}

.num {
  font-variant-numeric: tabular-nums;
}

.dn {
  font-family: "Misa Display", var(--font-serif);
  font-weight: 400;
  font-style: normal;
  letter-spacing: .02em;
}

/* The dagger glyph (<svg class="dag"><use href="#i-dag"/></svg>). */
.dag {
  display: inline-block;
  width: .8em;
  height: 1.34em;
  vertical-align: -.28em;
  color: var(--crimson);
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(240,6,70,.45));
  transition: transform .5s var(--spring);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  align-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 20px);
  line-height: 1;
  white-space: nowrap;
  transition: transform .35s var(--spring), box-shadow .35s, background .25s, color .25s;
}

.btn:active {
  transform: scale(.97);
}

.btn--crimson {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 8px 26px -8px var(--crimson);
}

.btn--crimson:hover {
  background: #ff2a63;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -8px var(--crimson);
}

.btn .ar {
  display: inline-block;
  transition: transform .35s var(--spring);
}

.btn:hover .ar {
  transform: translateX(3px);
}

/* ── Claim form (hero and sign; each section sizes its own copy) ── */
.claim {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: min(780px, 100%);
  max-width: 100%;
  min-width: 0;
  padding: 5px 6px 5px 22px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 9999px;
  background: rgba(14, 12, 18, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.claim:focus-within {
  border-color: rgba(240, 6, 70, 0.55);
  box-shadow: 0 0 0 3px rgba(240, 6, 70, 0.12), 0 20px 48px -12px rgba(0, 0, 0, 0.75), 0 0 30px -8px rgba(240, 6, 70, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
}

.claim__prefix {
  flex-shrink: 0;
  font-weight: 500;
  font-size: clamp(16px, 1.3vw, 22px);
  white-space: nowrap;
  color: #8c857e;
  letter-spacing: -0.01em;
}

/* width:0 with flex:1 lets the input shrink instead of forcing the row wider than its box. */
.claim__input {
  flex: 1;
  min-width: 0;
  width: 0;
  padding: 13px 8px;
  border: 0;
  background: none;
  outline: 0;
  color: #ffffff;
  font: 600 clamp(16px, 1.3vw, 22px)/1 var(--font-ui);
  letter-spacing: -0.015em;
  caret-color: #ff2d6c;
}

.claim__input::placeholder {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.28);
}

.claim__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #e80540 0%, #ff2564 50%, #d40038 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 18px -2px rgba(240, 6, 70, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.claim__btn:hover {
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 8px 28px -2px rgba(240, 6, 70, 0.7), 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 0 rgba(0, 0, 0, 0.2);
  filter: brightness(1.06);
}

.claim__btn:active {
  transform: translateY(0.5px) scale(0.98);
  box-shadow: 0 2px 10px -2px rgba(240, 6, 70, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.claim__btn .ar {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.claim__btn:hover .ar {
  transform: translateX(3px);
}

/* ── Hint line under a claim form ── */
.hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-height: 18px;
  margin: 0;
  font-size: clamp(12px, 1vw, 18px);
  text-align: center;
  color: var(--mute);
  overflow-wrap: anywhere;
}

.hint .dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson);
}

.hint .dot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(240,6,70,.6);
  animation: ping 2s infinite;
  will-change: transform, opacity;
}

.hint.bad .dot {
  background: var(--gold);
}

.hint.good .dot {
  background: var(--green);
}

/* The ping only invites typing: it stops once the name is judged either way. */
.hint.bad .dot::after,
.hint.good .dot::after {
  animation: none;
  opacity: 0;
}

/* ── Chips ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* With motion allowed, motion.css (loaded later) swaps this transition for its translate lift. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: clamp(14px, 1.1vw, 20px);
  color: var(--ash);
  transition: border-color .25s, color .25s, background .25s, transform .3s var(--spring);
}

.chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mute);
  font-style: normal;
  transition: background .25s, box-shadow .25s;
}

.chip b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
}

.chip:hover {
  border-color: var(--ivory);
  color: var(--text);
}

/* ── Toast (#toast, filled and shown by the name handling) ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: 0 20px 60px -20px #000;
  font-size: 13.5px;
  color: var(--text);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: transform .5s var(--spring), opacity .4s;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast b {
  color: var(--crimson);
}

.toast a {
  margin-left: 6px;
  border-bottom: 1px solid var(--crimson);
  color: var(--ivory);
}

/* ── Shared keyframes ── */
/* Handwriting reveal: the hero paper names, the feature demos and the sign-here signature. */
@keyframes write {
  to {
    clip-path: inset(-20% -5% -20% -5%);
  }
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: .9;
  }
  70% {
    transform: scale(3.4);
    opacity: 0;
  }
  100% {
    transform: scale(3.4);
    opacity: 0;
  }
}

/* ── Absorbed from responsive.css ── */
/* responsive.css is shared with other pages and no longer linked by the landing. Its section
   sizing now lives in each section's own file; these two rules have no other home yet. */

/* footer: the brand dagger scales with the brand font; (0,3,0) to outrank the old 15x26px rule. */
.footer .brand .dag {
  width: .8em;
  height: 1.34em;
}

/* showcase: (1,1,0) as in responsive.css, above the toggles' own (0,1,0) rule. */
#page .toggle {
  font-size: clamp(14px, 1.2vw, 22px);
  min-height: 48px;
}

/* ── Phones ── */
@media (max-width: 700px) {
  body.landing-atmosphere {
    --gutter: 22px;
    background: #080709;
    color: #eee8e2;
  }

  .landing-atmosphere a,
  .landing-atmosphere button {
    -webkit-tap-highlight-color: transparent;
  }

  .landing-atmosphere :is(a, button, input):focus-visible {
    outline: 2px solid #ff426d;
    outline-offset: 4px;
  }

  .landing-atmosphere .section.container {
    max-width: 540px;
    margin-inline: auto;
    padding: 64px var(--gutter);
    scroll-margin-top: 92px;
  }

  .landing-atmosphere .section .head {
    display: block;
    margin: 0 0 28px;
    text-align: left;
  }

  .landing-atmosphere .section .eyebrow {
    margin-bottom: 14px;
    font: 500 22px/1.2 var(--font-hand);
    color: #ff2458;
  }

  .landing-atmosphere .section h2 {
    font-size: clamp(32px, 8.5vw, 43px);
    line-height: 1.13;
    letter-spacing: -.035em;
    text-wrap: balance;
  }

  .landing-atmosphere .section .sub {
    font-size: 15px;
    line-height: 1.75;
    color: #aaa1a8;
    text-wrap: pretty;
  }
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: 85px;
  }
}

@media (max-width: 360px) {
  body.landing-atmosphere {
    --gutter: 16px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
