/* Obscura Logic — shared styles. Colours mirror the ShelfRate app (obscura-app/src/theme/palettes.ts, terracotta accent). */

:root {
  --bg: #faf8f4;
  --bg-alt: #f3eee5;
  --surface: #ffffff;
  --border: #e6ded0;
  --border-strong: #d3c7b3;
  --text: #2b2926;
  --text-muted: #6b655c;
  --text-subtle: #948d80;
  --accent: #a5583e;
  --accent-hover: #8f4a33;
  --accent-contrast: #ffffff;
  --accent-subtle: rgba(165, 88, 62, 0.1);
  --accent-border: rgba(165, 88, 62, 0.32);
  --star: #b7893f;
  --glow-1: rgba(205, 125, 95, 0.28);
  --glow-2: rgba(183, 137, 63, 0.22);
  --nav-bg: rgba(250, 248, 244, 0.78);
  --shadow: 0 1px 2px rgba(43, 41, 38, 0.06), 0 8px 24px rgba(43, 41, 38, 0.07);
  --shadow-phone: 0 2px 6px rgba(43, 41, 38, 0.12), 0 30px 60px -12px rgba(60, 40, 25, 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1917;
    --bg-alt: #201f1c;
    --surface: #252321;
    --border: #383530;
    --border-strong: #4c473f;
    --text: #e8e4dd;
    --text-muted: #a8a196;
    --text-subtle: #7c766b;
    --accent: #cd7d5f;
    --accent-hover: #db8f72;
    --accent-contrast: #1a1917;
    --accent-subtle: rgba(205, 125, 95, 0.13);
    --accent-border: rgba(205, 125, 95, 0.38);
    --star: #d3a558;
    --glow-1: rgba(205, 125, 95, 0.2);
    --glow-2: rgba(211, 165, 88, 0.12);
    --nav-bg: rgba(26, 25, 23, 0.75);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-phone: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 60px -12px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1917;
  --bg-alt: #201f1c;
  --surface: #252321;
  --border: #383530;
  --border-strong: #4c473f;
  --text: #e8e4dd;
  --text-muted: #a8a196;
  --text-subtle: #7c766b;
  --accent: #cd7d5f;
  --accent-hover: #db8f72;
  --accent-contrast: #1a1917;
  --accent-subtle: rgba(205, 125, 95, 0.13);
  --accent-border: rgba(205, 125, 95, 0.38);
  --star: #d3a558;
  --glow-1: rgba(205, 125, 95, 0.2);
  --glow-2: rgba(211, 165, 88, 0.12);
  --nav-bg: rgba(26, 25, 23, 0.75);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-phone: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 60px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3 {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1rem; }
img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: 0.01em; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 720px) { .nav-links { display: none; } .theme-toggle { margin-left: auto; } }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun, .theme-toggle .i-moon, .theme-toggle .i-auto { display: none; }
.theme-toggle[data-mode="light"] .i-sun,
.theme-toggle[data-mode="dark"] .i-moon,
.theme-toggle[data-mode="system"] .i-auto { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid var(--border-strong); color: var(--text); background: transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { text-decoration: none; color: var(--text); border-color: var(--text-subtle); transform: translateY(-1px); }
.play-badge { display: inline-block; transition: transform 0.15s, filter 0.15s; }
.play-badge:hover { transform: translateY(-1px); filter: brightness(1.08); }
.play-badge img { height: 56px; width: auto; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 96px; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(80px); pointer-events: none;
}
.hero::before { width: 560px; height: 560px; right: -120px; top: -60px; background: var(--glow-1); }
.hero::after { width: 420px; height: 420px; right: 280px; top: 260px; background: var(--glow-2); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-subtle); border: 1px solid var(--accent-border);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); margin-bottom: 24px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--text-muted); max-width: 34em; margin-bottom: 32px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--text-subtle); }

.hero-phones { position: relative; height: 640px; }
.hero-phones .phone { position: absolute; }
.hero-phones .phone.front { right: 150px; top: 0; z-index: 2; }
.hero-phones .phone.back { right: 0; top: 80px; z-index: 1; transform: rotate(4deg); }

@media (max-width: 960px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-phones { height: 560px; max-width: 480px; margin: 0 auto; width: 100%; }
  .hero-phones .phone.front { left: 0; right: auto; }
  .hero-phones .phone.back { right: 0; }
}
@media (max-width: 520px) {
  .hero-phones { height: 470px; }
  .hero-phones .phone { --phone-w: 210px; }
  .hero-phones .phone.back { top: 60px; }
}

/* ---------- Phone frame ---------- */
.phone {
  --phone-w: 280px;
  width: var(--phone-w);
  aspect-ratio: 1 / 1.975;
  padding: calc(var(--phone-w) * 0.035);
  border-radius: calc(var(--phone-w) * 0.15);
  background: linear-gradient(145deg, #3a3632, #141312 55%, #2a2724);
  box-shadow: var(--shadow-phone), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: calc(var(--phone-w) * 0.12);
  overflow: hidden;
  isolation: isolate;
}
.layer { position: absolute; inset: 0; display: flex; flex-direction: column; }
.layer.light { background: #faf8f4; color: #2b2926; }
.layer.dark { background: #1a1917; color: #e8e4dd; }
.statusbar {
  flex: 0 0 auto;
  height: calc(var(--phone-w) * 0.1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--phone-w) * 0.075);
  font-size: calc(var(--phone-w) * 0.042); font-weight: 600;
  position: relative;
}
.statusbar::after { /* punch-hole camera */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: calc(var(--phone-w) * 0.04); height: calc(var(--phone-w) * 0.04);
  transform: translate(-50%, -50%); border-radius: 50%; background: #0b0b0b;
}
.statusbar .icons { display: flex; gap: calc(var(--phone-w) * 0.015); align-items: center; }
.statusbar .icons svg { width: calc(var(--phone-w) * 0.05); height: calc(var(--phone-w) * 0.05); fill: currentColor; }
.layer img { width: 100%; height: auto; flex: 1 1 auto; object-fit: cover; object-position: top; min-height: 0; }

/* Which layer shows: each phone belongs to a [data-shots] scope set to light|dark. */
[data-shots="light"] .phone:not(.compare) .layer.dark { display: none; }
[data-shots="dark"] .phone:not(.compare) .layer.light { display: none; }

/* Compare phone: light layer on top, clipped from the right by --pos. */
.phone.compare .layer.light { z-index: 2; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare-handle {
  position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none;
}
.compare-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.compare-handle svg { width: 22px; height: 22px; }
.compare-range {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}

/* ---------- Sections ---------- */
section.block { padding: 96px 0; }
section.block.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); margin-bottom: 16px; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; margin: 0; }
@media (max-width: 600px) { section.block { padding: 64px 0; } .section-head { margin-bottom: 36px; } }

/* Categories strip */
.categories { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.chip .dots { display: inline-flex; gap: 3px; }
.chip .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.chip .dots i.on { background: var(--accent); }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--accent-border); }
.feature .icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-border);
}
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 15.5px; margin: 0; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }

/* Spotlight rows (text + phone) */
.spotlight { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.spotlight + .spotlight { margin-top: 112px; }
.spotlight.flip .spot-media { order: -1; }
.spot-media { display: flex; justify-content: center; position: relative; }
.spot-media::before {
  content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--glow-1); filter: blur(70px);
}
.spot-text h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); margin-bottom: 16px; }
.spot-text p { color: var(--text-muted); font-size: 1.08rem; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--accent); margin-top: 3px; }
@media (max-width: 860px) {
  .spotlight { grid-template-columns: 1fr; gap: 40px; }
  .spotlight.flip .spot-media { order: 0; }
  .spotlight + .spotlight { margin-top: 80px; }
}

/* Gallery */
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.gallery-head .section-head { margin-bottom: 0; }
.segmented {
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
}
.segmented button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.segmented button svg { width: 16px; height: 16px; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.gallery {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(50% - 50vw);
  padding: 12px max(24px, calc(50vw - 556px)) 36px;
  scroll-padding: 0 max(24px, calc(50vw - 556px));
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.gallery figure { margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; }
.gallery .phone { --phone-w: 250px; }
.gallery figcaption { margin-top: 20px; text-align: center; max-width: 250px; }
.gallery figcaption strong { display: block; font-family: "Lora", Georgia, serif; font-size: 1.1rem; font-weight: 600; }
.gallery figcaption span { color: var(--text-muted); font-size: 14.5px; }
@media (max-width: 600px) { .gallery { padding: 12px 16px 28px; scroll-padding: 0 16px; gap: 20px; } .gallery .phone { --phone-w: 220px; } }

/* Compare */
.compare-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.compare-wrap .phone { --phone-w: 300px; }
.compare-hint { font-size: 14px; color: var(--text-subtle); display: flex; gap: 18px; }
@media (max-width: 520px) { .compare-wrap .phone { --phone-w: 250px; } }

/* Privacy / studio cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.45rem; margin-bottom: 12px; }
.card p { color: var(--text-muted); }
.card p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { text-align: center; padding: 96px 0; position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; z-index: -1; inset: auto 0 -260px 50%;
  width: 720px; height: 420px; transform: translateX(-50%); border-radius: 50%;
  background: var(--glow-1); filter: blur(90px);
}
.cta-band img.app-icon { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 24px; box-shadow: var(--shadow); }
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 14px; }
.cta-band p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.cta-band .cta-row { justify-content: center; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; color: var(--text-muted); font-size: 15px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--text); }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Legal pages (privacy policy) ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 24px 24px; }
.legal header { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.legal h1 { font-size: clamp(2.2rem, 4.5vw, 3rem); margin-bottom: 12px; }
.legal .tagline { color: var(--text-muted); margin: 0; }
.legal section { margin-bottom: 36px; }
.legal h2 { font-size: 1.45rem; margin: 0 0 12px; }
.legal p, .legal li { color: var(--text-muted); }
.legal strong { color: var(--text); font-weight: 600; }
.legal ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.4rem; }
.legal > footer { display: none; }
@media (max-width: 600px) { .legal { padding: 40px 16px 16px; } }
.trademark { margin-top: 20px; margin-bottom: 0; font-size: 12px; color: var(--text-subtle); }
