/* ============================================================
   JUST GLANCE — MARKETING SITE
   Design tokens mirror the iOS app exactly.
   No frameworks. No build tools. Plain CSS.
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Colours — light mode */
  --bg:              #FAF7F4;   /* warmBackground */
  --surface:         #F5F1ED;   /* warmSurface */
  --surface-raised:  #EDE8E2;   /* warmSurfaceElevated */
  --accent:          #EF8033;   /* accentPrimary */
  --accent-hover:    #D96E20;
  --live:            #34C054;   /* cameraLive */
  --text-primary:    #2C2218;   /* textPrimary */
  --text-secondary:  #7A6558;   /* textSecondary */
  --text-tertiary:   #A8998E;   /* textTertiary */
  --separator:       #E0D8D0;   /* separator */

  /* Typography */
  --font:            'SF Pro Rounded', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Spacing */
  --space-xxs:  4px;
  --space-xs:   8px;
  --space-sm:   12px;
  --space-md:   16px;
  --space-lg:   20px;
  --space-xl:   28px;
  --space-xxl:  40px;
  --space-3xl:  64px;
  --space-4xl:  96px;

  /* Shape */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  /* Layout */
  --max-width:   1080px;
  --screen-margin: 20px;

  /* Shadows — warm-toned, never cool grey */
  --shadow-card: 0 4px 24px rgba(44, 34, 24, 0.08);
  --shadow-lift: 0 8px 40px rgba(44, 34, 24, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:              #1C1510;
    --surface:         #251C15;
    --surface-raised:  #2E231A;
    --accent:          #F48840;
    --accent-hover:    #E07530;
    --text-primary:    #F5EDE6;
    --text-secondary:  #8A7A6E;
    --text-tertiary:   #5E5048;
    --separator:       #332820;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 8px 40px rgba(0, 0, 0, 0.4);
  }
}

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

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

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/* ── Typography ──────────────────────────────────────────── */
h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  max-width: 60ch;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.section-intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xxl);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(239, 128, 51, 0.35);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(239, 128, 51, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-primary.btn-large {
  font-size: 1.1rem;
  padding: 18px 40px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 14px 4px;
  border-bottom: 1px solid var(--separator);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── Screenshot placeholders ─────────────────────────────── */
.screenshot-placeholder {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--separator);
}

.screenshot-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.screenshot-placeholder.portrait {
  aspect-ratio: 9 / 19.5;
  max-width: 280px;
}

.screenshot-placeholder.widescreen {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.placeholder-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-md);
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* Hide label when image loads successfully */
.screenshot-placeholder img + .placeholder-label {
  display: none;
}

/* ── Header / Nav ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
}

.nav-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxl);
  align-items: center;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: var(--space-4xl) var(--space-lg);
  min-height: 80vh;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
  max-width: none;
}

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

.hero-body {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 46ch;
  margin-bottom: var(--space-xl);
}

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

.hero-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  max-width: none;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  position: relative;
  padding: 12px;
  background: var(--surface);
  border-radius: 44px;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--separator);
}

.phone-frame .screenshot-placeholder.portrait {
  border-radius: 32px;
  max-width: 260px;
}

/* ── Problem section ─────────────────────────────────────── */
.problem {
  background: var(--surface);
  padding: var(--space-4xl) 0;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.problem h2 {
  margin-bottom: var(--space-md);
}

.problem > .container > p {
  font-size: 1.05rem;
  margin-bottom: var(--space-xxl);
  max-width: 56ch;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.problem-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--separator);
}

.problem-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.problem-card h3 {
  margin-bottom: var(--space-xs);
}

.problem-card p {
  font-size: 0.9rem;
  max-width: none;
}

/* ── Wide screenshot ─────────────────────────────────────── */
.screenshot-wide {
  padding: var(--space-4xl) 0;
}

.screenshot-wide .screenshot-placeholder {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lift);
}

/* ── Features ────────────────────────────────────────────── */
.features {
  padding: var(--space-4xl) 0;
}

.features h2 {
  margin-bottom: var(--space-xs);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--separator);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(239, 128, 51, 0.12);  /* fallback for older browsers */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

.feature-card h3 {
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: 0.9rem;
  max-width: none;
}

/* ── Screenshot feature (side-by-side) ───────────────────── */
.screenshot-feature {
  padding: var(--space-4xl) 0;
  background: var(--surface);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.screenshot-feature-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxl);
  align-items: center;
}

.screenshot-feature--reversed .screenshot-feature-inner {
  direction: rtl;
}

.screenshot-feature--reversed .screenshot-feature-inner > * {
  direction: ltr;
}

.screenshot-feature-text h2 {
  margin-bottom: var(--space-md);
}

.screenshot-feature-text p {
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
}

.screenshot-feature-visual {
  display: flex;
  justify-content: center;
}

/* ── Pro section ─────────────────────────────────────────── */
.pro {
  padding: var(--space-4xl) 0;
}

.pro h2 {
  margin-bottom: var(--space-xs);
}

.pro-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-xxl);
  align-items: start;
  margin-top: var(--space-xxl);
}

.pro-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.pro-list li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.pro-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--live);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 2px;
}

.pro-list strong {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pro-list span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pro-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 80px;
}

.pro-price-block {
  margin-bottom: var(--space-md);
}

.pro-price {
  display: block;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.pro-price-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xxs);
}

.pro-card-body {
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
  max-width: none;
}

.pro-card-note {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-sm);
  max-width: none;
}

/* ── Privacy section ─────────────────────────────────────── */
.privacy {
  background: var(--surface);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  padding: var(--space-4xl) 0;
}

.privacy-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xxl);
  align-items: center;
}

.privacy-text h2 {
  margin-bottom: var(--space-md);
}

.privacy-text p {
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
  max-width: 52ch;
}

.privacy-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-xxl);
  border: 1px solid var(--separator);
  color: var(--accent);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

/* ── Compatibility ───────────────────────────────────────── */
.compat {
  padding: var(--space-4xl) 0;
}

.compat h2 {
  margin-bottom: var(--space-xs);
}

.compat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.compat-item {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.compat-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  max-width: none;
}

/* ── Final CTA ───────────────────────────────────────────── */
.final-cta {
  background: var(--surface);
  border-top: 1px solid var(--separator);
  padding: var(--space-4xl) 0;
  text-align: center;
}

.final-cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.final-cta h2 {
  max-width: 18ch;
}

.final-cta p {
  font-size: 1.05rem;
  max-width: 40ch;
  text-align: center;
}

.final-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  max-width: none;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--separator);
  padding: var(--space-xxl) 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-xxl);
  align-items: start;
}

.footer-brand .wordmark {
  display: block;
  margin-bottom: var(--space-xs);
}

.footer-brand p {
  font-size: 0.85rem;
  max-width: none;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  max-width: none;
  align-self: end;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: var(--space-xxl);
    text-align: center;
  }

  .hero-body { max-width: none; }
  .hero-actions { justify-content: center; }
  .hero-note { text-align: center; }
  .hero-visual { order: -1; }

  .phone-frame .screenshot-placeholder.portrait {
    max-width: 200px;
  }

  .problem-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .screenshot-feature-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .screenshot-feature--reversed .screenshot-feature-inner {
    direction: ltr;
  }

  .screenshot-feature-text p { max-width: none; }

  .pro-grid {
    grid-template-columns: 1fr;
  }

  .pro-card {
    position: static;
  }

  .privacy-inner {
    grid-template-columns: 1fr;
  }

  .privacy-badge {
    white-space: normal;
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-legal {
    align-self: auto;
  }
}

@media (max-width: 600px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
