/* ------------------------------------------------------------------
   SwapiClub web — shared styles
   Colours mirror src/context/ThemeContext.tsx exactly.
   Light + dark themes; theme follows the visitor's OS.
   ------------------------------------------------------------------ */

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #1A202C;
  --text-2: #334155;
  --text-mute: #64748B;
  --text-placeholder: #94A3B8;
  --accent: #8B5CF6;
  --accent-soft: rgba(139, 92, 246, 0.10);
  --accent-ring: rgba(139, 92, 246, 0.18);
  --success: #10B981;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 40px 80px -30px rgba(15, 23, 42, 0.25);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;

  --max: 1080px;
  --rad-lg: 24px;
  --rad-md: 16px;
  --rad-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-2: #0F172A;
    --border: #334155;
    --border-light: #1E293B;
    --text: #F8FAFC;
    --text-2: #CBD5E0;
    --text-mute: #94A3B8;
    --text-placeholder: #64748B;
    --accent: #8B5CF6;
    --accent-soft: rgba(139, 92, 246, 0.16);
    --accent-ring: rgba(139, 92, 246, 0.28);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ----------------------------------------------------------------
   NAV
   ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s, border-color 0.3s;
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #000;
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  color: var(--text-2);
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); transition: color 0.2s; }
@media (max-width: 720px) {
  .nav-links { display: none; }
}
.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-ring);
  color: #fff !important;
}

/* ----------------------------------------------------------------
   OPENER — the hook
   ---------------------------------------------------------------- */
.opener {
  padding: 100px 24px 60px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .opener { padding: 64px 22px 44px; }
}
.opener h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}
.opener p {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 36px;
}
@media (max-width: 720px) {
  .opener p { font-size: 17px; }
}
.opener-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 10px 30px var(--accent-ring);
}
.opener-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px var(--accent-ring);
}
.opener-cta svg { width: 16px; height: 16px; }

/* ----------------------------------------------------------------
   HERO IMAGE — the home screenshot
   ---------------------------------------------------------------- */
.hero-image {
  max-width: 320px;
  margin: 0 auto;
  padding: 0 24px;
}
.hero-image .device {
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
}
.hero-image .device img {
  width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------------
   STORY SECTIONS — text + screenshot pairs
   ---------------------------------------------------------------- */
.story {
  padding: 120px 24px;
  max-width: var(--max);
  margin: 0 auto;
}
@media (max-width: 720px) {
  .story { padding: 80px 22px; }
}

.chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-bottom: 140px;
}
.chapter:last-child { margin-bottom: 0; }
.chapter.reverse { direction: rtl; }
.chapter.reverse > * { direction: ltr; }

@media (max-width: 860px) {
  .chapter, .chapter.reverse {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 90px;
    direction: ltr;
  }
}

.chapter-step {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.chapter h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 18px;
}
.chapter p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-2);
}
.chapter p + p { margin-top: 14px; }

/* Phone-shaped frame for screenshots — no fake notch, just a clean rounded device */
.device-frame {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.device-frame:hover {
  transform: translateY(-4px);
}
.device-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------------
   PILLARS — the three promises, woven into the flow
   ---------------------------------------------------------------- */
.pillars-intro {
  padding: 80px 24px 40px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.pillars-intro h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.pillars-intro p {
  font-size: 17.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.pillars {
  padding: 30px 24px 100px;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; }
}

.pillar {
  padding: 36px 28px;
  border-radius: var(--rad-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.pillar:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -20px var(--accent-ring);
}
.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.pillar-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.pillar h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.pillar p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ----------------------------------------------------------------
   SAFETY — a calmer block
   ---------------------------------------------------------------- */
.safety {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 100px 24px;
}
.safety-inner {
  max-width: 720px;
  margin: 0 auto;
}
.safety h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}
.safety p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 16px;
}
.safety-note {
  margin-top: 28px;
  padding: 22px 26px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.safety-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 600;
}
.safety-note span {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ----------------------------------------------------------------
   CTA — final invitation
   ---------------------------------------------------------------- */
.cta-final {
  padding: 130px 24px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.cta-final h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}
.cta-final p {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 36px;
  line-height: 1.55;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform 0.15s, box-shadow 0.2s;
  background: var(--text);
  color: var(--bg);
}
.store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}
.store-btn.outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
}
.store-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.store-btn .small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
  line-height: 1;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.store-btn .label {
  line-height: 1.15;
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 50px 24px 30px;
}
.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) {
  .foot-inner { grid-template-columns: 1fr; gap: 28px; }
}
.foot-brand-text {
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 300px;
}
.foot-col h4 {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 14px;
}
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: 9px; }
.foot-col a {
  color: var(--text-2);
  font-size: 14.5px;
  transition: color 0.2s;
}
.foot-col a:hover { color: var(--accent); }
.foot-bottom {
  max-width: var(--max);
  margin: 40px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-mute);
  font-size: 13px;
}

/* ----------------------------------------------------------------
   POLICY PAGES
   ---------------------------------------------------------------- */
.policy-hero {
  padding: 80px 24px 40px;
  border-bottom: 1px solid var(--border);
}
.policy-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.policy-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.policy-meta {
  color: var(--text-mute);
  font-size: 13.5px;
  letter-spacing: 0.04em;
}
.policy-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  font-size: 14px;
  margin-bottom: 28px;
  transition: color 0.2s;
}
.policy-back:hover { color: var(--accent); }
.policy-back svg { width: 14px; height: 14px; }

.policy {
  padding: 50px 24px 100px;
}
.policy-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 16.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.policy-body > p { margin-bottom: 18px; }
.policy-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 44px;
  margin-bottom: 14px;
  line-height: 1.2;
}
.policy-body h2:first-child { margin-top: 0; }
.policy-body ul { list-style: none; margin: 18px 0; padding: 0; }
.policy-body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}
.policy-body ul li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.policy-body a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.policy-body a:hover { border-bottom-color: var(--accent); }

.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 18px 22px;
  margin: 24px 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.callout strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 15.5px;
}
.callout span {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ----------------------------------------------------------------
   ENTRY ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.opener h1, .opener p, .opener-cta, .hero-image {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.opener p { animation-delay: 0.1s; }
.opener-cta { animation-delay: 0.18s; }
.hero-image { animation-delay: 0.28s; }