/* ============================================================
   Japam — marketing site
   Theme: "Powder & Indigo" (mirrors ios/Japam/Core/Theme.swift)
   Light: powder beige bg, ivory cards, deep indigo text, antique gold
   Dark:  midnight indigo bg, powder-blue text, brighter gold
   ============================================================ */

:root {
  color-scheme: light dark;

  --bg:        #F6F1E7;   /* powder beige */
  --card:      #FDFAF3;   /* ivory */
  --text:      #1E3A5F;   /* deep indigo blue */
  --subtle:    #546A85;   /* slate blue */
  --accent:    #3E6B96;   /* dusty deep blue */
  --on-accent: #FDFAF3;
  --gold:      #B9862F;   /* antique gold */
  --separator: #E4DBC8;
  --nav-bg:    rgba(246, 241, 231, 0.78);
  --shadow:    30, 58, 95; /* rgb of indigo, for soft shadows */

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0D1420;   /* midnight indigo */
    --card:      #16202E;
    --text:      #D6E4F0;   /* powder blue */
    --subtle:    #8FA6BF;
    --accent:    #7FA8CE;
    --on-accent: #0D1420;
    --gold:      #D9B44A;
    --separator: #263344;
    --nav-bg:    rgba(13, 20, 32, 0.72);
    --shadow:    0, 0, 0;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

::selection { background: rgba(62, 107, 150, 0.25); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Sticky nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-nav.is-scrolled {
  border-bottom-color: var(--separator);
  box-shadow: 0 6px 24px -18px rgba(var(--shadow), 0.5);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; }

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(var(--shadow), 0.25);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--subtle);
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pill:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(var(--shadow), 0.5);
}
.pill svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .pill { margin-left: auto; }
  .pill .pill-long { display: none; }
}
@media (min-width: 721px) {
  .pill .pill-short { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.display {
  font-size: clamp(2.6rem, 5.5vw, 4.25rem);
  margin-bottom: 0.5em;
}

.lede {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  color: var(--subtle);
  max-width: 34em;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.coming-note {
  color: var(--subtle);
  font-size: 0.9rem;
  opacity: 0.85;
}

/* App Store badge — drawn locally, no Apple-hosted assets */

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.4rem 0.7rem 1.2rem;
  border-radius: 13px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  line-height: 1.15;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.appstore-badge:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(var(--shadow), 0.55);
}
.appstore-badge svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.appstore-badge .badge-lines { display: flex; flex-direction: column; }
.appstore-badge .badge-lines small {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.9;
}
.appstore-badge .badge-lines strong {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Hero visual — night-sky card + phone */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 3rem) 0;
}

.night-card {
  position: absolute;
  inset: 4% -4% 2%;
  border-radius: 40px;
  transform: rotate(-3.5deg);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255,255,255,0.85) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 26% 42%, rgba(255,255,255,0.6) 50%, transparent 55%),
    radial-gradient(1.8px 1.8px at 38% 12%, rgba(255,255,255,0.9) 50%, transparent 55%),
    radial-gradient(1.1px 1.1px at 49% 33%, rgba(255,255,255,0.55) 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 62% 8%, rgba(255,255,255,0.8) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 71% 27%, rgba(255,255,255,0.6) 50%, transparent 55%),
    radial-gradient(1.9px 1.9px at 84% 44%, rgba(255,255,255,0.85) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 90% 14%, rgba(255,255,255,0.65) 50%, transparent 55%),
    radial-gradient(1.4px 1.4px at 8% 62%, rgba(255,255,255,0.6) 50%, transparent 55%),
    radial-gradient(1.1px 1.1px at 21% 80%, rgba(255,255,255,0.5) 50%, transparent 55%),
    radial-gradient(1.7px 1.7px at 55% 68%, rgba(255,255,255,0.7) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 78% 74%, rgba(255,255,255,0.55) 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 93% 88%, rgba(255,255,255,0.7) 50%, transparent 55%),
    radial-gradient(1.1px 1.1px at 34% 91%, rgba(255,255,255,0.5) 50%, transparent 55%),
    radial-gradient(60px 60px at 82% 16%, rgba(217, 180, 74, 0.35), transparent 65%),
    radial-gradient(120% 95% at 68% 12%, #2C4A73 0%, #1E3A5F 45%, #0D1420 100%);
  box-shadow: 0 34px 80px -34px rgba(var(--shadow), 0.55);
}

@media (prefers-color-scheme: dark) {
  .night-card {
    box-shadow:
      0 0 0 1px rgba(214, 228, 240, 0.07),
      0 34px 80px -34px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- Hand-built iPhone frame ---------- */

.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 76vw);
  padding: 11px;
  border-radius: 56px;
  background: linear-gradient(150deg, #46536455 0%, #131A26 32%, #0A0E15 100%), #10161f;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.09),
    0 1px 2px rgba(var(--shadow), 0.25),
    0 14px 30px -10px rgba(var(--shadow), 0.4),
    0 38px 70px -22px rgba(var(--shadow), 0.5);
}

.phone img {
  display: block;
  width: 100%;
  border-radius: 45px;
  background: #0D1420;
}

/* Dynamic Island */
.phone::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  width: 27%;
  height: 23px;
  border-radius: 13px;
  background: #04060A;
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.09);
}

.phone--sm {
  width: 218px;
  padding: 8px;
  border-radius: 42px;
}
.phone--sm img { border-radius: 34px; }
.phone--sm::after {
  top: 17px;
  height: 17px;
  border-radius: 9px;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section-head {
  max-width: 640px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}

.section-head p { color: var(--subtle); }

/* Features — alternating copy/visual rows */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  padding: clamp(2.25rem, 5vw, 4rem) 0;
}

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

.feature:nth-of-type(even) .feature-visual { order: -1; }

.kicker {
  display: inline-block;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.feature h3 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.feature p {
  color: var(--subtle);
  max-width: 30em;
}

/* Calm-by-design strip */

.calm-strip {
  background: var(--card);
  border-block: 1px solid var(--separator);
}

.calm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}

.calm-tile { text-align: center; }

.calm-tile .glyph {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.75rem;
}

.calm-tile h3 {
  font-size: 1.25rem;
  margin-bottom: 0.35em;
}

.calm-tile p {
  color: var(--subtle);
  font-size: 0.95rem;
  margin: 0;
}

/* Screens gallery */

.gallery-track {
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  overflow-x: auto;
  padding: 1rem 0.5rem 2rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--separator) transparent;
}

.gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  text-align: center;
}

.gallery-item figcaption {
  margin-top: 1rem;
  color: var(--subtle);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Closing CTA */

.cta {
  text-align: center;
  padding: clamp(4rem, 9vw, 7rem) 0;
}

.cta .hero-actions { justify-content: center; }

.cta .om-mark {
  font-size: 2.25rem;
  color: var(--gold);
  display: block;
  margin-bottom: 1.25rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--separator);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem;
  text-align: center;
}

.footer-om {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--subtle);
  font-size: 0.92rem;
}
.footer-links a:hover { color: var(--text); }

.shanti {
  font-family: var(--font-display);
  color: var(--subtle);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.copyright {
  color: var(--subtle);
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0;
}

/* ---------- Inner pages (privacy / terms / support) ---------- */

.page-head {
  padding: clamp(3rem, 7vw, 5rem) 0 1rem;
  text-align: center;
}

.page-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.25rem); }

.page-head .meta {
  color: var(--subtle);
  font-size: 0.95rem;
}

.prose {
  max-width: 720px;
  margin-inline: auto;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5em;
}

.prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--gold); }

.prose strong { font-weight: 600; }

.prose .contact-card {
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.prose .contact-card p { margin: 0; }

/* FAQ */

.faq details {
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-bottom: 0.9rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 0.25s ease;
  flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p {
  color: var(--subtle);
  margin: 0.85rem 0 0.25rem;
}

/* ---------- Confirmed page ---------- */

.centered-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.confirm-card {
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: 28px;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem);
  max-width: 460px;
  box-shadow: 0 30px 60px -30px rgba(var(--shadow), 0.35);
}

.confirm-card .om-mark {
  font-size: 2.5rem;
  color: var(--gold);
  display: block;
  margin-bottom: 1rem;
}

.confirm-card h1 {
  font-size: 1.9rem;
  margin-bottom: 0.4em;
}

.confirm-card p { color: var(--subtle); margin: 0; }

.confirm-card .back-home {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: 0.92rem;
}

/* ---------- Scroll-reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pill, .appstore-badge { transition: none; }
}

/* ---------- Responsive stacking ---------- */

@media (max-width: 860px) {
  .hero-grid,
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid { text-align: center; }
  .hero .lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }

  .feature { text-align: center; }
  .feature p { margin-inline: auto; }
  .feature:nth-of-type(even) .feature-visual { order: 0; }

  .calm-grid { grid-template-columns: minmax(0, 1fr); }
}
