/* Memora 3D — memora3d.app
   Design tokens mirror the iOS app (Memora3D/Support/Theme.swift):
   soft mint canvas, white elevated surfaces, mint action color, peach accent,
   warm near-black ink. Playful, soft-3D, sticker-first. */

/* ---------- Fonts (bundled, OFL — see /fonts/OFL.txt) ---------- */
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --mint: #A8DCC0;
  --mint-strong: #8FC9AB;   /* accent words on pale bg — large bold text only */
  --bg: #E8F6EE;
  --ink: #2B2B2B;
  --gray: #6F7E74;          /* secondary text on white */
  --gray-deep: #57655C;     /* secondary text on the mint page bg (AA) */
  --line: #D9EBDF;
  --cream: #F6E6CF;
  --peach: #FFB08E;
  --card: #FFFFFF;
  --shadow-card: 0 3px 8px rgba(0, 0, 0, .10);
  --shadow-soft: 0 3px 8px rgba(0, 0, 0, .07);
  --shadow-hero: 0 6px 16px rgba(0, 0, 0, .10);
  --r-card: 20px;
  --r-card-lg: 24px;
  --font-display: 'Poppins', ui-rounded, -apple-system, system-ui, sans-serif;
  --font-body: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
  --container: 1120px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, #DFF2E7 0%, rgba(223, 242, 231, 0) 60%),
    radial-gradient(50rem 35rem at -10% 40%, #F2FAF5 0%, rgba(242, 250, 245, 0) 55%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.accent { color: var(--mint-strong); }
.muted { color: var(--gray); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--card); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; z-index: 100;
}
.skip-link:focus-visible { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--mint-strong);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);            /* ink on mint, never white */
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}
.btn:active { opacity: .8; transform: scale(.985); }
.btn-primary { background: var(--mint); box-shadow: var(--shadow-card); }
.btn-secondary {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.chip-mint  { background: var(--mint); }
.chip-cream { background: var(--cream); }
.chip-peach { background: var(--peach); }

.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.badge-soon::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--peach); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(232, 246, 238, .85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.brand img {
  width: 40px; height: 40px;
  border-radius: 22%;
  border: 1px solid var(--line);
}
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
}
.site-nav a:hover { background: rgba(255, 255, 255, .7); }
.site-nav .nav-cta { background: var(--mint); box-shadow: var(--shadow-soft); }
.nav-extra { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 24px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  margin-bottom: 16px;
}
.hero .lede { font-size: 18px; color: var(--gray-deep); max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.trust-line { font-size: 13px; color: var(--gray-deep); margin-top: 18px; }
.hero-art { position: relative; max-width: 460px; margin: 0 auto; }
.hero-art img {
  border-radius: var(--r-card-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hero);
}

/* ---------- Sticker strip ---------- */
.sticker-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 28px 20px;
  scrollbar-width: none;
}
.sticker-strip::-webkit-scrollbar { display: none; }
.sticker-strip img {
  flex: 0 0 auto;
  width: 150px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .12));
}
.sticker-strip img:nth-child(odd)  { transform: rotate(-5deg); }
.sticker-strip img:nth-child(even) { transform: rotate(4deg); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); }
.section-head p { color: var(--gray-deep); }

/* Features */
.feature-grid { display: grid; gap: 16px; }
.feature-card { padding: 24px; }
.feature-card h3 { font-size: 19px; margin: 14px 0 8px; }
.feature-card p { color: var(--gray); font-size: 15px; margin: 0; }

/* How it works */
.how-grid { display: grid; gap: 24px; align-items: center; }
.how-art img { border-radius: var(--r-card-lg); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.step { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.step-num {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.step h3 { font-size: 17px; margin: 6px 0 4px; }
.step p { color: var(--gray-deep); margin: 0; font-size: 15px; }

/* 3D viewer */
.viewer-card {
  padding: 20px;
  border-radius: var(--r-card-lg);
  max-width: 600px;
  margin: 0 auto;
}
model-viewer {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 320px;
  max-height: 560px;
  border-radius: var(--r-card);
  background: #FFFFFF;
  --poster-color: #FFFFFF;
}
model-viewer img, .viewer-card > img { border-radius: var(--r-card); }
.viewer-note { text-align: center; font-size: 13px; color: var(--gray); margin: 12px 0 0; }

/* Screenshot strip */
.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x mandatory;
}
.screens figure { margin: 0; scroll-snap-align: center; }
.screens .phone {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  padding: 9px;
}
.screens .phone img { border-radius: 20px; }
.screens figcaption {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-deep);
  margin-top: 10px;
}

/* Bands (privacy + CTA) */
.band {
  background: var(--mint);
  border-radius: var(--r-card-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-soft);
}
.band h2 { font-size: clamp(24px, 3.5vw, 32px); }
.band p, .band li { color: var(--ink); }
.check-list { list-style: none; padding: 0; margin: 0 0 16px; }
.check-list li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.check-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px;
}
.band a.text-link { font-weight: 600; }
.cta-band { text-align: center; }
.cta-band img { width: 150px; margin: 0 auto 8px; }
.cta-band .hero-ctas { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 32px 0 44px;
  font-size: 14px;
  color: var(--gray-deep);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 28px; height: 28px; border-radius: 22%; border: 1px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; list-style: none; }
.footer-links a { text-decoration: none; font-weight: 600; font-family: var(--font-display); font-size: 13px; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Legal / prose pages ---------- */
.prose-page { max-width: 720px; margin: 0 auto; padding: 48px 20px 24px; }
.prose-page h1 { font-size: clamp(30px, 5vw, 40px); }
.page-meta { color: var(--gray-deep); font-size: 14px; margin-bottom: 28px; }
.summary-box {
  background: var(--mint);
  border-radius: var(--r-card);
  padding: 22px 24px;
  margin-bottom: 28px;
}
.summary-box p:last-child { margin-bottom: 0; }
.toc {
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc strong { font-family: var(--font-display); font-size: 15px; }
.toc ol { margin: 10px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc a { text-decoration: none; font-size: 14px; line-height: 2; color: var(--gray-deep); }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.prose h2 {
  font-size: 22px;
  margin-top: 40px;
  padding-top: 8px;
}
.prose h3 { font-size: 17px; margin-top: 24px; }
.prose p, .prose li { color: #3D453F; font-size: 15.5px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--mint);
  background: var(--card);
  border-radius: 0 12px 12px 0;
  color: var(--gray);
  font-size: 15px;
}
.back-home { margin-top: 48px; }

/* Support / FAQ */
.contact-card {
  padding: 28px;
  border-radius: var(--r-card-lg);
  margin-bottom: 36px;
  text-align: center;
}
.contact-card .email-plain {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  user-select: all;
  -webkit-user-select: all;
}
.faq-group { margin-bottom: 8px; }
.faq-group h2 { font-size: 20px; margin-top: 36px; }
details.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
  padding: 0 20px;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '＋';
  font-family: var(--font-display);
  color: var(--gray);
  flex: 0 0 auto;
}
details.faq[open] summary::after { content: '－'; }
details.faq .faq-body { padding: 0 0 16px; color: var(--gray); font-size: 15px; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* 404 */
.oops {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 48px 20px;
}
.oops img { width: 160px; margin: 0 auto 12px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* mirrors the app's mascot bodyY float: 4.6s seamless loop */
  @keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }
  .hero-art { animation: float-y 4.6s ease-in-out infinite; }
  details.faq summary::after { transition: transform .2s ease; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Breakpoints ---------- */
@media (min-width: 768px) {
  .nav-extra { display: inline-block; }
  .hero { padding: 72px 0 32px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: .9fr 1.1fr; }
  .band { padding: 44px 48px; }
  .band-split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
}
@media (min-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .screens { grid-auto-columns: minmax(0, 300px); justify-content: center; overflow-x: visible; }
  .sticker-strip { justify-content: center; }
}
