/* Kleio marketing site — brand tokens adapted from designs/DESIGN.md "Twilight Tale" palette,
   with elevation/gradient treatment suited to a web landing page rather than the flat mobile UI. */

:root {
  --primary: #1F2B4D;
  --on-primary: #FFFFFF;
  --secondary: #2E3B63;
  --on-secondary: #FFFFFF;
  --accent: #F0B429;
  --accent-soft: #FBE4A8;
  --on-accent: #1F2B4D;
  --background: #FBF8F2;
  --on-background: #1B2036;
  --surface: #FFFFFF;
  --on-surface: #1B2036;
  --surface-variant: #F1EBDD;
  --text-primary: #1B2036;
  --text-secondary: #565F7A;
  --text-tertiary: #8890A3;
  --border: #E7E1D3;
  --divider: #EEE9DC;
  --success: #3F8F5F;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --max-width: 1160px;

  --shadow-sm: 0 1px 2px rgba(31, 43, 77, 0.05), 0 1px 1px rgba(31, 43, 77, 0.04);
  --shadow-md: 0 12px 28px -12px rgba(31, 43, 77, 0.16);
  --shadow-lg: 0 30px 70px -24px rgba(31, 43, 77, 0.30);
  --ring: 0 0 0 1px rgba(31, 43, 77, 0.06);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #3A4A80;
    --on-primary: #F5F3EC;
    --secondary: #232B52;
    --on-secondary: #E7E4DA;
    --accent: #F5C451;
    --accent-soft: #6B5726;
    --on-accent: #1B2036;
    --background: #10142A;
    --on-background: #F2EFE6;
    --surface: #181D3C;
    --on-surface: #F2EFE6;
    --surface-variant: #212852;
    --text-primary: #F2EFE6;
    --text-secondary: #B9BBC9;
    --text-tertiary: #868EA3;
    --border: #2C3462;
    --divider: #232A54;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 14px 32px -12px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 34px 80px -20px rgba(0, 0, 0, 0.65);
    --ring: 0 0 0 1px rgba(255, 255, 255, 0.04);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --primary: #3A4A80;
  --on-primary: #F5F3EC;
  --secondary: #232B52;
  --on-secondary: #E7E4DA;
  --accent: #F5C451;
  --accent-soft: #6B5726;
  --on-accent: #1B2036;
  --background: #10142A;
  --on-background: #F2EFE6;
  --surface: #181D3C;
  --on-surface: #F2EFE6;
  --surface-variant: #212852;
  --text-primary: #F2EFE6;
  --text-secondary: #B9BBC9;
  --text-tertiary: #868EA3;
  --border: #2C3462;
  --divider: #232A54;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 32px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 34px 80px -20px rgba(0, 0, 0, 0.65);
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-word {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.5rem, 4.6vw, 3.75rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; color: var(--text-secondary); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.3rem;
  font-family: 'Lora', serif;
  color: var(--text-primary);
}
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; }
.btn[disabled],
.btn.is-soon {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}
.btn-ghost-inverse {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-ghost-inverse:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }

/* Hero */
.hero {
  position: relative;
  padding: 100px 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.hero::before {
  width: 640px;
  height: 640px;
  top: -280px;
  right: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent), transparent 70%);
}
.hero::after {
  width: 480px;
  height: 480px;
  bottom: -260px;
  left: -180px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 7px 16px 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.hero h1 { margin-bottom: 20px; }
.hero .lede {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 46ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-note { font-size: 0.85rem; color: var(--text-tertiary); }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  opacity: 0.75;
}
.store-badge svg { width: 20px; height: 20px; flex-shrink: 0; }
.store-badge .lines { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.store-badge .lines small { font-weight: 500; color: var(--text-tertiary); font-size: 0.7rem; }

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
}
.hero-mockup {
  position: relative;
  width: 250px;
  padding: 8px;
  background: linear-gradient(165deg, var(--surface), var(--surface-variant));
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
.hero-mockup img { border-radius: 22px; width: 100%; }
.hero-mockup.secondary {
  position: absolute;
  width: 190px;
  top: 8%;
  right: 2%;
  z-index: 1;
  opacity: 0.9;
  transform: rotate(6deg);
  box-shadow: var(--shadow-md);
}
.hero-mockup.secondary img { border-radius: 18px; }
.hero-badge {
  position: absolute;
  left: -6%;
  bottom: 10%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px 8px 8px;
  box-shadow: var(--shadow-md);
}
.hero-badge img { width: 34px; height: 34px; }
.hero-badge span { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

/* Trust strip */
.trust-strip { padding: 12px 0 8px; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.trust-item {
  background: var(--surface);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.trust-item svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.trust-item span { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

/* Sections */
section { padding: 100px 0; }
.section-head { max-width: 620px; margin: 0 auto 52px; text-align: center; }
.section-head .eyebrow { display: inline-flex; }
.section-head p { font-size: 1.08rem; }
.alt-bg { background: var(--surface); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-card .shot-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.step-card img { display: block; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent));
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p { margin: 0; font-size: 0.95rem; }

/* Features grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface-variant));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border);
}
.feature-icon svg { width: 23px; height: 23px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.08rem; }
.feature-card p { margin: 0; font-size: 0.93rem; }

/* Genre chips */
.genre-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 44px; }
.genre-chips li {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* Showcase strip */
.showcase-strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 10px 4px 24px;
  scroll-snap-type: x mandatory;
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
}
.showcase-item { scroll-snap-align: start; flex-shrink: 0; width: 210px; }
.showcase-item img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}
.showcase-item p { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin: 0; }

/* FAQ */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 12px;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text-primary);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { transition: transform 0.2s ease; color: var(--text-tertiary); flex-shrink: 0; }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item p { padding: 0 12px 20px; margin: 0; }

/* CTA band */
.cta-band {
  position: relative;
  background: linear-gradient(160deg, var(--primary), color-mix(in srgb, var(--primary) 70%, black));
  color: var(--on-primary);
  border-radius: var(--radius-xl);
  padding: 64px 40px;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-lg);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%);
}
.cta-band h2, .cta-band p { color: var(--on-primary); }
.cta-band p { color: rgba(255, 255, 255, 0.78); max-width: 46ch; margin-left: auto; margin-right: auto; }
.cta-band .hero-actions { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--divider); padding: 64px 0 32px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 44px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; font-size: 1.15rem; font-family: 'Lora', serif; }
.footer-brand img { width: 28px; height: 28px; border-radius: 8px; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-family: 'Inter', sans-serif; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { text-decoration: none; color: var(--text-secondary); font-size: 0.92rem; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 26px;
  border-top: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* Legal pages */
.legal-page { padding: 64px 0 100px; }
.legal-header { max-width: 780px; margin: 0 auto 40px; }
.legal-header .updated { color: var(--text-tertiary); font-size: 0.9rem; }
.legal-body { max-width: 780px; margin: 0 auto; }
.legal-body h2 { margin-top: 2.2em; font-size: 1.32rem; }
.legal-body h3 { margin-top: 1.6em; font-size: 1.06rem; }
.legal-body ul { padding-left: 1.2em; color: var(--text-secondary); }
.legal-body li { margin-bottom: 0.5em; }
.legal-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.92rem; }
.legal-body th, .legal-body td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.legal-body th { background: var(--surface-variant); }
.legal-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}
.legal-toc ol { margin: 8px 0 0; padding-left: 1.2em; }
.legal-toc a { color: var(--text-secondary); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.notice-box {
  background: var(--surface-variant);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 24px 0;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: 8px; min-height: 380px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 76px 0; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav-links {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--divider);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 16px;
  }
  .steps { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { padding: 44px 24px; }
  section { padding: 60px 0; }
  .hero { padding: 76px 0 40px; }
}
