/* ==========================================================================
   Kino — Shared Stylesheet
   Design tokens mirror the iOS app's design system exactly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand:           #4A8BB8;
  --brand-dark:      #3A7BA8;
  --brand-light:     #EBF4FB;
  --brand-muted:     #D0E8F5;

  /* Status */
  --green:           #4CAF50;
  --yellow:          #F4B400;
  --red:             #E57373;

  /* Backgrounds */
  --bg:              #FFFFFF;
  --bg-secondary:    #F7F7F7;
  --bg-elevated:     #FFFFFF;

  /* Text */
  --text:            #111111;
  --text-secondary:  #666666;
  --text-tertiary:   #8E8E93;
  --text-on-brand:   #FFFFFF;

  /* Borders */
  --border:          #E6E6E6;
  --border-strong:   #D6D6D6;

  /* Spacing scale (4px base) */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  /* Layout */
  --max-width:  1100px;
  --nav-height:  64px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font: inherit; border: none; background: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 600; color: var(--text); }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY SCALE
   -------------------------------------------------------------------------- */
.display     { font-size: clamp(2.25rem, 5vw, 3.5rem);  font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.heading-1   { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.heading-2   { font-size: clamp(1.375rem, 2.5vw, 1.875rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.heading-3   { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.body-lg     { font-size: 1.125rem; line-height: 1.7; }
.body        { font-size: 1rem;    line-height: 1.65; }
.body-sm     { font-size: 0.9375rem; line-height: 1.6; }
.caption     { font-size: 0.8125rem; line-height: 1.5; }
.overline    { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container   { width: 100%; max-width: var(--max-width); margin-inline: auto; padding-inline: var(--space-5); }
.section     { padding-block: var(--space-9); }
.section-sm  { padding-block: var(--space-7); }
.grid-2      { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px var(--space-6);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand);
  color: var(--text-on-brand);
  box-shadow: 0 2px 8px rgba(74,139,184,.35);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 16px rgba(74,139,184,.45); }

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
  padding-inline: var(--space-3);
}
.btn-ghost:hover { background: var(--brand-light); }

.btn-lg { padding: 17px var(--space-7); font-size: 1.0625rem; }
.btn-sm { padding: 10px var(--space-4); font-size: 0.9375rem; }

/* --------------------------------------------------------------------------
   6. NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; color: var(--brand); }

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); background: var(--bg-secondary); text-decoration: none; }
.nav-links a.active { color: var(--brand); }

.nav-cta { margin-left: var(--space-3); }

/* Mobile nav toggle */
.nav-toggle { display: none; padding: var(--space-2); border-radius: var(--radius-sm); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.nav-toggle span + span { margin-top: 5px; }

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
.hero {
  padding-block: var(--space-10) var(--space-9);
  background: linear-gradient(160deg, var(--bg) 55%, var(--brand-light) 100%);
  overflow: hidden;
  position: relative;
}

.hero-content {
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--brand-light);
  color: var(--brand);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-5);
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero p {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* App Store badge */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
  text-decoration: none;
}
.appstore-badge:hover { background: #333; transform: translateY(-1px); text-decoration: none; color: #fff; }
.appstore-badge svg { flex-shrink: 0; }

/* --------------------------------------------------------------------------
   8. SECTION HEADERS
   -------------------------------------------------------------------------- */
.section-header {
  max-width: 620px;
  margin-bottom: var(--space-7);
}
.section-header.centered { margin-inline: auto; text-align: center; }
.section-header .overline { color: var(--brand); margin-bottom: var(--space-3); }
.section-header h2 { margin-bottom: var(--space-3); }
.section-header p  { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   9. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

.card h3 { margin-bottom: var(--space-2); }
.card p  { color: var(--text-secondary); font-size: 0.9375rem; }

/* Colored icon backgrounds */
.icon-brand  { background: var(--brand-light); color: var(--brand); }
.icon-green  { background: #E8F5E9; color: #388E3C; }
.icon-yellow { background: #FFF8E1; color: #F57F17; }
.icon-purple { background: #F3E5F5; color: #7B1FA2; }
.icon-teal   { background: #E0F2F1; color: #00796B; }

/* --------------------------------------------------------------------------
   10. STEPS (How it works)
   -------------------------------------------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.step:last-child { border-bottom: none; }

.step-number-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.step-line {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: var(--space-2);
}
.step:last-child .step-line { display: none; }

.step-content { padding-top: var(--space-2); }
.step-content h3 { margin-bottom: var(--space-2); }
.step-content p  { color: var(--text-secondary); }

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-3);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   11. FAQ ACCORDION
   -------------------------------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: var(--space-2); }

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--duration) var(--ease);
}
.faq-item[open] { box-shadow: var(--shadow-sm); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--duration) var(--ease);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }

.faq-body {
  padding: 0 var(--space-5) var(--space-4);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.faq-body p + p { margin-top: var(--space-3); }
.faq-body a { color: var(--brand); }

/* --------------------------------------------------------------------------
   12. STAT STRIP
   -------------------------------------------------------------------------- */
.stats {
  background: var(--bg-secondary);
  border-block: 1px solid var(--border);
  padding-block: var(--space-6);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  text-align: center;
}

.stat-value {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   13. FEATURE STRIP (icon + label rows)
   -------------------------------------------------------------------------- */
.features-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.feature-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-row-body h4  { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.feature-row-body p   { font-size: 0.9375rem; color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   14. CTA BANNER
   -------------------------------------------------------------------------- */
.cta-banner {
  background: linear-gradient(135deg, var(--brand) 0%, #3A6E9E 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-7);
  text-align: center;
  color: var(--text-on-brand);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,.08) 0%, transparent 60%);
}

.cta-banner h2 { color: #fff; margin-bottom: var(--space-3); }
.cta-banner p  { color: rgba(255,255,255,.8); margin-bottom: var(--space-5); max-width: 480px; margin-inline: auto; margin-bottom: var(--space-5); }
.cta-banner .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.cta-banner .btn-primary:hover { background: #f0f0f0; }

/* --------------------------------------------------------------------------
   15. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding-block: var(--space-8) var(--space-5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

.footer-brand p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: var(--space-3);
  max-width: 260px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.footer-col ul li + li { margin-top: var(--space-2); }

.footer-col ul li a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color var(--duration) var(--ease);
}
.footer-col ul li a:hover { color: var(--text); text-decoration: none; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   16. LEGAL PAGES
   -------------------------------------------------------------------------- */
.legal-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-7);
}

.legal-hero .overline { color: var(--brand); margin-bottom: var(--space-2); }
.legal-hero h1  { margin-bottom: var(--space-3); }
.legal-hero p   { color: var(--text-secondary); }

.legal-body {
  max-width: 760px;
  padding-block: var(--space-8);
}

.legal-body h2 {
  font-size: 1.375rem;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.legal-body h2:first-of-type { border-top: none; margin-top: 0; }

.legal-body h3 { font-size: 1.0625rem; margin-top: var(--space-5); margin-bottom: var(--space-2); }
.legal-body p  { color: var(--text-secondary); margin-bottom: var(--space-4); font-size: 0.9375rem; line-height: 1.75; }
.legal-body ul, .legal-body ol { margin-bottom: var(--space-4); padding-left: var(--space-5); }
.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }
.legal-body li { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.75; margin-bottom: var(--space-1); }
.legal-body a  { color: var(--brand); }
.legal-body strong { color: var(--text); font-weight: 600; }

.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--brand-light);
  color: var(--brand);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------------------
   17. PAGE HERO (inner pages)
   -------------------------------------------------------------------------- */
.page-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-8);
  text-align: center;
}
.page-hero .overline { color: var(--brand); margin-bottom: var(--space-3); }
.page-hero h1 { margin-bottom: var(--space-4); max-width: 600px; margin-inline: auto; }
.page-hero p  { color: var(--text-secondary); max-width: 520px; margin-inline: auto; }

/* --------------------------------------------------------------------------
   18. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .stats-grid  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; flex-direction: column; }

  /* Mobile menu open state handled via JS toggle */
  .nav.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3);
    gap: var(--space-1);
    box-shadow: var(--shadow-md);
  }

  .nav.menu-open .nav-links a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav.menu-open .nav-cta {
    display: block;
    padding: var(--space-3);
    border-top: 1px solid var(--border);
  }

  .nav.menu-open .nav-cta .btn { width: 100%; }

  .nav { position: relative; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .cta-banner { padding: var(--space-7) var(--space-5); }
  .footer-bottom { flex-direction: column; text-align: center; }
  .step { grid-template-columns: 44px 1fr; gap: var(--space-4); }
  .step-number { width: 40px; height: 40px; font-size: 1rem; }
}
