@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500&family=Fraunces:ital,opsz,wght@0,9..144,600;0,9..144,700;1,9..144,400&family=Geist:wght@300;400;500;600&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --cream: #faf8f3;
  --cream-dark: #f0ede4;
  --accent: #D97757;
  --accent-dark: #b85f3f;
  --accent-bg: rgba(217,119,87,0.10);
  --dark: #1a1714;
  --text-1: #1a1714;
  --text-2: rgba(26,23,20,0.62);
  --text-3: rgba(26,23,20,0.38);
  --border: rgba(26,23,20,0.10);
  --white: #ffffff;
  --bg: #ffffff;
  --surface: #faf8f3;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 100px;
  --max-w: 1140px;
  --section-v: 96px;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --cream: #1a1815;
  --cream-dark: #221f1b;
  --border: rgba(255, 255, 255, 0.08);
  --text-1: #f5f2ea;
  --text-2: #999590;
  --text-3: #6b6760;
  --accent: #d97757;
  --accent-dark: #e8896b;
  --bg: #0f0f0f;
  --surface: #1a1815;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #1a1815;
    --cream-dark: #221f1b;
    --border: rgba(255, 255, 255, 0.08);
    --text-1: #f5f2ea;
    --text-2: #999590;
    --text-3: #6b6760;
    --accent: #d97757;
    --accent-dark: #e8896b;
    --bg: #0f0f0f;
    --surface: #1a1815;
  }
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--accent);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* ── Nav Inner ── */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
}

/* ── Nav Links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Nav Link ── */
.nav-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
  color: var(--text-1);
  background: var(--accent-bg);
}
.nav-link[aria-current="page"] {
  color: var(--accent);
}

/* ── Nav CTA ── */
.nav-link.nav-cta {
  background: var(--dark);
  color: var(--white);
  padding: 6px 16px;
}
.nav-link.nav-cta:hover {
  background: var(--accent);
  color: var(--white);
}
.nav-link.nav-cta[aria-current="page"] {
  background: var(--accent);
  color: var(--white);
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-1);
  border-radius: var(--radius-sm);
}
.hamburger:hover {
  background: var(--accent-bg);
}

/* ── Language Switcher ── */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lang-btn:hover {
  color: var(--text-1);
  border-color: var(--text-2);
}
.lang-btn[aria-expanded="true"] {
  color: var(--text-1);
}

.lang-chevron {
  transition: transform 0.2s;
}
.lang-btn[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 164px;
  padding: 4px;
  z-index: 200;
}
.lang-dropdown[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.lang-option:hover {
  background: var(--cream);
  color: var(--text-1);
}
.lang-option.active {
  color: var(--accent);
  font-weight: 500;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: var(--white);
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-1);
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover {
  border-color: var(--text-1);
}

.btn-accept {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-accept:hover {
  opacity: 0.9;
}

.btn-reject {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-reject:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Tag ── */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ── Section typography ── */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.15;
}

.section-sub {
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Feature List ── */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}
.feature-list li::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Visual Placeholder ── */
.visual-placeholder {
  background: var(--cream-dark);
  border-radius: var(--radius-lg);
  aspect-ratio: 9 / 16;
  max-width: 260px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 16px;
}

/* ── Page Hero ── */
.page-hero {
  background: var(--dark);
  padding: 80px 0 72px;
  text-align: center;
}
.page-hero .container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.page-hero .tag {
  background: rgba(217,119,87,0.20);
  color: var(--accent);
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  color: var(--white);
  margin-top: 16px;
  line-height: 1.1;
}
.page-hero .hero-sub {
  font-family: var(--font-sans);
  font-size: 17px;
  color: rgba(255,255,255,0.55);
  max-width: 560px;
  margin: 16px auto 0;
  line-height: 1.65;
}

/* ── Site Footer ── */
.site-footer {
  background: var(--dark);
  padding: 56px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-desc {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-sans);
  font-size: 12px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  padding: 20px 24px;
}

/* ── Cookie Banner ── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 640px;
  background: var(--dark);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  z-index: 200;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner-inner p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}

.cookie-banner-inner p a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
}

/* ── Container utility ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section padding utility ── */
.section-pad {
  padding: var(--section-v) 0;
}

/* ── Mobile Theme Selector ── */
.nav-mobile-theme {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nav-mobile-theme-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
}

.nav-mobile-theme-options {
  display: flex;
  gap: 4px;
}

.theme-opt {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.theme-opt:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.theme-opt.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ── Responsive: ≤768px ── */
@media (max-width: 768px) {
  :root {
    --section-v: 64px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 16px;
    gap: 4px;
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
  }

  .nav-link.nav-cta {
    text-align: center;
    justify-content: center;
  }

  .lang-switcher {
    width: 100%;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
  }

  .lang-btn {
    display: none;
  }

  .lang-dropdown {
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-width: unset;
    padding: 0;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }

  .lang-dropdown[hidden] {
    display: grid !important;
  }

  .lang-option {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-btns {
    width: 100%;
    justify-content: flex-end;
  }

  .theme-switcher {
    display: none;
  }

  .nav-mobile-theme {
    display: flex;
  }
}

/* ── Responsive: ≤480px ── */
@media (max-width: 480px) {
  .page-hero {
    padding: 56px 0 48px;
  }
}

/* ── Theme Toggle ── */
.theme-switcher {
  position: relative;
  flex-shrink: 0;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 120px;
  padding: 4px;
  z-index: 200;
}
.theme-dropdown[hidden] {
  display: none;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.theme-option:hover {
  background: var(--surface);
  color: var(--text-1);
}
.theme-option.active {
  color: var(--accent);
  font-weight: 500;
}

/* ── Dark Mode Overrides ── */

/* Nav */
[data-theme="dark"] .site-header {
  background: rgba(15, 15, 15, 0.92);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header {
    background: rgba(15, 15, 15, 0.92);
  }
}

/* Mobile nav menu */
[data-theme="dark"] .nav-links {
  background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-links {
    background: var(--surface);
  }
}

/* Lang dropdown */
[data-theme="dark"] .lang-dropdown {
  background: var(--surface);
}
[data-theme="dark"] .lang-option:hover {
  background: var(--cream-dark);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lang-dropdown {
    background: var(--surface);
  }
  :root:not([data-theme="light"]) .lang-option:hover {
    background: var(--cream-dark);
  }
}

/* Btn secondary */
[data-theme="dark"] .btn-secondary {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-secondary {
    background: transparent;
    color: var(--text-1);
    border-color: var(--border);
  }
}

/* Feature visual placeholders */
[data-theme="dark"] .visual-placeholder,
[data-theme="dark"] .feature-visual {
  background: var(--surface);
  border-color: var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .visual-placeholder,
  :root:not([data-theme="light"]) .feature-visual {
    background: var(--surface);
    border-color: var(--border);
  }
}

/* Steps grid */
[data-theme="dark"] .steps {
  background: var(--border);
}
[data-theme="dark"] .step {
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .steps {
    background: var(--border);
  }
  :root:not([data-theme="light"]) .step {
    background: var(--bg);
  }
}

/* Footer */
[data-theme="dark"] .site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
}

/* Lang pills (homepage languages section) */
[data-theme="dark"] .lang-pill {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lang-pill {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-2);
  }
}

/* === DARK MODE BUTTONS === */

/* Nav CTA — terracotta in dark mode */
[data-theme="dark"] .nav-cta {
  background: #d97757 !important;
  color: #ffffff !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-cta {
    background: #d97757 !important;
    color: #ffffff !important;
  }
}

/* Primary buttons — terracotta in dark mode */
[data-theme="dark"] .btn-primary {
  background: #d97757 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .btn-primary:hover {
  background: #b85f3f !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary {
    background: #d97757 !important;
    color: #ffffff !important;
  }
  :root:not([data-theme="light"]) .btn-primary:hover {
    background: #b85f3f !important;
  }
}

/* Section backgrounds — override var(--white) in page <style> blocks */
[data-theme="dark"] .feat-section,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .about-card {
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feat-section,
  :root:not([data-theme="light"]) .settings-section,
  :root:not([data-theme="light"]) .about-card {
    background: var(--bg);
  }
}

/* ── Bridge: legacy css/style.css variable names → new design tokens ── */
/* Used by privacy/terms pages that reference the old variable names      */
:root {
  --text-primary: var(--text-1);
  --text-secondary: var(--text-2);
  --text-tertiary: var(--text-3);
  --primary-600: var(--accent);
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-tertiary: var(--cream-dark);
  --border-color: var(--border);
  --card-bg: var(--bg);
  --nav-bg: rgba(255, 255, 255, 0.88);
}
[data-theme="dark"] {
  --nav-bg: rgba(15, 15, 15, 0.92);
  --card-bg: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nav-bg: rgba(15, 15, 15, 0.92);
    --card-bg: var(--surface);
  }
}

/* === PRIVACY & TERMS PAGE STYLES === */

.legal-content {
  padding: 80px 0;
}

.legal-content .container {
  max-width: 720px;
}

.legal-content .card {
  margin-bottom: 40px;
}

.legal-content h2 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  color: var(--text-1);
}

.legal-content .card:first-child h2,
.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 10px;
}

.legal-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 16px;
}

.legal-content li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.legal-content strong {
  color: var(--text-1);
  font-weight: 500;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-content a:hover {
  color: var(--accent-dark);
}

@media (max-width: 480px) {
  .legal-content {
    padding: 48px 0;
  }
}
