/* Aylin — component styles. Loaded after tokens.css. Prefix: ay- */

/* ---------- Grounds ----------
   Paper is the default. Any element with .ay-dark becomes a night section:
   the semantic tokens are remapped, so every component inside follows. */
.ay-dark {
  --surface: var(--night);
  --surface-raised: var(--night-raised);
  --surface-sunk: var(--night-sunk);
  --text: var(--night-text);
  --text-muted: var(--night-muted);
  --line: var(--night-line);
  --line-strong: var(--night-edge);
  --action: var(--accent-night);
  --on-action: var(--on-accent-night);
  --highlight: var(--accent-night);
  --highlight-soft: var(--accent-soft-night);
  --focus-ring: var(--accent-night);
  --mark: var(--accent-night);
  --positive: var(--success-night);
  --negative: var(--danger-night);
  color-scheme: dark;
}
.ay-paper, .ay-dark { background: var(--surface); color: var(--text); }

/* ---------- Type pairing ----------
   Instrument Serif + Instrument Sans is the default. Put data-pairing on <html>
   (or any wrapper) to test the alternatives. */
:root { --heading-scale: 1; --heading-tracking: -0.01em; --heading-weight: 400; }
[data-pairing="instrument"] { --font-heading: var(--font-heading-instrument); --font-body: var(--font-body-instrument); --heading-scale: 1; --heading-tracking: -0.01em; }
[data-pairing="fraunces"] { --font-heading: var(--font-heading-fraunces); --font-body: var(--font-body-figtree); --heading-scale: 0.92; --heading-tracking: -0.015em; }
[data-pairing="newsreader"] { --font-heading: var(--font-heading-newsreader); --font-body: var(--font-body-inter); --heading-scale: 0.92; --heading-tracking: -0.012em; }
[data-pairing] { font-family: var(--font-body); }

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

/* ---------- Type roles (phone first; desktop inside a section ≥ 760px) ---------- */
.ay-display, .ay-title, .ay-heading, .ay-subhead, .ay-figure, .ay-wordmark {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  margin: 0;
  text-wrap: balance;
}
.ay-display { font-size: calc(46px * var(--heading-scale)); line-height: 1.087; }
.ay-title { font-size: calc(36px * var(--heading-scale)); line-height: 1.167; }
.ay-heading { font-size: calc(28px * var(--heading-scale)); line-height: 1.214; }
.ay-subhead { font-size: calc(24px * var(--heading-scale)); line-height: 1.333; letter-spacing: 0; }
.ay-figure { font-size: calc(48px * var(--heading-scale)); line-height: 1.08; font-variant-numeric: lining-nums; }
.ay-lead { font-size: 19px; line-height: 29px; margin: 0; color: var(--text-muted); text-wrap: pretty; }
.ay-body { font-size: 17px; line-height: 27px; margin: 0; text-wrap: pretty; }
.ay-label { font-size: 16px; line-height: 20px; font-weight: 500; }
.ay-kicker { font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0.01em; color: var(--highlight); margin: 0; }
.ay-status { font-size: 15px; line-height: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ay-caption { font-size: 14px; line-height: 21px; color: var(--text-muted); margin: 0; }
.ay-measure { max-width: var(--measure); }
.ay-hl { background: var(--highlight-soft); color: inherit; border-radius: var(--radius-xs); padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Section + container ---------- */
.ay-section { container-type: inline-size; }
.ay-section > .ay-container { padding-top: var(--space-9); padding-bottom: var(--space-9); }
.ay-container { box-sizing: border-box; width: 100%; max-width: calc(var(--container) + 2 * var(--gutter-desktop)); margin: 0 auto; padding: 0 var(--gutter-phone); }
.ay-section-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-7); max-width: 40rem; }
.ay-section-head .ay-lead { max-width: var(--measure); }

@container (min-width: 760px) {
  .ay-container { padding: 0 var(--gutter-desktop); }
  .ay-display { font-size: calc(76px * var(--heading-scale)); line-height: 1.053; }
  .ay-title { font-size: calc(52px * var(--heading-scale)); line-height: 1.115; }
  .ay-heading { font-size: calc(34px * var(--heading-scale)); line-height: 1.235; }
  .ay-figure { font-size: calc(64px * var(--heading-scale)); line-height: 1; }
  .ay-lead { font-size: 21px; line-height: 32px; }
  .ay-body { font-size: 18px; line-height: 29px; }
  .ay-section-head { margin-bottom: var(--space-8); }
}
@container (min-width: 760px) { .ay-section > .ay-container { padding-top: var(--space-10); padding-bottom: var(--space-10); } }

/* ---------- Focus ---------- */
.ay-btn:focus-visible, .ay-field:focus-visible, .ay-navlink:focus-visible, .ay-acc-q:focus-visible, .ay-footer a:focus-visible, .ay-logo:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Mark + logo ---------- */
.ay-mark { display: inline-block; fill: var(--mark); flex: none; }
.ay-mark-accent { fill: var(--highlight); }
.ay-dark .ay-mark-accent { fill: var(--accent-night); }
.ay-logo { display: inline-flex; align-items: center; gap: 0.32em; color: var(--text); text-decoration: none; font-size: 26px; border-radius: var(--radius-xs); }
.ay-logo .ay-mark { height: 0.86em; width: auto; }
.ay-wordmark { font-size: 1em; line-height: 1; letter-spacing: -0.005em; transform: translateY(0.02em); }

/* ---------- Buttons ---------- */
.ay-btn {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-target);
  padding: 0 var(--space-5);
  font-family: var(--font-body); font-size: 16px; line-height: 20px; font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.ay-btn-primary { background: var(--action); color: var(--on-action); border-color: var(--action); }
.ay-btn-primary:hover { background: color-mix(in srgb, var(--action) 88%, var(--text)); border-color: color-mix(in srgb, var(--action) 88%, var(--text)); }
.ay-btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.ay-btn-secondary:hover { border-color: var(--text); }
.ay-btn-sm { min-height: 40px; padding: 0 var(--space-4); font-size: 15px; }
.ay-btn[aria-disabled="true"], .ay-btn:disabled { opacity: 0.55; cursor: default; }
.ay-btn-block { width: 100%; }
.ay-btn .ay-icon { width: 18px; height: 18px; }

/* ---------- Icons ---------- */
.ay-icon { display: inline-block; width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- Waitlist form ---------- */
.ay-form { display: grid; gap: var(--space-2); max-width: 34rem; }
.ay-form-label { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); }
.ay-form-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ay-field {
  box-sizing: border-box; flex: 1 1 15rem; min-width: 0;
  min-height: var(--tap-target);
  padding: 0 var(--space-4);
  font-family: var(--font-body); font-size: 17px; color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.ay-field::placeholder { color: var(--text-muted); opacity: 1; }
.ay-field[aria-invalid="true"] { border-color: var(--negative); box-shadow: inset 0 0 0 1px var(--negative); }
.ay-form-row .ay-btn { flex: 1 1 auto; }
@container (min-width: 520px) { .ay-form-row .ay-btn { flex: 0 0 auto; } }
.ay-form-msg { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 15px; line-height: 22px; color: var(--text); margin: var(--space-1) 0 0; }
.ay-form-msg .ay-icon { margin-top: 1px; }
.ay-form-msg-ok .ay-icon { color: var(--positive); }
.ay-form-msg-err .ay-icon { color: var(--negative); }
.ay-form-note { font-size: 14px; line-height: 21px; color: var(--text-muted); margin: var(--space-1) 0 0; }
.ay-form-done { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); }
.ay-form-done .ay-icon { color: var(--positive); margin-top: 2px; }
.ay-form-done strong { display: block; font-weight: 600; }
.ay-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top navigation ---------- */
.ay-nav { container-type: inline-size; }
.ay-nav-inner { display: flex; align-items: center; gap: var(--space-3); min-height: 72px; }
.ay-nav .ay-btn-sm { padding: 0 var(--space-3); }
.ay-nav .ay-logo { margin-right: auto; font-size: 24px; }
.ay-navlink { white-space: nowrap; font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; border-radius: var(--radius-xs); padding: var(--space-2) 0; }
.ay-navlink:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@container (min-width: 760px) { .ay-nav-inner { gap: var(--space-6); min-height: 88px; } .ay-nav .ay-logo { font-size: 28px; } .ay-nav .ay-btn-sm { padding: 0 var(--space-4); } }
@container (max-width: 379px) { .ay-navlink { display: none; } }

/* ---------- Live line ---------- */
.ay-live { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); }
.ay-live b { color: var(--text); font-weight: 600; }
.ay-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--highlight); flex: none; animation: ay-breathe 3.2s ease-in-out infinite; }
@keyframes ay-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Fold (the ribbon thread) ---------- */
.ay-fold { display: block; width: 100%; height: 24px; color: var(--line-strong); }
.ay-fold line, .ay-fold polyline { stroke: currentColor; stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.ay-fold .ay-fold-flap { fill: var(--highlight); stroke: none; }

/* ---------- Stat ---------- */
.ay-stats { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.ay-stat { display: grid; gap: var(--space-2); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.ay-stat .ay-figure { color: var(--highlight); }
.ay-stat-label { font-size: 16px; line-height: 23px; color: var(--text); margin: 0; }
.ay-stat-note { font-size: 14px; line-height: 21px; color: var(--text-muted); margin: 0; }

/* ---------- Screenshot frame ---------- */
.ay-frame { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); overflow: hidden; box-shadow: var(--shadow-frame); }
.ay-dark .ay-frame { box-shadow: none; border-color: var(--night-line); }
.ay-frame-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-sunk); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; color: var(--text-muted); }
.ay-frame-bar .ay-mark { height: 14px; width: auto; }
.ay-frame-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ay-frame-body { display: block; }
.ay-frame-body img { display: block; width: 100%; height: auto; }
.ay-frame-cap { padding: var(--space-3) var(--space-1) 0; }

/* console content used inside the frame */
.ay-console { padding: var(--space-5); display: grid; gap: var(--space-4); }
.ay-console-greet { font-family: var(--font-heading); font-size: calc(26px * var(--heading-scale)); line-height: 1.2; margin: 0; letter-spacing: var(--heading-tracking); }
.ay-console-row { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 22px; }
.ay-console-row .ay-icon { width: 18px; height: 18px; margin-top: 2px; color: var(--text-muted); }
.ay-console-row.is-moved .ay-icon { color: var(--highlight); }
.ay-console-row.is-ask .ay-icon { color: var(--highlight); }
.ay-console-row small { display: block; font-size: 14px; line-height: 20px; color: var(--text-muted); }
@container (min-width: 760px) { .ay-console { padding: var(--space-6) var(--space-7); } }

/* ---------- Lists: "for you if" and "never" ---------- */
.ay-list { list-style: none; margin: 0; padding: 0; display: grid; max-width: 44rem; }
.ay-list li { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-4); padding: var(--space-5) 0; border-top: 1px solid var(--line); font-size: 17px; line-height: 27px; }
.ay-list li:last-child { border-bottom: 1px solid var(--line); }
.ay-list .ay-icon { width: 22px; height: 22px; margin-top: 3px; }
.ay-list-for .ay-icon { color: var(--highlight); }
.ay-list-never .ay-icon { color: var(--text-muted); }
.ay-list-never li span { text-decoration: none; }
@container (min-width: 760px) { .ay-list li { font-size: 18px; line-height: 29px; } }

/* ---------- Steps ---------- */
.ay-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-7); counter-reset: none; }
.ay-step { display: grid; gap: var(--space-3); align-content: start; }
.ay-step-n { font-family: var(--font-heading); font-size: calc(48px * var(--heading-scale)); line-height: 1; color: var(--highlight); letter-spacing: var(--heading-tracking); }
.ay-step p { margin: 0; color: var(--text-muted); font-size: 17px; line-height: 27px; }
@container (min-width: 760px) {
  .ay-steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
  .ay-step { padding-top: var(--space-5); border-top: 1px solid var(--line); }
  .ay-step p { font-size: 18px; line-height: 29px; }
}

/* ---------- Price card (the one corner fold) ---------- */
.ay-price { position: relative; display: grid; gap: var(--space-5); padding: var(--space-6) var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); max-width: 30rem; clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%); }
.ay-price::after { content: ""; position: absolute; top: 0; right: 0; width: 28px; height: 28px; background: var(--highlight); clip-path: polygon(0 0, 0 100%, 100% 100%); }
.ay-price-name { font-size: 15px; font-weight: 600; color: var(--highlight); margin: 0; }
.ay-price-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2); }
.ay-price-amount .ay-heading { font-size: calc(48px * var(--heading-scale)); line-height: 1; }
.ay-price-amount span { color: var(--text-muted); font-size: 16px; }
.ay-price ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ay-price li { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); font-size: 16px; line-height: 24px; }
.ay-price li .ay-icon { width: 18px; height: 18px; margin-top: 3px; color: var(--highlight); }
.ay-price-seats { font-size: 15px; line-height: 22px; color: var(--text); padding-top: var(--space-4); border-top: 1px solid var(--line); margin: 0; }
@container (min-width: 760px) { .ay-price { padding: var(--space-7) var(--space-7) var(--space-6); } }

/* ---------- Accordion ---------- */
.ay-acc { max-width: 48rem; border-top: 1px solid var(--line); }
.ay-acc-item { border-bottom: 1px solid var(--line); }
.ay-acc-q { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr 24px; gap: var(--space-4); align-items: center; width: 100%; padding: var(--space-5) 0; cursor: pointer; color: var(--text); font-family: var(--font-heading); font-weight: var(--heading-weight); letter-spacing: 0; font-size: calc(22px * var(--heading-scale)); line-height: 1.3; border-radius: var(--radius-sm); }
.ay-acc-q .ay-icon { width: 20px; height: 20px; color: var(--highlight); transition: transform 200ms ease; }
.ay-acc-q[aria-expanded="true"] .ay-icon { transform: rotate(45deg); }
.ay-acc-a { padding: 0 var(--space-7) var(--space-5) 0; color: var(--text-muted); font-size: 17px; line-height: 27px; max-width: var(--measure); }
.ay-acc-a[hidden] { display: none; }
@container (min-width: 760px) { .ay-acc-q { font-size: calc(24px * var(--heading-scale)); } .ay-acc-a { font-size: 18px; line-height: 29px; } }

/* ---------- Footer ---------- */
.ay-footer { container-type: inline-size; background: var(--surface-sunk); color: var(--text-muted); border-top: 1px solid var(--line); }
.ay-footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding-top: var(--space-6); padding-bottom: var(--space-6); font-size: 14px; line-height: 21px; }
.ay-footer .ay-logo { font-size: 20px; margin-right: auto; }
.ay-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.ay-footer a { color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; border-radius: var(--radius-xs); }
.ay-footer a:hover { color: var(--text); }

/* ---------- Section layouts ---------- */
.ay-hero > .ay-container.ay-hero-main { padding-top: var(--space-7); }
.ay-hero-body { display: grid; gap: var(--space-5); max-width: 46rem; }
.ay-hero-body .ay-form { margin-top: var(--space-2); }
.ay-hero .ay-live { margin-top: var(--space-2); }
@container (min-width: 760px) { .ay-hero-body { gap: var(--space-6); } .ay-hero > .ay-container.ay-hero-main { padding-top: var(--space-9); } }

.ay-proof-grid { display: grid; gap: var(--space-7); }
@container (min-width: 960px) { .ay-proof-grid { grid-template-columns: 7fr 4fr; align-items: start; gap: var(--space-8); } .ay-proof-grid .ay-stats { grid-template-columns: 1fr; } }

.ay-final { text-align: left; }
.ay-final-body { display: grid; gap: var(--space-5); max-width: 40rem; }

/* ---------- Motion: gentle reveal ---------- */
.ay-reveal { animation: ay-reveal 600ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes ay-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ay-reveal, .ay-live-dot { animation: none; }
  .ay-btn, .ay-acc-q .ay-icon { transition: none; }
}
