/* ═══════════════════════════════════════════════════════════════════════════
   carpe-app.com — theme layer ("warm editorial × slot machine")
   Loaded AFTER css/site.css. Pure presentation: no heading, link, or schema changes.
   Brand stays: cream #FBF7F4 ground, terracotta accent, teal + gold as sharp secondaries,
   DM Serif Display / DM Sans. What's new: atmosphere (grain + warm mesh), a real
   typographic scale, staggered load reveal, ticket-stub stats, a city ticker, and
   micro-interactions that all respect prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --ink: #2D2A26;
  --ink-2: #6B6560;
  --cream: #FBF7F4;
  --cream-2: #F5EDE6;
  --terra: #C4593B;
  --terra-2: #A84832;
  --terra-soft: rgba(196, 89, 59, 0.10);
  --teal: #2D6A6A;
  --teal-soft: rgba(45, 106, 106, 0.10);
  --gold: #D4A84B;
  --gold-soft: rgba(212, 168, 75, 0.16);
  --line: rgba(45, 42, 38, 0.10);
  --shadow-1: 0 1px 2px rgba(45,42,38,.05), 0 8px 24px -12px rgba(45,42,38,.18);
  --shadow-2: 0 2px 4px rgba(45,42,38,.06), 0 24px 48px -20px rgba(45,42,38,.28);
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur: .55s;
}

/* ── Atmosphere: grain + warm mesh (fixed, cheap, behind everything) ─────── */
body { position: relative; background: var(--cream); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% -10%, rgba(212,168,75,.22), transparent 60%),
    radial-gradient(45% 40% at -10% 30%, rgba(196,89,59,.12), transparent 60%),
    radial-gradient(40% 40% at 90% 80%, rgba(45,106,106,.10), transparent 60%),
    var(--cream);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.portal-body::before, .portal-body::after { display: none; }

/* ── Type scale ──────────────────────────────────────────────────────────── */
h1, h2, h3, .brand-h1, .mood-title { letter-spacing: -0.015em; }
.hero h1 { font-size: clamp(46px, 7.2vw, 96px); line-height: .98; letter-spacing: -0.03em; }
.hero-sub { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; max-width: 34ch; }
section h2 { text-wrap: balance; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--terra);
}
.section-label::before { content: ""; width: 22px; height: 1px; background: var(--terra); opacity: .7; }

/* ── Nav: glass, underline slide, sticky shadow ──────────────────────────── */
nav#main-nav { padding: 0 24px; background: rgba(251,247,244,.72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.nav-links a:not(.btn):not(.nav-cta) { position: relative; padding: 6px 0; color: var(--ink); }
.nav-cta { color: #fff !important; padding: 10px 20px; }
.nav-links a:not(.btn):not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--terra); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.nav-links a:not(.btn):not(.nav-cta):hover { text-decoration: none; }
.nav-links a:not(.btn):not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-logo .star { display: inline-block; transition: transform .6s var(--ease-spring); }
.nav-logo:hover .star { transform: rotate(180deg) scale(1.15); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn, .store-btn { border-radius: 999px; transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-out), background .2s; }
.btn-primary, .nav-cta {
  background: linear-gradient(180deg, #D1633F 0%, var(--terra) 60%, var(--terra-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 18px -8px rgba(196,89,59,.7);
}
.btn-primary:hover, .nav-cta:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 24px -10px rgba(196,89,59,.8); }
.btn:active, .store-btn:active { transform: translateY(0) scale(.98); }
.store-btn { box-shadow: var(--shadow-1); }
.store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.store-btn.terracotta { background: linear-gradient(180deg, #D1633F, var(--terra-2)); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero:has(.hero-visual)::before { /* big soft terracotta ring behind the phone (home only) */
  content: ""; position: absolute; z-index: -1; right: -6vw; top: 8%; width: 46vw; height: 46vw; max-width: 640px; max-height: 640px;
  border-radius: 50%; border: 1.5px dashed rgba(196,89,59,.28);
  animation: spin-slow 80s linear infinite;
}
.hero:has(.hero-visual)::after { /* gold glow (home only) */
  content: ""; position: absolute; z-index: -1; right: 6vw; top: 18%; width: 30vw; height: 30vw; max-width: 460px; max-height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,75,.35), rgba(212,168,75,0) 65%); filter: blur(10px);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 14px 8px 10px;
  background: var(--cream-2); border: 1px dashed rgba(196,89,59,.45); color: var(--terra); font-weight: 600; letter-spacing: .02em;
  box-shadow: var(--shadow-1);
}
.hero-eyebrow > span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--terra); color: #fff; font-size: 11px; }
.hero-headline { color: var(--ink); }
.hero-headline .tagline-wrap { display: inline-block; position: relative; vertical-align: baseline; white-space: nowrap; }
.hero-headline .tagline { display: inline-block; font-style: italic; background: linear-gradient(90deg, var(--terra) 0%, #D47A5E 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
.hero-headline .tagline.exit { position: absolute; left: 0; top: 0; }
.hero-actions { gap: 14px; }
.city-chip { border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--ease-spring), border-color .2s; }
.city-chip:hover { transform: translateY(-2px) rotate(-1deg); border-color: rgba(196,89,59,.5); }

/* phone: float + tilt */
.hero-iphone { animation: float 7s ease-in-out infinite; transform-origin: 50% 60%; }
.phone-float-card { border-radius: 14px; box-shadow: var(--shadow-2); backdrop-filter: blur(8px); background: rgba(255,255,255,.86); animation: float 9s ease-in-out infinite reverse; }
.phone-float-card.card-1 { animation-delay: -3s; }
.float-dot { box-shadow: 0 0 0 4px rgba(196,89,59,.15); animation: pulse 2.4s ease-out infinite; }

/* staggered load reveal (hero only — one orchestrated moment) */
.hero-content > * { opacity: 0; transform: translateY(18px); animation: rise var(--dur) var(--ease-out) forwards; }
.hero-content > :nth-child(1) { animation-delay: .05s }
.hero-content > :nth-child(2) { animation-delay: .15s }
.hero-content > :nth-child(3) { animation-delay: .28s }
.hero-content > :nth-child(4) { animation-delay: .40s }
.hero-content > :nth-child(5) { animation-delay: .52s }
.hero-visual { opacity: 0; animation: rise .9s var(--ease-out) .35s forwards; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section-warm { background: linear-gradient(180deg, var(--cream-2), #F8F1EB); position: relative; }
.section-warm::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(196,89,59,.35), transparent); }

/* How it works: numbered, lift on hover */
.hiw-grid { counter-reset: step; }
.hiw-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px 28px;
  box-shadow: var(--shadow-1); overflow: hidden; transition: transform .35s var(--ease-spring), box-shadow .35s var(--ease-out), border-color .3s;
}
.hiw-card::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; right: 18px; top: 8px; font-family: 'DM Serif Display', serif; font-size: 84px; line-height: 1;
  color: var(--terra); opacity: .08; letter-spacing: -.04em; transition: opacity .3s, transform .35s var(--ease-spring);
}
.hiw-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-2); border-color: rgba(196,89,59,.3); }
.hiw-card:hover::before { opacity: .16; transform: translateY(-4px) scale(1.06); }
.hiw-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--terra-soft); font-size: 24px; margin-bottom: 18px; }
.hiw-card:nth-child(2) .hiw-icon { background: var(--teal-soft); }
.hiw-card:nth-child(3) .hiw-icon { background: var(--gold-soft); }

/* Feature rows: tag as ticket, list markers as reel dots */
.feature-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.feature-list li { position: relative; }
.feature-list li::marker { color: var(--terra); }
.feature-phone { transition: transform .6s var(--ease-out); }
.feature-row:hover .feature-phone { transform: translateY(-6px) rotate(-1deg); }
.feature-row.reverse:hover .feature-phone { transform: translateY(-6px) rotate(1deg); }

/* Cities: ticker (JS duplicates the row once; CSS scrolls it) */
.cities-section .container { max-width: none; padding: 0; }
.cities-section h2, .cities-section .section-label, .cities-section .sub { padding-left: 24px; padding-right: 24px; }
.city-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 24px; }
.city-ticker { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.city-ticker .city-dots { flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding: 6px 0; animation: ticker 60s linear infinite; }
.city-ticker:hover .city-dots { animation-play-state: paused; }
.city-pill { border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); white-space: nowrap; transition: transform .25s var(--ease-spring), background .2s, color .2s; }
.city-pill:hover { transform: translateY(-3px) rotate(-2deg); background: var(--terra); color: #fff; border-color: var(--terra); }

/* Stats: ticket stubs */
.stats-grid { gap: 18px; }
.stat-block {
  position: relative; background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-1);
  padding: 34px 20px; overflow: hidden;
}
.stat-block::before, .stat-block::after { /* punched notches */
  content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); border: 1px solid var(--line); transform: translateY(-50%);
}
.stat-block::before { left: -12px; } .stat-block::after { right: -12px; }
.stat-num { font-family: 'DM Serif Display', serif; font-size: clamp(44px, 5vw, 64px); letter-spacing: -.03em; background: linear-gradient(180deg, var(--terra), var(--terra-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { letter-spacing: .12em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* Final CTA: inverse block */
.cta-section { background: linear-gradient(135deg, #B94F33 0%, var(--terra) 45%, #D47A5E 100%); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.cta-section::before { content: "✦"; position: absolute; z-index: -1; right: -2vw; top: -14vw; font-size: 34vw; line-height: 1; color: rgba(255,255,255,.07); animation: spin-slow 120s linear infinite; }
.cta-section::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 20% 100%, rgba(212,168,75,.35), transparent 60%); }
.cta-section h2, .cta-section p, .cta-section .section-label { color: #fff; }
.cta-section .section-label::before { background: #fff; }
.cta-section .store-btn { background: #fff; color: var(--ink); }
.cta-section .store-btn.terracotta { background: var(--ink); color: #fff; }

/* Footer: watermark + hover */
footer { position: relative; overflow: hidden; }
footer::before { content: "Carpe"; position: absolute; right: -1vw; bottom: -6vw; font-family: 'DM Serif Display', serif; font-size: 22vw; line-height: 1; color: rgba(255,255,255,.035); pointer-events: none; letter-spacing: -.04em; }
footer a { transition: color .2s, transform .2s; display: inline-block; }
footer a:hover { color: var(--gold); transform: translateX(2px); text-decoration: none; }

/* Legal pages: reading measure + sticky feel */
.legal-layout { max-width: 72ch; }
.legal-layout h2 { padding-top: 8px; border-top: 1px solid var(--line); }
.legal-date { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--cream-2); border: 1px solid var(--line); font-size: 13px; }

/* Portal: small polish only */
.portal-card { border-radius: 22px; box-shadow: var(--shadow-2); }
.portal-input:focus { outline: 2px solid rgba(196,89,59,.35); outline-offset: 1px; border-color: var(--terra); }

/* Focus rings everywhere (keyboard users) */
a:focus-visible, button:focus-visible { outline: 3px solid rgba(45,106,106,.55); outline-offset: 3px; border-radius: 6px; }

/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(-.6deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(196,89,59,.35); } 100% { box-shadow: 0 0 0 12px rgba(196,89,59,0); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ── Reduced motion: everything settles instantly ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .hero-content > *, .hero-visual { opacity: 1; transform: none; }
  .city-ticker .city-dots { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .city-ticker { mask-image: none; -webkit-mask-image: none; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero::before, .hero::after { display: none; }
  .hero h1 { font-size: clamp(40px, 12vw, 54px); }
  .stat-block::before, .stat-block::after { display: none; }
  .cta-section::before { font-size: 60vw; top: -20vw; }
}
