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

/* === Theme Custom Properties (from AppTheme.swift) === */
:root {
  color-scheme: dark light;
  --footer-height: 74px;
  --bg-top: rgb(33, 36, 38);
  --bg-bottom: rgb(23, 26, 28);
  --surface: rgb(46, 48, 51);
  --surface-alt: rgb(59, 61, 64);
  --stroke: rgb(87, 89, 92);
  --tint: rgb(87, 184, 161);
  --accent: rgb(224, 181, 110);
  --text: rgb(237, 232, 224);
  --muted: rgb(181, 176, 168);
  --shadow: rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg-top: rgb(245, 245, 247);
    --bg-bottom: rgb(255, 255, 255);
    --surface: rgb(255, 255, 255);
    --surface-alt: rgb(235, 236, 238);
    --stroke: rgb(210, 212, 215);
    --tint: rgb(52, 152, 130);
    --accent: rgb(186, 138, 63);
    --text: rgb(28, 28, 30);
    --muted: rgb(108, 108, 112);
    --shadow: rgba(0, 0, 0, 0.08);
  }

  body {
    -webkit-font-smoothing: auto;
  }
}

/* === Base === */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-top), var(--bg-bottom));
  transition: background 200ms ease, color 200ms ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 {
  line-height: 1.2;
}

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: var(--tint);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* === Layout === */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: clamp(52px, 7.5vw, 84px) 0;
}

/* === Sticky Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 0;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header.scrolled {
  background: color-mix(in srgb, var(--bg-top) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--stroke);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.header-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.header-brand span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--tint);
  border: none;
  border-radius: 14px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.btn-secondary {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--stroke);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn:hover {
  opacity: 0.84;
  text-decoration: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 12px;
}

/* === Hero === */
.hero {
  height: calc(100svh - var(--footer-height));
  height: calc(100dvh - var(--footer-height));
  padding: clamp(88px, 12vw, 132px) 0 clamp(4px, 1vw, 10px);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - var(--footer-height));
  min-height: calc(100dvh - var(--footer-height));
  display: flex;
  align-items: center;
}

.hero .container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(22px, 4vw, 44px);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.hero-orb--accent {
  width: clamp(240px, 35vw, 420px);
  height: clamp(240px, 35vw, 420px);
  background: var(--accent);
  opacity: 0.18;
  top: -140px;
  right: max(-160px, -8vw);
}

.hero-orb--tint {
  width: clamp(220px, 32vw, 360px);
  height: clamp(220px, 32vw, 360px);
  background: var(--tint);
  opacity: 0.16;
  bottom: -130px;
  left: max(-140px, -6vw);
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px var(--shadow);
}

.hero h1 {
  font-size: clamp(34px, 4.8vw, 56px);
  font-weight: 700;
  max-width: 820px;
  margin: 0 auto 12px;
  text-wrap: balance;
}

.hero-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tint);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 680px;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-download {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: fit-content;
  margin: 72px auto 0;
}

.hero-qr-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 10px;
  background: color-mix(in srgb, var(--surface) 88%, white 12%);
  border: 1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  border-radius: 20px;
  box-shadow: 0 14px 30px var(--shadow);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.hero-qr-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tint) 46%, var(--stroke));
  box-shadow: 0 18px 36px var(--shadow);
}

.hero-qr {
  width: clamp(68px, 13vw, 80px);
  height: auto;
  border-radius: 12px;
}

.hero-download-note {
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  max-width: 200px;
  margin: 0 auto;
}

@media (max-width: 899px) {
  .hero .container {
    min-height: calc(100svh - var(--footer-height) - 74px);
    min-height: calc(100dvh - var(--footer-height) - 74px);
  }

  .hero-icon {
    width: 144px;
    height: 144px;
    border-radius: 36px;
  }

  .hero-download {
    margin-top: 104px;
  }

  .hero-qr-link {
    margin: 0 auto;
  }

  .hero-qr {
    width: min(12vw, 44px);
  }
}

.hero-scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  text-decoration: none;
  animation: hero-scroll-bounce 1.8s ease-in-out infinite;
}

.hero-scroll-indicator:hover {
  color: var(--tint);
  border-color: var(--tint);
  text-decoration: none;
}

.hero-scroll-indicator svg {
  width: 16px;
  height: 16px;
}

/* === Download CTA === */
.cta {
  text-align: center;
  padding: 0 0 16px;
  min-height: calc(100svh - 72px);
  min-height: calc(100dvh - 72px);
  display: flex;
  align-items: center;
}

.cta .container {
  width: 100%;
}

.cta-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 20px;
  box-shadow: 0 6px 16px var(--shadow);
}

.cta h2 {
  font-size: 26px;
  margin-bottom: 8px;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.cta-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.cta .app-store-badge {
  height: 44px;
  margin: 0 auto 12px;
}

.store-coming-soon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0.72;
  filter: grayscale(0.2);
  cursor: not-allowed;
}

.cta-note {
  font-size: 12px;
  color: var(--muted);
}

.cta-contact {
  margin-top: 14px;
}

/* === Legal Pages === */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.legal-content h2 {
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 10px;
  color: var(--text);
}

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

.legal-content p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.7;
}

.legal-content a {
  color: var(--tint);
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 200ms ease;
  margin-top: auto;
}

.footer-inner {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 0 12px;
}

.footer-sep {
  opacity: 0.4;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--tint);
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease, opacity 180ms ease;
}

.social-link:hover {
  color: var(--tint);
  text-decoration: none;
  transform: translateY(-1px);
}

.social-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--tint) 72%, white);
  outline-offset: 3px;
}

.social-link svg {
  width: 100%;
  height: 100%;
}

.social-link-facebook svg {
  transform: translateY(-0.5px) scale(1.08);
  transform-origin: center;
}

@media (max-width: 899px) {
  .hero .container {
    padding-bottom: 28px;
  }
}

/* === Animations === */
.fade-in {
  opacity: 1;
  transform: none;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes hero-scroll-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(5px);
  }
}

/* === Responsive === */
@media (max-width: 899px) {
  .hero {
    height: auto;
    min-height: 0;
    flex: 1;
    padding-top: clamp(56px, 12vw, 88px);
    padding-bottom: 18px;
  }
}

@media (min-width: 900px) {
  :root {
    --footer-height: 56px;
  }

  .hero {
    height: calc(100svh - var(--footer-height));
    height: calc(100dvh - var(--footer-height));
    min-height: calc(100svh - var(--footer-height));
    min-height: calc(100dvh - var(--footer-height));
  }

  #download.cta {
    height: 100svh;
    height: 100dvh;
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: 32px;
    padding-bottom: 16px;
  }

  .site-footer {
    padding: 16px 0;
  }

  .hero-icon {
    width: 128px;
    height: 128px;
    border-radius: 30px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-tagline {
    font-size: 20px;
  }

}

@media (min-width: 1700px) {
  .container {
    max-width: 1360px;
    padding: 0 28px;
  }

  section {
    padding: clamp(82px, 7vw, 124px) 0;
  }

  .hero {
    padding-top: clamp(112px, 10vh, 152px);
    padding-bottom: clamp(6px, 1vh, 12px);
  }

  .hero h1 {
    font-size: clamp(56px, 3.4vw, 66px);
  }

  .hero-tagline {
    font-size: clamp(21px, 1.35vw, 25px);
  }

}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (hover: none) and (pointer: coarse) {
  body {
    background-attachment: scroll;
  }
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}
