/* Elumi landing — brand palette mirrors the iOS app */
:root {
  --bg: #FDF6EE;
  --surface: #F5EDE3;
  --primary: #1E1510;
  --on-primary: #FDF6EE;
  --subtext: #5C4F45;
  --accent: #C96A3E;
  --max: 1080px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1310;
    --surface: #271D18;
    --primary: #F2E6D8;
    --on-primary: #1C1310;
    --subtext: #B3A695;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--primary);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Safety net: any stray fixed-width element or scrollable child won't push
   the page horizontally past the viewport. Doesn't break sticky positioning
   the way `overflow: hidden` on html would. */
html { overflow-x: clip; }
body { overflow-x: clip; }

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

h1, h2 { text-wrap: balance; }

/* ---------- Nav ---------- */

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}

.wordmark.small {
  font-size: 18px;
}
.wordmark.small .wordmark-icon { width: 22px; height: 22px; border-radius: 6px; }

.nav-cta {
  font-size: 14px;
  color: var(--subtext);
  border: 1px solid color-mix(in srgb, var(--subtext) 30%, transparent);
  padding: 7px 14px;
  border-radius: 999px;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-cta:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface);
}

@media (max-width: 540px) {
  .nav-cta { display: none; }
}

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

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px 56px;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-size: clamp(40px, 7vw, 76px);
  margin: 0 0 28px;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero .lede {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--subtext);
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.6;
  text-wrap: balance;
}

.hero-meta {
  margin-top: 18px;
  color: var(--subtext);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--subtext);
  transition: background .2s, color .2s;
}
.hero-rating:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--primary); }
.hero-rating .stars {
  color: var(--accent);
  letter-spacing: 1px;
  font-size: 13px;
}

/* ---------- App Store badge (Apple official SVG) ---------- */

.app-store-badge {
  display: inline-block;
  transition: transform .15s ease, opacity .15s ease;
}
.app-store-badge img {
  height: 56px;
  width: auto;
  display: block;
}
.app-store-badge:hover { transform: translateY(-1px); opacity: 0.9; }
.app-store-badge:active { transform: translateY(0); }

@media (prefers-color-scheme: dark) {
  /* The black-on-white badge becomes hard to see on dark cream;
     invert so the badge reads naturally in both modes. */
  .app-store-badge img { filter: invert(1); }
}

/* ---------- Screens carousel ---------- */

.screens {
  margin: 24px auto 64px;
  max-width: 1200px;
  padding: 0 24px;
}

.screens-track {
  display: flex;
  gap: 18px;
  padding: 12px 0 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screens-track::-webkit-scrollbar { display: none; }

.screens-track img {
  flex: 0 0 auto;
  width: 240px;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 18px 40px -20px rgba(28, 19, 16, 0.25);
  scroll-snap-align: center;
}

@media (min-width: 720px) {
  .screens-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    overflow: visible;
    justify-items: center;
  }
  .screens-track img { width: 100%; max-width: 260px; }
}

/* ---------- Animated demo: "see the moment" ---------- */

.demo {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 24px;
  text-align: center;
}

.demo h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(28px, 4.5vw, 40px);
  margin: 0 auto 8px;
}

.demo-sub {
  color: var(--subtext);
  font-size: 16px;
  margin: 0 0 36px;
}

.demo-phone {
  width: min(280px, 78vw);
  margin: 0 auto;
  background: #0E0907;
  border-radius: 46px;
  padding: 8px;
  box-shadow: 0 24px 60px -28px rgba(28, 19, 16, 0.45);
}

.demo-screen {
  position: relative;
  background: var(--bg);
  border-radius: 38px;
  padding: 50px 14px 28px;
  min-height: 420px;
  overflow: hidden;
}

.demo-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 26px;
  background: #0E0907;
  border-radius: 999px;
}

.demo-prompt {
  font-size: 12px;
  color: var(--subtext);
  text-align: center;
  margin-bottom: 18px;
  padding: 0 6px;
  line-height: 1.45;
}

.demo-card {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 8px;
  text-align: left;
  min-height: 76px;
  overflow: hidden;
}
.demo-card-partner { text-align: right; }

.demo-label {
  font-size: 10px;
  color: var(--subtext);
  margin-bottom: 6px;
}

.demo-check {
  color: var(--accent);
  margin-left: 2px;
  font-weight: 600;
}

.demo-state {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 32px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--primary);
}
.demo-card-partner .demo-state { text-align: right; }

.demo-state-pending {
  color: var(--subtext);
  animation: demoPending 6s ease-in-out infinite;
}
.demo-state-revealed {
  animation: demoRevealed 6s ease-in-out infinite;
  opacity: 0;
}

@keyframes demoPending {
  0%, 40% { opacity: 1; }
  48%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes demoRevealed {
  0%, 40% { opacity: 0; transform: translateY(6px); }
  48%, 95% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(6px); }
}

/* Animated dots */
.demo-dots, .demo-dots-inline {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
  margin-left: 4px;
}
.demo-dots i, .demo-dots-inline i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subtext);
  display: inline-block;
  animation: demoDotPulse 1.2s ease-in-out infinite;
}
.demo-dots i:nth-child(2), .demo-dots-inline i:nth-child(2) { animation-delay: 0.15s; }
.demo-dots i:nth-child(3), .demo-dots-inline i:nth-child(3) { animation-delay: 0.3s; }

@keyframes demoDotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .demo-state-pending, .demo-state-revealed, .demo-dots i, .demo-dots-inline i {
    animation: none;
  }
  .demo-state-pending { opacity: 0; }
  .demo-state-revealed { opacity: 1; transform: none; }
}

/* ---------- Content blocks ---------- */

.block, .features, .cta {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}

.block h2, .features h2, .cta h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(28px, 4.5vw, 40px);
  margin: 0 auto 24px;
  max-width: 28ch;
}

.cta h2 { max-width: 24ch; }

.block p {
  color: var(--subtext);
  font-size: 17px;
  line-height: 1.65;
  margin: 0 auto 16px;
  max-width: 56ch;
  text-wrap: pretty;
}

.block.alt {
  background: var(--surface);
  max-width: none;
  padding: 72px 24px;
}
.block.alt > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.muted {
  color: color-mix(in srgb, var(--subtext) 80%, transparent);
  font-style: italic;
}

blockquote {
  margin: 28px auto;
  padding: 22px 26px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  text-align: left;
  max-width: 480px;
}
blockquote p { margin: 6px 0; color: var(--primary); }
blockquote em {
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 8px;
}

/* ---------- Features grid ---------- */

.features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}

@media (min-width: 640px) {
  .features ul { grid-template-columns: 1fr 1fr; }
}

.features li {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.features li strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.features li span {
  font-size: 14px;
  color: var(--subtext);
  line-height: 1.5;
}

/* ---------- Testimonials ---------- */

.testimonials {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}

.testimonials h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 4.5vw, 40px);
  margin: 0 0 36px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 880px;
  margin: 0 auto;
}
@media (min-width: 720px) {
  .testimonial-grid { grid-template-columns: 1fr 1fr; }
}

.testimonial {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  text-align: left;
  position: relative;
}
.testimonial::before {
  content: "“";
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  position: absolute;
  top: 14px;
  left: 22px;
  opacity: 0.35;
}
.testimonial blockquote {
  margin: 0 0 12px;
  padding: 12px 0 0 24px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--primary);
  border: 0;
  background: transparent;
  letter-spacing: -0.005em;
}
.testimonial figcaption {
  padding-left: 24px;
  font-size: 13px;
  color: var(--subtext);
}

/* ---------- CTA ---------- */

.cta { padding: 96px 24px 112px; }

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

footer {
  border-top: 1px solid color-mix(in srgb, var(--subtext) 18%, transparent);
  padding: 36px 24px 56px;
  text-align: center;
}

.footer-row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-row nav { display: flex; gap: 24px; }
.footer-row nav a {
  font-size: 14px;
  color: var(--subtext);
  transition: color .2s;
}
.footer-row nav a:hover { color: var(--primary); }

.footer-meta {
  max-width: var(--max);
  margin: 24px auto 0;
  font-size: 12px;
  color: var(--subtext);
  line-height: 1.7;
}
.footer-meta a {
  color: var(--accent);
  transition: opacity .2s;
}
.footer-meta a:hover { opacity: 0.75; }

@media (max-width: 540px) {
  .footer-row { flex-direction: column; }
}

/* ---------- Mobile tightening ---------- */

@media (max-width: 540px) {
  .hero { padding: 56px 20px 40px; }
  .hero h1 { font-size: clamp(36px, 9vw, 48px); max-width: 100%; }
  .hero .lede { font-size: 16px; }

  .block, .features, .cta, .testimonials, .demo {
    padding-left: 20px;
    padding-right: 20px;
  }
  .block, .features, .cta, .testimonials { padding-top: 48px; padding-bottom: 48px; }
  .cta { padding-bottom: 72px; }
  .block.alt { padding-left: 20px; padding-right: 20px; }

  .block h2, .features h2, .cta h2, .testimonials h2, .demo h2 {
    font-size: clamp(24px, 7vw, 32px);
    max-width: 100%;
  }

  .features li { padding: 14px 16px; }
  .features li strong { font-size: 15px; }

  .testimonial { padding: 22px 20px; }
  .testimonial blockquote { font-size: 16px; padding-left: 20px; }
  .testimonial figcaption { padding-left: 20px; }
  .testimonial::before { font-size: 44px; left: 18px; }

  blockquote { padding: 16px 18px; }

  .nav { padding: 18px 20px; }
}

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

.legal-page {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--primary);
  background: var(--bg);
}

.legal-page .container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 24px 80px;
}

.legal-page .eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 28px 0 12px;
}

.legal-page h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.legal-page .effective {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: 40px;
}

.legal-page h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}

.legal-page p {
  margin: 0 0 16px;
  color: var(--primary);
}

.legal-page ul {
  padding-left: 22px;
  margin: 0 0 16px;
}

.legal-page li {
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  transition: border-color .2s, opacity .2s;
}
.legal-page a:hover {
  border-bottom-color: var(--accent);
  opacity: 0.85;
}

.legal-page hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--subtext) 20%, transparent);
  margin: 48px 0;
}

.legal-page .legal-footer {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--subtext);
  margin-top: 56px;
}

.legal-page .legal-footer a {
  color: var(--subtext);
  border: 0;
}
.legal-page .legal-footer a:hover { color: var(--primary); }

/* FAQ-style blocks used on the support page */
.legal-page .faq {
  margin-top: 28px;
}
.legal-page .faq + .faq { margin-top: 24px; }
.legal-page .faq-q {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.legal-page .faq-a {
  color: var(--primary);
}

.legal-page .contact-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 32px 0;
  font-family: var(--sans);
}
.legal-page .contact-box p { color: var(--primary); margin: 6px 0; font-size: 16px; }
.legal-page .contact-box a { font-weight: 600; }

/* ---------- Mobile install banner ---------- */

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--subtext) 22%, transparent);
  border-radius: 18px;
  box-shadow: 0 14px 32px -16px rgba(28, 19, 16, 0.35);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .25s ease, transform .25s ease;
}
.install-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .install-banner { display: flex; }
  /* Push the page footer up a hair so it isn't masked by the floating banner */
  body { padding-bottom: 96px; }
}

.install-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.install-banner-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.install-banner-copy strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.install-banner-copy span {
  font-size: 12px;
  color: var(--subtext);
}

.install-banner-cta {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.install-banner-cta:active { opacity: 0.85; }

.install-banner-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--subtext);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  margin: -4px -2px -4px 0;
  cursor: pointer;
}
.install-banner-close:active { opacity: 0.6; }
