/* Way to Heart — site styles. Tokens mirror the Way to Heart design system (tokens.json). */
:root {
  --paper: #FBF6EE; --paper-raised: #FFFFFF; --paper-sunk: #F3EADB;
  --ink: #2B1B2F; --ink-muted: #6B5A6E; --ink-faint: #8F7E8F;
  --line: #E6DACA; --line-strong: #BFAE9C;
  --rose: #C8374F; --rose-press: #A82C42; --on-rose: #FFFFFF; --rose-soft: #FBE3E2; --on-rose-soft: #9E2A3F;
  --marigold: #F2A23A; --on-marigold: #2B1B2F; --teal: #1F6F66; --on-teal: #FFFFFF;
  --night: #1E1630; --on-night: #F6EEE6;
  --success: #2E7D4F; --danger: #B3261E; --warning: #8A5A00; --focus: #1F6F66;
  --scrim: rgba(30, 22, 48, .56);
  --shadow-card: 0 1px 2px rgba(43,27,47,.06), 0 8px 24px rgba(43,27,47,.08);
  --shadow-lift: 0 18px 48px rgba(43,27,47,.16);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", "Mukta", system-ui, sans-serif;
  --font-hand: "Caveat", "Kalam", cursive;
  --r-s: 8px; --r-m: 16px; --r-l: 28px;
  --gutter: 16px; --max: 1160px;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 960px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; display: block; }
a { color: var(--rose); text-underline-offset: 3px; }
a:hover { color: var(--rose-press); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* type */
.d, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.h-xl { font-size: clamp(40px, 6vw, 64px); line-height: 1.02; }
.h-l { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05; }
.h-1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; }
.h-2 { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.2; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-muted); line-height: 1.55; }
.muted { color: var(--ink-muted); }
.cap { font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }
.ov { font-size: 12px; line-height: 1.2; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.hand { font-family: var(--font-hand); font-weight: 500; }
.title { font-weight: 700; font-size: 18px; line-height: 1.35; }

/* layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0; }
@media (min-width: 960px) { .section { padding: 80px 0; } }
.band { background: var(--paper-sunk); }
.night-band { background: var(--night); color: var(--on-night); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.split { display: flex; gap: 40px; flex-wrap: wrap; align-items: center; }
.split > * { flex: 1 1 380px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { gap: 18px; } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sec-head { max-width: 720px; margin-bottom: 28px; }
.sec-head .ov { margin-bottom: 10px; }
.sec-head p { margin-top: 10px; }
.scroll-x { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.scroll-x > * { scroll-snap-align: start; flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font-sans); border-radius: 999px; padding: 14px 22px; min-height: 48px; border: 1.5px solid transparent; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .18s ease-out, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--rose); color: var(--on-rose); }
.btn-primary:hover { background: var(--rose-press); color: var(--on-rose); }
.btn-secondary { background: var(--paper-raised); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--rose); padding-left: 8px; padding-right: 8px; min-height: 40px; }
.btn-white { background: #fff; color: #2B1B2F; }
.btn-outline-light { background: transparent; color: var(--on-night); border-color: currentColor; }
.btn-sm { padding: 9px 14px; min-height: 38px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: transparent; border: 0; color: inherit; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chips, badges */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--font-sans); padding: 11px 14px; min-height: 42px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on, .chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--rose-soft); color: var(--on-rose-soft); border-color: var(--rose); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; font: 700 11px/1 var(--font-sans); letter-spacing: .05em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; }
.badge-new, .badge-free { background: var(--marigold); color: var(--on-marigold); }
.badge-soft { background: var(--rose-soft); color: var(--on-rose-soft); }
.badge-teal { background: var(--teal); color: var(--on-teal); }
.badge-gray { background: var(--paper-sunk); color: var(--ink-muted); }
.badge-ok { background: #DDF0E4; color: #1E5A37; }
.badge-bad { background: #F8DCD9; color: #8C1D17; }
.badge-warn { background: #F6E7C6; color: #6A4500; }

/* forms */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font: 600 14px/1.3 var(--font-sans); margin-bottom: 8px; }
.input, .select, .textarea { width: 100%; font: 400 16px/1.5 var(--font-sans); color: var(--ink); background: var(--paper-raised); border: 1.5px solid var(--line-strong); border-radius: var(--r-s); padding: 11px 14px; min-height: 48px; }
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.is-invalid .input, .is-invalid .textarea, .is-invalid .select, .input.is-invalid { border-color: var(--danger); }
.help { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.err { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font: 500 13px/1.4 var(--font-sans); color: var(--danger); }
.err:empty { display: none; }
.counter.warn { color: var(--warning); }
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .18s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .18s; }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* cards & tiles */
.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r-m); }
.card-pad { padding: 20px; }
a.card { text-decoration: none; color: var(--ink); transition: box-shadow .2s ease-out; }
a.card:hover { box-shadow: var(--shadow-card); color: var(--ink); }
.tile { position: relative; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 960px) { .tile { padding: 22px; } }
.tile .badge { position: absolute; top: 14px; right: 14px; }
.tile .desc { font-size: 14px; color: var(--ink-muted); display: none; }
@media (min-width: 640px) { .tile .desc { display: block; } }
.tile .go { color: var(--rose); font: 600 14px/1 var(--font-sans); display: inline-flex; gap: 4px; align-items: center; }
.design-card { overflow: hidden; display: flex; flex-direction: column; }
.design-card .preview { background: var(--paper-sunk); padding: 18px 0 0; display: flex; justify-content: center; }
.design-card .screen { width: 150px; height: 230px; border-radius: 24px 24px 0 0; border: 6px solid #241828; border-bottom: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.design-card .screen { overflow: hidden; }
.tile-motifs { position: absolute; inset: 0; pointer-events: none; }
.tile-motifs svg { position: absolute; opacity: .55; }
.design-card .screen > svg { position: relative; z-index: 1; }
.design-card .play { position: absolute; right: 8px; bottom: 8px; }
.design-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.design-card .body .btn { margin-top: auto; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font: 600 12px/1 var(--font-sans); background: var(--paper-sunk); color: var(--ink-muted); padding: 6px 8px; border-radius: 999px; }
.scroll-x .design-card { width: 78vw; max-width: 300px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--paper-raised); }
.notice b { display: block; font-size: 14px; }
.notice-info .ic { color: var(--teal); } .notice-warn .ic { color: var(--warning); } .notice-ok .ic { color: var(--success); }
.notice-err { border-color: var(--danger); } .notice-err .ic { color: var(--danger); }

/* phone frames */
.phone { width: 260px; height: 520px; border-radius: 36px; border: 8px solid #241828; overflow: hidden; position: relative; background: var(--paper); box-shadow: var(--shadow-lift); flex: none; }
.mini-phone { border-radius: 22px; border: 5px solid #241828; overflow: hidden; position: relative; flex: none; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(251, 246, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 600 23px/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.nav { display: none; gap: 26px; align-items: center; }
.nav a, .nav button { font: 600 14px/1 var(--font-sans); color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; padding: 8px 0; }
.nav a.active { color: var(--rose); }
.header-cta { display: flex; gap: 8px; align-items: center; }
.header-cta .btn-secondary { display: none; }
.burger { display: inline-grid; }
@media (min-width: 960px) { .nav { display: flex; } .burger { display: none; } .header-cta .btn-secondary { display: inline-flex; } }
.mega { position: relative; }
.mega-panel { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 620px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-lift); padding: 16px; display: none; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mega.open .mega-panel, .mega:focus-within .mega-panel { display: grid; }
.mega-panel a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; }
.mega-panel a:hover { background: var(--paper-sunk); }
.drawer { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: none; }
.drawer.open { display: block; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 90vw); background: var(--paper); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.drawer-panel a.item { display: flex; gap: 12px; align-items: center; padding: 10px 6px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: 10px; }

/* footer */
.site-footer { background: var(--paper-sunk); border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 48px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 32px; }
.foot-cols { display: flex; gap: 32px; flex-wrap: wrap; }
.foot-cols > div { flex: 1 1 150px; }
.foot-cols .brand { flex: 1.4 1 240px; display: flex; flex-direction: column; gap: 14px; }
.foot-cols a.l { display: block; color: var(--ink); text-decoration: none; font: 500 14px/1 var(--font-sans); padding: 7px 0; }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.store-badge { display: inline-flex; flex-direction: column; justify-content: center; gap: 2px; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 8px 14px; text-decoration: none; min-width: 136px; }
.store-badge small { font: 500 10px/1 var(--font-sans); opacity: .8; }
.store-badge b { font: 700 15px/1.1 var(--font-sans); }
.store-badge:hover { color: var(--paper); }
.night-band .store-badge { background: var(--on-night); color: var(--night); }

/* breadcrumb, faq */
.crumbs { font-size: 13px; color: var(--ink-muted); margin-bottom: 18px; }
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs b { color: var(--ink); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; font: 700 17px/1.35 var(--font-sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform .2s; flex: none; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p, .faq details div { margin-top: 10px; color: var(--ink-muted); max-width: 720px; line-height: 1.6; }

/* how it works */
.how { display: flex; gap: 32px; flex-wrap: wrap; }
.how > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.how .n { font: 600 44px/1 var(--font-display); color: var(--teal); }

/* prose (blog, legal) */
.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { font: 600 clamp(24px, 2.4vw, 30px)/1.2 var(--font-display); margin: 36px 0 14px; }
.prose h3 { font: 700 18px/1.4 var(--font-sans); margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose img { border-radius: var(--r-m); margin: 20px 0; }
.legal { display: flex; gap: 48px; align-items: flex-start; flex-wrap: wrap; }
.legal aside { flex: 0 0 260px; position: sticky; top: 88px; display: none; }
@media (min-width: 960px) { .legal aside { display: block; } .legal .toc-m { display: none; } }
.legal .content { flex: 1 1 560px; min-width: 0; max-width: 760px; }
.legal .prose { font-size: 16px; }

/* overlays */
.modal { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: var(--paper-raised); border-radius: var(--r-l); max-width: 520px; width: 100%; padding: 24px; max-height: 90vh; overflow: auto; }
.sheet { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: none; align-items: flex-end; justify-content: center; }
.sheet.open { display: flex; }
.sheet-box { background: var(--paper-raised); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px; padding: 16px 18px 24px; max-height: 88vh; overflow: auto; }
.sheet-box::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.video-modal .modal-box { max-width: 420px; padding: 12px; background: #241828; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font: 600 14px/1.2 var(--font-sans); opacity: 0; transition: .25s; z-index: 90; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* skeleton + empty */
.skel { background: linear-gradient(90deg, var(--line) 0%, var(--paper-sunk) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* misc */
.hero-phones { position: relative; width: 340px; height: 550px; margin: 0 auto; max-width: 100%; }
.hero-phones .back { position: absolute; left: 0; top: 30px; width: 208px; height: 416px; border-radius: 30px; border: 7px solid #241828; background: var(--night); transform: rotate(-7deg); display: grid; place-items: center; }
.hero-phones .front { position: absolute; right: 0; top: 0; width: 260px; height: 520px; border-radius: 36px; border: 8px solid #241828; background: linear-gradient(180deg, #FBE3E2, #F7C9C4); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 16px; }
@media (max-width: 639px) { .hero-phones { transform: scale(.78); transform-origin: top center; height: 440px; } }
.balloon { width: 34px; height: 44px; border-radius: 50% 50% 46% 46%; display: block; }
.promo-dashed { border: 2px dashed var(--marigold); border-radius: 20px; padding: 24px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.stars { display: flex; gap: 2px; color: var(--marigold); }
.testi blockquote { margin: 0; font: 500 16px/1.55 var(--font-sans); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--rose-soft); color: var(--on-rose-soft); display: grid; place-items: center; font: 700 14px/1 var(--font-sans); flex: none; }
.stat .d { font-size: clamp(34px, 4vw, 48px); color: var(--rose); }
.line-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.copy-btn { flex: none; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink); padding: 0 12px; }
.pager .cur { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cover { border-radius: var(--r-m); background: linear-gradient(135deg, var(--rose-soft), var(--marigold)); }
.err-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 48px 16px; }
.err-page .icon-circle { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; color: #fff; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }
