/* Filmbook marketing site
   Palette and type choices mirror the app's own Light/Sand/Dark themes
   (see Themes.swift in the Filmbook app) for brand continuity. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegible-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegible-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Spacing scale -- every margin/padding/gap in this file is one of these */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --bg: #fbfbfa;
  --surface: #f2f2f7;
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --heading: #1a1a1f;
  --accent: #2f6291;
  --accent-rgb: 47, 98, 145;
  --rule: #d8d8dc;

  --sand-bg: #f3e4c8;
  --sand-surface: #e7d2a8;
  --sand-heading: #9c5a30;
  --sand-accent: #35707d;
  --sand-text: #3a2a18;

  --water-bg: #050d18;
  --water-heading: #00c8dc;

  --font-serif: Georgia, "Iowan Old Style", "Palatino", serif;
  --font-sans: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 70ch;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1c;
    --surface: #2a2a2d;
    --text: #e6e6ea;
    --text-secondary: #9a9aa0;
    --heading: #f3f3f6;
    --accent: #6fa8e0;
    --accent-rgb: 111, 168, 224;
    --rule: #3a3a3e;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(127, 127, 127, 0.14) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:not(.button):not(.brand) { text-underline-offset: 0.15em; }

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

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  /* padding-left/right only (never a `padding` shorthand) so this never
     fights with a section's own vertical padding -- .wrap is a class and
     would otherwise always beat the `section { padding: ... }` type
     selector regardless of source order, zeroing out top/bottom spacing
     on any <section class="wrap"> that doesn't also carry its own
     padding-setting class. */
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}

.site-header.wrap { display: flex; }

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--heading);
  transition: transform 0.3s var(--ease);
}

.brand:hover { transform: translateY(-1px) scale(1.02); }

.brand img { width: 32px; height: 32px; }

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.3rem;
}

.site-nav {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 2px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.25s var(--ease);
}

.site-nav a:hover { color: var(--heading); }
.site-nav a:hover::after { right: 0; }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-2xl) 0 var(--space-3xl);
  position: relative;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.1rem);
  margin: 0;
}

.hero p.lede {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0;
}

.platforms {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.platform-pill {
  font-size: 0.82rem;
  padding: var(--space-3xs) var(--space-sm);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--rule);
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 999px;
  background: var(--sand-bg);
  color: var(--sand-heading);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px -12px rgba(156, 90, 48, 0.55);
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Hero: a fanned stack of themed screenshots (a "hand of cards"/stacked
   book pages) with a warm glow behind the front page, rather than a
   device-hardware mockup -- leans into the book/paper metaphor instead
   of competing with Apple's own product photography. */

.hero-art {
  position: relative;
  height: 540px;
  z-index: 0;
}

.hero-art::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: var(--sand-bg);
  opacity: 0.5;
  filter: blur(70px);
  top: -20px;
  right: 10%;
  z-index: -1;
}

.page-card {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transform-origin: bottom center;
  transition: transform 0.4s var(--ease);
}

.page-card img { display: block; width: 100%; }

.page-card.back-left {
  transform: translateX(-50%) translateX(-130px) rotate(-11deg);
  z-index: 1;
  filter: saturate(0.85) brightness(0.92);
}

.page-card.back-right {
  transform: translateX(-50%) translateX(120px) rotate(13deg);
  z-index: 2;
  filter: saturate(0.85) brightness(0.92);
}

.page-card.front {
  transform: translateX(-50%) rotate(-2deg);
  z-index: 3;
  width: 320px;
}

.hero-art:hover .page-card.back-left { transform: translateX(-50%) translateX(-150px) rotate(-14deg); }
.hero-art:hover .page-card.back-right { transform: translateX(-50%) translateX(140px) rotate(16deg); }
.hero-art:hover .page-card.front { transform: translateX(-50%) rotate(-2deg) translateY(-10px); }

/* Sections */

section { padding: var(--space-2xl) 0; }
section[id] { scroll-margin-top: var(--space-2xl); }

.section-head { max-width: 60ch; margin: 0 auto var(--space-xl); text-align: center; }
.section-head h2 { font-size: 2.1rem; margin: 0 0 var(--space-xs); }
.section-head p { color: var(--text-secondary); margin: 0; }

.philosophy {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-md);
}

.philosophy blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--heading);
  max-width: 50ch;
  margin: var(--space-md) auto 0;
  text-align: center;
  border: none;
  padding: 0;
}

/* Reveal-on-scroll */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Feature grid */

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

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

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 48px -28px rgba(var(--accent-rgb), 0.5);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
}

.feature-card .feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin: 0 0 var(--space-2xs);
}

.feature-card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.96rem;
}

/* Theme gallery */

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

.theme-card {
  --card-accent: var(--accent);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface);
  margin: 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.theme-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 24px 44px -24px var(--card-accent);
}

.theme-card .theme-shot-wrap { overflow: hidden; }

.theme-card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s var(--ease);
}

.theme-card:hover img { transform: scale(1.06); }

.theme-card figcaption {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--heading);
  border-top: 3px solid var(--card-accent);
}

/* Alice showcase — cards match the .theme-card treatment used in the Themes
   section above, rather than a boxed/colored section, so the page reads as
   one consistent system. */

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

.alice-grid figure {
  --card-accent: var(--accent);
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.alice-grid figure:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 24px 44px -24px var(--card-accent);
}

.alice-grid img {
  display: block;
  width: 100%;
  transition: transform 0.5s var(--ease);
}

.alice-grid figure:hover img { transform: scale(1.06); }

.alice-grid figcaption {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--heading);
  border-top: 3px solid var(--card-accent);
}

.alice-credit {
  max-width: 60ch;
  margin: var(--space-xl) auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-xl) 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.site-footer .footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.credits {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Simple pages (support / privacy) */

.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-3xl);
}

.doc h1 { font-size: 2.4rem; margin-bottom: var(--space-2xs); }
.doc .meta { color: var(--text-secondary); margin-bottom: var(--space-xl); font-size: 0.9rem; }
.doc h2 { font-size: 1.4rem; margin-top: var(--space-xl); }
.doc p, .doc li { color: var(--text); }
.doc .lede { color: var(--text-secondary); font-size: 1.1rem; }

.faq-item { margin-bottom: var(--space-lg); }
.faq-item h3 { font-size: 1.05rem; margin: 0 0 var(--space-3xs); color: var(--heading); }
.faq-item p { margin: 0; color: var(--text-secondary); }

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 10px 24px -12px rgba(var(--accent-rgb), 0.6);
}

.button:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(var(--accent-rgb), 0.7); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: var(--space-lg); }
  .hero-copy { align-items: center; text-align: center; }
  .hero p.lede { max-width: 52ch; }
  .platforms, .hero-copy { align-items: center; }
  /* Collapse the fanned stack into one centered, normal-flow card -- the
     absolute-position offsets above are only tuned for the two-column
     desktop width, so don't try to reuse them here. */
  .hero-art {
    height: auto;
    margin-top: var(--space-2xl);
    display: flex;
    justify-content: center;
  }
  .hero-art::before { display: none; }
  .page-card.back-left, .page-card.back-right { display: none; }
  .page-card.front {
    position: static;
    width: 100%;
    max-width: 360px;
    transform: none;
  }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .theme-gallery { grid-template-columns: repeat(2, 1fr); }
  .alice-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header.wrap {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .site-nav { gap: var(--space-sm); justify-content: center; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .theme-gallery { grid-template-columns: 1fr; }
  .alice-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .coming-soon { animation: none; }
  .device, .brand, .button, .feature-card, .theme-card, .theme-card img, .alice-grid figure {
    transition: none;
  }
}
