/* Puppage — web surfaces (ops dashboards + rescue landing).
   Shared design tokens, mirrored from constants/theme.ts so the web app reads as
   one system with the mobile app. Kept as a lightweight static site so it stays
   separate from the Expo/React Native build. */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Instrument+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #F5EFE6;
  --surface: #FFFFFF;
  --surface-muted: #EDE3D8;
  --border: #DDD0C0;
  --hairline: #F5EFE6;
  --primary: #8B5C3A;
  --primary-pressed: #7A4E30;
  --text: #2C1A0E;
  --text-body: #4A3626;
  --muted: #9A8272;
  --faint: #B09A88;
  --chip-text: #6B4A2A;
  --error-text: #A04B2E;
  --error-bg: #FFF6F2;
  --error-bg-alt: #F7E3D9;
  --error-border: #E8C4B0;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Instrument Sans', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(44,26,14,0.04), 0 6px 18px rgba(44,26,14,0.05);
  --shadow-md: 0 1px 2px rgba(44,26,14,0.04), 0 8px 24px rgba(44,26,14,0.06);
  --shadow-lg: 0 1px 2px rgba(44,26,14,0.04), 0 12px 32px rgba(44,26,14,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }

/* Keyboard focus — visible brand ring on every interactive element. The ring
   follows each element's own radius; bare links get 4px so the ring doesn't
   read as a browser default rectangle. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
a:not([class]):focus-visible { border-radius: 4px; }

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }

/* ── Ops chrome ── */
.ops-nav {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 32px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.ops-wordmark { font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: 0.35em; color: var(--text); }
.ops-nav-links { display: flex; gap: 22px; margin-left: 8px; }
.ops-nav-links a { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ops-nav-links a.active { color: var(--primary); font-weight: 600; }
.ops-nav .env { margin-left: auto; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.page { max-width: 1160px; margin: 0 auto; padding: 28px 32px 40px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title-row { display: flex; align-items: baseline; gap: 16px; }
.page-title { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--text); }
.page-sub { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.head-actions { display: flex; gap: 8px; }

/* ── Buttons ── */
.btn { font-size: 11.5px; border-radius: 999px; padding: 7px 16px; cursor: pointer; border: none; font-family: var(--sans); }
.btn-primary { font-weight: 600; color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-pressed); }
.btn-ghost { color: var(--muted); border: 1px solid var(--border); background: var(--surface); }
.link-action { font-size: 11.5px; font-weight: 600; color: var(--primary); cursor: pointer; }

/* ── KPI tiles ── */
.kpis { margin-top: 20px; display: grid; gap: 12px; }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpi { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.kpi-value { margin-top: 6px; font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--text); line-height: 1; }
.kpi-note { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.kpi-note.accent { color: var(--primary); }
.kpi.alert { background: var(--error-bg); border: 1px solid var(--error-border); }
.kpi.alert .kpi-label, .kpi.alert .kpi-value, .kpi.alert .kpi-note { color: var(--error-text); }

/* ── Cards & charts ── */
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); overflow: hidden; }
.chart-card { margin-top: 20px; padding: 18px 22px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; }
.chart-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--primary); }
.chart-meta { font-size: 11px; color: var(--muted); }

/* ── Tables ── */
.table { margin-top: 20px; }
.trow { display: grid; gap: 12px; padding: 14px 22px; align-items: center; border-bottom: 1px solid var(--hairline); }
.trow:last-child { border-bottom: none; }
.thead { padding: 12px 22px; background: var(--surface-muted); }
.thead span { font-size: 9px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tcell { font-size: 12.5px; color: var(--text); }
.tcell.muted { color: var(--muted); }
.trow.alert { background: var(--error-bg); }

/* ── Badges / chips ── */
.badge { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; display: inline-block; }
.badge.brown { color: #fff; background: var(--primary); }
.badge.stone { color: var(--chip-text); background: var(--surface-muted); }
.badge.outline { color: var(--muted); border: 1px solid var(--border); }
.badge.error { color: var(--error-text); background: var(--error-bg-alt); }
.amount-owed { font-weight: 600; color: var(--error-text); }
.code { font-family: var(--mono); font-size: 11px; color: var(--text); }

.footnote { margin-top: 14px; font-size: 11.5px; color: var(--muted); }

/* ── Public rescue landing (13a) ── */
.landing { max-width: 720px; margin: 0 auto; padding: 48px 28px 64px; }
.landing-brand { display: flex; align-items: center; gap: 12px; }
.landing-brand img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.landing-brand .wm { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: 0.32em; color: var(--text); }
.landing-eyebrow { margin-top: 36px; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.landing-title { margin-top: 14px; font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: 1.08; color: var(--text); }
.landing-sub { margin-top: 18px; font-size: 15px; line-height: 1.65; color: var(--text-body); max-width: 600px; }

.landing-grid { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.landing-card { background: var(--surface); border-radius: 18px; padding: 26px 24px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.landing-card .book-mark { width: 44px; height: 56px; border-radius: 4px 8px 8px 4px; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; box-shadow: inset 3px 0 0 var(--primary); }
.landing-card .give-mark { font-family: var(--serif); font-weight: 600; font-size: 30px; color: var(--primary); }
.landing-card h2 { margin: 16px 0 0; font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--text); }
.landing-card p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); flex: 1; }
.landing-card .btn { margin-top: 20px; text-align: center; padding: 12px 18px; font-size: 13px; }
.btn-outline { color: var(--primary); border: 1.5px solid var(--primary); background: transparent; border-radius: 999px; font-weight: 600; }
.btn-outline:hover { background: var(--surface-muted); }

.landing-banner { margin-top: 28px; background: var(--surface-muted); border-radius: 18px; padding: 30px 28px; }
.landing-banner .banner-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--chip-text); }
.landing-banner h2 { margin: 10px 0 0; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.15; color: var(--text); }
.landing-banner p { margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-body); max-width: 540px; }
.landing-banner .code-line { margin-top: 18px; display: inline-block; font-family: var(--mono); font-size: 14px; letter-spacing: 0.14em; color: var(--chip-text); border: 1.5px dashed var(--primary); border-radius: 10px; padding: 10px 18px; background: var(--surface); }
.landing-banner .btn { margin-top: 20px; padding: 12px 22px; font-size: 13px; }
.landing-footer { margin-top: 40px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 560px) {
  .landing-grid { grid-template-columns: 1fr; }
  .landing-title { font-size: 34px; }
}

/* ── Marketing site (getpuppage.app) ── */
/* Smooth in-page anchor jumps (nav → #features/#pricing/#download). The
   reduced-motion block forces this back to `auto` for motion-sensitive users. */
html { scroll-behavior: smooth; }

.mk { overflow-x: hidden; }
.mk-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; background: rgba(245,239,230,0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.mk-nav .wm { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: 0.34em; color: var(--text); }
.mk-nav-links { display: flex; align-items: center; gap: 26px; }
.mk-nav-links a { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mk-nav-links a:hover { color: var(--text); }
.mk-nav .btn { padding: 9px 20px; font-size: 12px; }
@media (max-width: 720px) { .mk-nav-links .nav-only { display: none; } }

.mk-wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* Hero */
.mk-hero { position: relative; padding: 64px 0 40px; }
.mk-hero-grid { display: grid; grid-template-columns: 1fr 0.9fr; gap: 40px; align-items: center; }
.mk-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--primary); }
.mk-h1 { margin: 18px 0 0; font-family: var(--serif); font-weight: 600; font-size: 58px; line-height: 1.04; color: var(--text); letter-spacing: -0.01em; }
.mk-lede { margin: 22px 0 0; font-size: 17px; line-height: 1.6; color: var(--text-body); max-width: 460px; }
.mk-store-row { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.mk-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* Store buttons */
.store-btn { display: inline-flex; align-items: center; gap: 11px; background: var(--text); color: #fff; border-radius: 14px; padding: 11px 18px; }
.store-btn:hover { background: #1c1008; }
.store-btn svg { flex-shrink: 0; }
.store-btn > span { display: inline-flex; flex-direction: column; }
.store-btn .sb-small { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #d8c8b8; line-height: 1; }
.store-btn .sb-big { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.05; margin-top: 2px; color: #fff; }

/* Phone mockup */
.phone { position: relative; width: 268px; margin: 0 auto; border-radius: 40px; background: #241608; padding: 10px; box-shadow: 0 30px 60px rgba(44,26,14,0.22), 0 8px 20px rgba(44,26,14,0.12); }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.14); z-index: 2; }
/* height:auto beats the height="…" attribute hint, keeping the aspect ratio
   when width scales (the attributes still reserve space pre-load). */
.phone img { display: block; width: 100%; height: auto; border-radius: 31px; }
.phone.tilt { transform: rotate(2.4deg); }
.phone.tilt-l { transform: rotate(-2.4deg); }

/* Feature rows */
.mk-features { padding: 40px 0; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 44px 0; }
.feature.flip .feature-media { order: 2; }
.feature-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--primary); }
.feature h2 { margin: 14px 0 0; font-family: var(--serif); font-weight: 600; font-size: 36px; line-height: 1.1; color: var(--text); }
.feature p { margin: 16px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--text-body); max-width: 440px; }
.feature-media { display: flex; justify-content: center; }

/* Benefits strip */
.mk-benefits { padding: 48px 0; }
.mk-section-head { text-align: center; max-width: 620px; margin: 0 auto; }
.mk-section-head .feature-eyebrow { display: block; }
.mk-section-head h2 { margin: 12px 0 0; font-family: var(--serif); font-weight: 600; font-size: 34px; color: var(--text); }
.mk-section-head p { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-body); }
.benefit-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.benefit { background: var(--surface); border-radius: 18px; padding: 26px 24px; box-shadow: var(--shadow-md); }
.benefit .b-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; }
.benefit h3 { margin: 16px 0 0; font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--text); }
.benefit p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* Rescue band */
.mk-rescue { margin: 40px 0; background: var(--surface-muted); border-radius: 24px; padding: 48px 44px; text-align: center; }
.mk-rescue .feature-eyebrow { color: var(--chip-text); }
.mk-rescue h2 { margin: 12px 0 0; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.14; color: var(--text); max-width: 620px; margin-left: auto; margin-right: auto; }
.mk-rescue p { margin: 16px auto 0; font-size: 15px; line-height: 1.65; color: var(--text-body); max-width: 560px; }

/* Pricing teaser */
.mk-pricing { padding: 40px 0; }
.price-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 760px; margin-left: auto; margin-right: auto; }
.price-card { background: var(--surface); border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow-md); position: relative; }
.price-card.feat { box-shadow: var(--shadow-lg); }
.price-badge { position: absolute; top: 22px; right: 22px; font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; background: var(--primary); border-radius: 999px; padding: 5px 11px; }
.price-name { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.price-amt { margin-top: 10px; font-family: var(--serif); font-weight: 600; font-size: 40px; color: var(--text); line-height: 1; }
.price-amt span { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-note { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.price-list { margin: 18px 0 0; padding: 0; list-style: none; }
.price-list li { position: relative; padding: 7px 0 7px 24px; font-size: 13.5px; color: var(--text-body); border-top: 1px solid var(--hairline); }
.price-list li:first-child { border-top: none; }
.price-list li svg { position: absolute; left: 0; top: 9px; }

/* CTA band */
.mk-cta { margin: 8px 0 0; padding: 64px 0; text-align: center; }
.mk-cta h2 { font-family: var(--serif); font-weight: 600; font-size: 44px; line-height: 1.08; color: var(--text); }
.mk-cta p { margin: 16px auto 0; font-size: 16px; color: var(--text-body); max-width: 480px; }
.mk-cta .mk-store-row { justify-content: center; }

/* Footer */
.mk-footer { border-top: 1px solid var(--border); padding: 34px 0 48px; }
.mk-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.mk-footer .wm { font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: 0.32em; color: var(--text); }
.mk-footer .tag { font-size: 13px; color: var(--muted); }
.mk-footer-links { display: flex; gap: 22px; }
.mk-footer-links a { font-size: 12.5px; color: var(--muted); }

@media (max-width: 860px) {
  .mk-hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .mk-h1 { font-size: 46px; }
  .mk-hero .phone { margin-top: 24px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 28px; }
  .feature.flip .feature-media { order: 0; }
  .feature h2 { font-size: 30px; }
  .benefit-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .mk-cta h2 { font-size: 34px; }
  .mk-rescue { padding: 36px 24px; }
}

/* ── Puppage Studio (puppage.ai) — frames 15a / 15b / 15c ── */
.studio { background: var(--bg); min-height: 100vh; font-family: var(--sans); color: var(--text); }
.studio-wrap { margin: 0 auto; }
.st-hide { display: none !important; }
/* Studio state changes crossfade in (Studio.show adds st-entering for a frame). */
.st-state-view { transition: opacity 220ms ease-out, transform 220ms ease-out; }
.st-state-view.st-entering { opacity: 0; transform: translateY(12px); }

/* Shared bits */
.st-brand-mark { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 8px 22px rgba(44,26,14,0.12); display: block; }
.st-wordmark { font-family: var(--serif); font-weight: 600; font-size: 12px; letter-spacing: 0.4em; padding-left: 0.4em; color: var(--text); }
.st-pill-btn { display: inline-block; text-align: center; background: var(--primary); color: #fff; border: none; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(139,92,58,0.28); font-family: var(--sans); }
.st-pill-btn:hover { background: var(--primary-pressed); }
.st-pill-outline { display: inline-block; text-align: center; background: transparent; color: var(--primary); border: 1.5px solid var(--border); border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; box-sizing: border-box; font-family: var(--sans); }
.st-pill-outline:hover { border-color: var(--primary); }

/* 15a — tokens paywall */
.st-paywall { max-width: 860px; margin: 0 auto; padding: 52px 40px 64px; }
.st-center { text-align: center; }
.st-kicker { margin-top: 14px; text-align: center; font-family: var(--serif); font-weight: 600; font-size: 12px; letter-spacing: 0.4em; padding-left: 0.4em; color: var(--text); }
.st-h1 { margin-top: 24px; text-align: center; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.12; color: var(--text); }
.st-sub { margin-top: 14px; text-align: center; font-size: 15px; line-height: 26px; color: var(--muted); max-width: 480px; margin-left: auto; margin-right: auto; }
.st-cards { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 620px; margin-left: auto; margin-right: auto; }
.st-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.st-card.feat { border-color: var(--primary); box-shadow: 0 8px 24px rgba(139,92,58,0.12); }
.st-card-badge { position: absolute; top: -9px; font-size: 8.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; background: var(--primary); border-radius: 999px; padding: 4px 10px; }
.st-price { margin-top: 6px; font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1; color: var(--text); }
.st-price-unit { margin-top: 8px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.st-card-blurb { margin-top: 10px; font-size: 12.5px; line-height: 19px; color: var(--muted); }
.st-card .st-pill-btn, .st-card .st-pill-outline { margin-top: 16px; width: 100%; padding: 14px 0; }
.st-card-note { margin-top: 10px; font-size: 11px; color: var(--muted); }
.st-foot { margin-top: 26px; text-align: center; font-size: 11.5px; color: var(--muted); }

/* 15b — composer */
.st-composer { max-width: 980px; margin: 0 auto; padding: 40px 40px 64px; }
.st-topbar { display: flex; align-items: center; justify-content: space-between; }
.st-topbar-left { display: flex; align-items: center; gap: 12px; }
.st-topbar-left img { width: 34px; height: 34px; border-radius: 9px; }
.st-topbar-left .st-wordmark { font-size: 12px; letter-spacing: 0.32em; }
.st-sessions { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 8px 16px; box-shadow: 0 1px 3px rgba(44,26,14,0.08); }
.st-sessions span { font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.st-grid { margin-top: 30px; display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }
.st-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.st-step { font-size: 10px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.st-photo-card { background: var(--surface); border-radius: 20px; padding: 12px; box-shadow: 0 1px 2px rgba(44,26,14,0.04), 0 10px 28px rgba(44,26,14,0.07); }
.st-photo-slot { height: 250px; border-radius: 12px; background: repeating-linear-gradient(-45deg, #EDE3D8 0 14px, #F1E8DC 14px 28px); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.st-photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.st-photo-slot .hint { font-family: var(--mono); font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.85); border-radius: 8px; padding: 8px 14px; }
.st-photo-help { padding: 12px 8px 4px; font-size: 11.5px; line-height: 17px; color: var(--muted); }
.st-scene-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 15px 18px; }
.st-scene-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.st-scene-label .soft { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.st-scene-input { margin-top: 8px; width: 100%; border: none; resize: none; background: transparent; font-family: var(--sans); font-size: 14.5px; line-height: 23px; color: var(--text); }
.st-scene-input:focus { outline: none; } /* the card itself shows :focus-within below */
.st-scene-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-scene-input::placeholder { color: var(--muted); }
.st-scene-meta { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.st-themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.st-theme { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 8px; text-align: center; cursor: pointer; }
.st-theme:hover { border-color: var(--faint); }
.st-theme span { font-size: 11.5px; font-weight: 500; color: var(--text-body); }
.st-theme.on { border-color: var(--primary); }
.st-theme.on span { font-weight: 600; color: var(--primary); }
.st-behind { margin-top: 8px; background: var(--surface-muted); border-radius: 16px; padding: 16px 20px; }
.st-behind-h { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--primary); cursor: pointer; list-style: none; }
.st-behind-h::-webkit-details-marker { display: none; }
.st-behind-h::after { content: ' +'; }
.st-behind[open] .st-behind-h::after { content: ' –'; }
.st-behind-p { margin-top: 8px; font-size: 12.5px; line-height: 20px; color: var(--chip-text); }
.st-run-row { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.st-run-note { font-size: 12px; color: var(--muted); }
.st-run-sessions { display: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Studio on phone width — single column: photo → scene → theme chips in a
   horizontal scroll row → collapsible mainstays → sticky paint bar with the
   session count beside it. Results stack vertically, selected card first. */
@media (max-width: 720px) {
  .st-grid { grid-template-columns: 1fr; gap: 18px; }
  .st-themes { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .st-theme { flex: 0 0 auto; border-radius: 999px; padding: 9px 16px; }
  .st-composer { padding-bottom: 92px; }
  .st-run-row {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg); box-shadow: 0 -8px 24px rgba(44,26,14,0.10);
  }
  .st-run-note { display: none; }
  .st-run-sessions { display: inline; }
  .st-results .st-takes { grid-template-columns: 1fr; }
  .st-results .st-take.on { order: -1; }
}
.st-run-btn { padding: 15px 44px; }

/* 15c — results */
.st-results { max-width: 1020px; margin: 0 auto; padding: 44px 40px 64px; }
.st-results-eyebrow { text-align: center; font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--primary); }
.st-results-h1 { margin-top: 12px; text-align: center; font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.12; color: var(--text); }
.st-takes { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.st-take { background: var(--surface); border-radius: 18px; padding: 10px; border: 2px solid transparent; cursor: pointer; transition: border-color 120ms ease-out, box-shadow 120ms ease-out; animation: st-rise 220ms ease-out backwards; }
.st-take:nth-child(2) { animation-delay: 40ms; }
.st-take:nth-child(3) { animation-delay: 80ms; }
@keyframes st-rise { from { opacity: 0; transform: translateY(8px); } }
.st-take:hover { border-color: var(--border); }
.st-take.on { border-color: var(--primary); box-shadow: 0 12px 32px rgba(139,92,58,0.16); }
/* Selection lands with a small spring — overshooting check, settling card. */
.st-take.on .st-take-check { animation: st-check-pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes st-check-pop { from { transform: scale(0.4); opacity: 0; } }
.st-take-img { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: repeating-linear-gradient(-45deg, #EDE3D8 0 14px, #F1E8DC 14px 28px); display: flex; align-items: center; justify-content: center; position: relative; }
.st-take-img img { width: 100%; height: 100%; object-fit: cover; }
.st-take-img .ver { font-family: var(--mono); font-size: 10px; color: var(--muted); background: rgba(255,255,255,0.85); border-radius: 8px; padding: 6px 12px; }
.st-take-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); display: none; align-items: center; justify-content: center; }
.st-take.on .st-take-check { display: flex; }
.st-take-cap { padding: 10px 8px 4px; text-align: center; font-size: 11.5px; color: var(--muted); }
.st-take.on .st-take-cap { font-weight: 600; color: var(--primary); }
.st-actions { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.st-actions .st-pill-btn { padding: 15px 40px; }
.st-actions .st-pill-outline { padding: 15px 30px; }
.st-results-foot { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* generating + error states */
.st-state { max-width: 640px; margin: 0 auto; padding: 40px; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.st-state-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--primary); }
.st-state-title { margin-top: 12px; font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--text); }
.st-state-sub { margin-top: 10px; font-size: 14px; line-height: 22px; color: var(--muted); max-width: 380px; }
.st-state .st-pill-btn { margin-top: 26px; padding: 14px 40px; }

/* paw-walk loader (CSS port of components/PawLoader.tsx) */
.paw-walk { position: relative; width: 120px; height: 300px; }
.paw-walk .paw { position: absolute; left: 50%; width: 30px; height: 30px; opacity: 0; animation: pawStep 5.14s infinite ease-in-out; }
@keyframes pawStep {
  0% { opacity: 0; transform: scale(0.55); }
  7% { opacity: 1; transform: scale(1); }
  52% { opacity: 1; }
  68% { opacity: 0; }
  100% { opacity: 0; }
}

/* ── Motion (approved tokens: 220ms ease-out enters, 12px rise, 40ms stagger,
      120ms press) ── */

/* Scroll reveals — .reveal is only ever added by reveal.js, so without JS the
   content is simply visible. Group items get their stagger via inline delay. */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 220ms ease-out, transform 220ms ease-out; }
.reveal.in { opacity: 1; transform: none; }

/* Press feedback — pills and buttons compress slightly, mirroring the app's
   0.96/0.98 press tiers. Links dim only. */
.btn, .store-btn, .st-pill-btn, .st-pill-outline, .st-theme {
  transition: transform 120ms ease-out, background 120ms ease-out, border-color 120ms ease-out, opacity 120ms ease-out;
}
.btn:active, .store-btn:active, .st-pill-btn:active, .st-pill-outline:active { transform: scale(0.97); }
.st-theme:active { transform: scale(0.97); }
a:not([class]):active { opacity: 0.6; }

/* Reduced motion — the paw trail stands still (soft static prints) and any
   transitions collapse to instant. Mirrors the app's useReducedMotion gating. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .paw-walk .paw { animation: none; opacity: 0.45; transform: none; }
}

/* ══ Landing v2 — the scroll story (getpuppage.app) ══════════════════════════
   Hero stage with drifting memory cards, ambient paw trail, count-up stats,
   masked word reveals. All motion is transform/opacity; ambient CSS loops are
   gated by prefers-reduced-motion at the bottom of this file. */

/* Hero shell */
.hero-v2 { position: relative; padding: 84px 0 216px; overflow: hidden; }
.hero-v2 .mk-hero-grid { position: relative; z-index: 2; }

/* Soft linen blooms breathing behind everything */
.hero-bloom { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: 0; will-change: transform; backface-visibility: hidden; }
.bloom-a { width: 560px; height: 560px; top: -180px; right: -120px; background: radial-gradient(circle, rgba(139,92,58,0.13), rgba(139,92,58,0) 70%); animation: bloomDrift 16s ease-in-out infinite alternate; }
.bloom-b { width: 460px; height: 460px; bottom: -200px; left: -140px; background: radial-gradient(circle, rgba(221,208,192,0.55), rgba(221,208,192,0) 70%); animation: bloomDrift 20s ease-in-out infinite alternate-reverse; }
@keyframes bloomDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-36px, 28px, 0) scale(1.08); }
}

/* Ambient paw trail climbing behind the headline */
.hero-paws { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hpaw { position: absolute; width: 30px; height: 30px; fill: var(--primary); opacity: 0; will-change: transform, opacity; backface-visibility: hidden; animation: pawStep 5.14s infinite ease-in-out; }
.hp1 { left: 6%;  bottom: 10%; transform: rotate(-14deg); animation-delay: 0s; }
.hp2 { left: 11%; bottom: 26%; transform: rotate(11deg);  animation-delay: 0.86s; }
.hp3 { left: 5%;  bottom: 42%; transform: rotate(-10deg); animation-delay: 1.71s; }
.hp4 { left: 10%; bottom: 58%; transform: rotate(12deg);  animation-delay: 2.57s; }
.hp5 { left: 4%;  bottom: 74%; transform: rotate(-12deg); animation-delay: 3.43s; }
.hero-paws .hpaw { opacity: 0; }
@media (max-width: 1180px) { .hero-paws { display: none; } }

/* The stage: phone + floating memory cards at different depths */
.hero-stage { position: relative; min-height: 560px; display: flex; align-items: center; justify-content: center; }
.hero-phone { z-index: 2; will-change: transform; backface-visibility: hidden; transform: rotate(2.4deg); }

.mem-card {
  position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); will-change: transform;
}
.mem-date { font-size: 8.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.mem-title { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--text); white-space: nowrap; }
/* Static tilt lives on the independent `rotate` property (not `transform`), so
   it composes with the JS scroll-parallax `transform` and the `translate` bob
   below instead of being overwritten by them. */
.mem-a { top: 8%; left: -6%; rotate: -3deg; }
.mem-b { top: 34%; right: -9%; rotate: 2.2deg; }
.mem-c { bottom: 12%; left: -2%; rotate: 1.6deg; }
.mem-chip {
  position: absolute; z-index: 3; top: -2%; right: 6%;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-md); font-size: 11px; font-weight: 600; color: var(--chip-text);
  font-variant-numeric: tabular-nums; will-change: transform; backface-visibility: hidden;
}
.mem-card { backface-visibility: hidden; }

/* Slow bobbing — each float class on its own period so the stage never syncs.
   Uses the independent `translate` property (GPU-composited, no layout reflow),
   stacking with the card's `rotate` tilt and the JS scroll `transform`. */
.float-a { animation: floatBob 7s ease-in-out infinite alternate; }
.float-b { animation: floatBob 9s ease-in-out infinite alternate-reverse; }
.float-c { animation: floatBob 11s ease-in-out infinite alternate; }
@keyframes floatBob {
  from { translate: 0 0; }
  to   { translate: 0 -10px; }
}

/* Scroll cue */
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cue-line { position: relative; width: 1.5px; height: 42px; background: var(--border); border-radius: 2px; overflow: hidden; }
.cue-dot { position: absolute; left: 0; top: 0; width: 100%; height: 12px; background: var(--primary); border-radius: 2px; will-change: transform; animation: cueFall 1.8s ease-in-out infinite; }
@keyframes cueFall { from { transform: translateY(-12px); } to { transform: translateY(42px); } }
.cue-label { font-size: 9px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }

/* Masked word reveals (spans injected by landing.js) */
.wmask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word { display: inline-block; will-change: transform; }

/* Stats band — a year, kept */
.mk-stats { padding: 26px 0 10px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 34px 0; }
.stat { text-align: center; }
.stat-n { display: block; font-family: var(--serif); font-weight: 600; font-size: 54px; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat-l { display: block; margin-top: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* Feature media get room to drift without clipping */
.feature-media { will-change: transform; backface-visibility: hidden; }

/* Rescue band ambient drift */
.mk-rescue { position: relative; overflow: hidden; }
.mk-rescue > .feature-eyebrow, .mk-rescue > h2, .mk-rescue > p { position: relative; z-index: 1; }
.rescue-drift { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.rd { position: absolute; fill: var(--primary); opacity: 0.1; will-change: transform; backface-visibility: hidden; animation: rescueDrift 14s ease-in-out infinite alternate; }
.rd1 { width: 34px; top: 14%; left: 7%; transform: rotate(-14deg); }
.rd2 { width: 22px; top: 62%; left: 14%; animation-duration: 18s; animation-direction: alternate-reverse; }
.rd3 { width: 26px; top: 20%; right: 9%; transform: rotate(12deg); animation-duration: 16s; }
.rd4 { width: 18px; top: 66%; right: 15%; animation-duration: 12s; animation-direction: alternate-reverse; }
@keyframes rescueDrift {
  from { translate: 0 0; }
  to   { translate: 14px -18px; }
}

/* CTA paw trail walking toward the buttons */
.mk-cta { position: relative; overflow: hidden; }
.mk-cta .mk-wrap { position: relative; z-index: 1; }
.cta-paws { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.cpaw { position: absolute; width: 26px; fill: var(--primary); opacity: 0; }
.cp1 { left: 16%; bottom: 18%; transform: rotate(-16deg); }
.cp2 { left: 21%; bottom: 38%; transform: rotate(10deg); }
.cp3 { left: 17%; bottom: 58%; transform: rotate(-9deg); }
@media (max-width: 900px) { .cta-paws { display: none; } }

/* Hero responsive */
@media (max-width: 860px) {
  .hero-v2 { padding: 48px 0 168px; }
  .hero-stage { min-height: 480px; margin-top: 30px; }
  .mem-a { left: 0; }
  .mem-b { right: 0; }
  .mem-c { display: none; }
  .mem-chip { right: 2%; }
  .bloom-a { width: 380px; height: 380px; right: -160px; }
  .bloom-b { display: none; }
  .stats-row { grid-template-columns: 1fr; gap: 0; }
  .stat { padding: 18px 0; }
  .stat + .stat { border-top: 1px solid var(--hairline); }
  .stat-n { font-size: 44px; }
}

/* Reduced motion: every ambient loop stands still; landing.js has already
   bailed, so nothing is hidden and nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .hero-bloom, .float-a, .float-b, .float-c, .cue-dot, .rd { animation: none !important; }
  .hpaw { animation: none !important; opacity: 0.28; }
  .cpaw { opacity: 0.35; }
  .scroll-cue { display: none; }
}

/* ── Pages — the 3D mascot (poster first, canvas fades in over it) ── */
/* Fixed to the viewport so Pages travels down the whole page as a companion,
   not just in the hero. He rises in on load and tucks back down over the
   footer (.pages-tuck) so the closing section stays clean. */
.pages-wrap {
  position: fixed; bottom: 0; left: 24px; width: 158px; z-index: 6;
  pointer-events: none; transform: translateY(112%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}
.pages-wrap.pages-in { transform: translateY(0); }
.pages-wrap.pages-in.pages-tuck { transform: translateY(112%); }
.pages-wrap img, .pages-wrap canvas { display: block; width: 100%; height: auto; }
.pages-poster { transition: opacity 0.5s ease; }
.pages-wrap canvas { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; }
.pages-wrap.pages-live canvas { opacity: 1; }
.pages-wrap.pages-live .pages-poster { opacity: 0; }

@media (max-width: 1100px) { .pages-wrap { width: 132px; left: 14px; } }
@media (max-width: 860px) { .pages-wrap { width: 104px; left: auto; right: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .pages-wrap { transform: none; transition: none; }
  .pages-wrap.pages-tuck { transform: translateY(112%); }
}

/* ── Legal pages (privacy.html / terms.html) ─────────────────────────────── */
.legal { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }
.legal-draft { display: block; margin-bottom: 28px; padding: 12px 16px; border-radius: 12px; background: var(--error-bg-alt); color: var(--error-text); font-family: var(--sans); font-size: 12px; letter-spacing: 0.4px; line-height: 1.5; }
.legal h1 { font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.1; color: var(--text); margin: 0 0 6px; }
.legal .legal-updated { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-bottom: 36px; }
.legal h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--text); margin: 40px 0 10px; }
.legal h3 { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--chip-text); margin: 26px 0 8px; }
.legal p, .legal li { font-family: var(--sans); font-size: 14.5px; line-height: 1.75; color: var(--text-body); }
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--primary); }
.legal .legal-note { font-size: 12.5px; color: var(--muted); background: var(--surface); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.legal .placeholder { background: var(--surface-muted); border-radius: 4px; padding: 0 5px; color: var(--chip-text); font-weight: 600; }
