/* ===========================================================================
   MassAi landing page styles
   Brand tokens mirror mobile/lib/theme-palettes.ts (dark palette) + app.json.
   =========================================================================== */

:root {
  /* Light palette (the app's own lightColors from theme-palettes.ts). */
  --bg-primary: #f5f7fb;
  --bg-secondary: #eef1f8;
  --bg-card: #ffffff;
  --bg-elevated: #eef2f9;
  --glass: rgba(16, 24, 48, 0.04);
  --glass-border: rgba(16, 24, 48, 0.1);
  --glass-hover: rgba(16, 24, 48, 0.07);
  --text-primary: #101830;
  --text-secondary: #3e4963;
  --text-muted: #5f6c87;
  --accent: #059669;
  --accent-2: #2563eb;
  --accent-warn: #d97706;
  --purple: #7c3aed;
  --accent-glow: rgba(5, 150, 105, 0.18);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --maxw: 1120px;
  --maxw-narrow: 680px;
  --pad: 24px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

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

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04231a;
  padding: 10px 16px;
  z-index: 100;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
}

/* ----------------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.container--narrow {
  max-width: var(--maxw-narrow);
}

.section {
  padding: 96px 0;
}
.section--alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  text-align: center;
}
.section__lead {
  text-align: center;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 16px auto 0;
  font-size: 1.05rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}

.accent {
  color: var(--accent);
}

/* ----------------------------------------------------------------- brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 1.5rem;
}
.brand__logo {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 9px;
  box-shadow: 0 0 16px var(--accent-glow);
}
.brand__name {
  letter-spacing: -0.02em;
}
.brand__ai {
  color: var(--accent);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #04231a;
  font-weight: 650;
  font-size: 1rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: 13px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--accent-glow);
}
.btn:active {
  transform: translateY(0);
}
.btn--sm {
  padding: 9px 16px;
  font-size: 0.92rem;
}
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn--ghost:hover {
  background: var(--glass-hover);
  box-shadow: none;
}

/* ----------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 247, 251, 0.8);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 8px;
}
.nav__links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav__links a:hover {
  color: var(--text-primary);
}

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: 80px 0 96px;
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  top: -160px;
  right: -120px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, var(--accent-glow), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero__title {
  font-size: clamp(1.75rem, 6.4vw, 3.6rem);
  font-weight: 750;
  overflow-wrap: break-word;
}
.hero__sub {
  color: var(--text-secondary);
  font-size: 1.12rem;
  margin-top: 22px;
  max-width: 520px;
}
.hero__note {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ----------------------------------------------------------------- signup */
.signup {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
  position: relative;
}
.signup--center {
  justify-content: center;
}
.signup__input {
  flex: 1 1 240px;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
}
.signup__input::placeholder {
  color: var(--text-muted);
}
.signup__input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.signup__btn {
  flex: 0 0 auto;
}
.signup__msg {
  flex-basis: 100%;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 4px;
  color: var(--text-muted);
}
.signup__msg.is-error {
  color: #dc2626;
}
.signup__msg.is-success {
  color: var(--accent);
}

/* ------------------------------------------------------- App Store download */
.hero__cta {
  margin-top: 24px;
}
.cta__actions {
  display: flex;
  justify-content: center;
  margin: 6px 0 16px;
}
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  background: #000;
  color: #fff;
  border-radius: 13px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.appstore-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(16, 24, 48, 0.28);
}
.appstore-badge[aria-disabled='true'] {
  cursor: default;
}
.appstore-badge[aria-disabled='true']:hover {
  transform: none;
  box-shadow: none;
}
.appstore-badge__apple {
  width: 26px;
  height: 28px;
  flex-shrink: 0;
}
.appstore-badge__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}
.appstore-badge__small {
  font-size: 0.72rem;
  font-weight: 500;
}
.appstore-badge__big {
  font-size: 1.26rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ----------------------------------------------------------------- features */
.grid {
  display: grid;
  gap: 20px;
}
.grid--features {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 48px;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: rgba(5, 150, 105, 0.4);
}
.feature__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: var(--radius-md);
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.18);
  margin-bottom: 16px;
}
.feature__icon svg {
  width: 24px;
  height: 24px;
}
.feature h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.feature p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* ----------------------------------------------------------------- showcase */
.showcase {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.showcase__phone {
  justify-self: center;
}
.showcase__cards {
  display: grid;
  gap: 16px;
}
.showcase__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin-bottom: 2px;
}
.showcase__lead {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.showcase__card {
  /* all cards stay open; the selected one scales up and selects its phone screen */
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--bg-card);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  transition: transform 0.2s ease, border-color 0.18s ease, background 0.18s ease,
    box-shadow 0.2s ease;
}
.showcase__card:hover {
  border-color: rgba(5, 150, 105, 0.35);
}
.showcase__card.is-active {
  transform: scale(1.04);
  border-color: var(--accent);
  background: rgba(5, 150, 105, 0.05);
  box-shadow: 0 16px 38px rgba(5, 150, 105, 0.18);
}
.showcase__card h3 {
  font-size: 1.12rem;
  margin: 0;
}
.showcase__card p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* shared phone mockup: realistic iPhone (titanium rail, side buttons, island) */
.shot__frame {
  position: relative;
  /* explicit width so the screen's aspect-ratio has a basis even though its
     only children (the cross-fading slides) are absolutely positioned */
  width: 345px;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  border-radius: 56px;
  /* lighter at the corners → reads as a brushed titanium edge */
  background: linear-gradient(145deg, #3a3d44 0%, #0c0e13 16%, #0c0e13 84%, #3a3d44 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.18),
    0 40px 80px rgba(16, 24, 48, 0.28), 0 6px 16px rgba(16, 24, 48, 0.18);
}
.ip-btn {
  position: absolute;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #2c2f37, #4a4e57);
}
.ip-btn--mute {
  left: -2px;
  top: 17%;
  height: 4.2%;
}
.ip-btn--up {
  left: -2px;
  top: 24%;
  height: 7.5%;
}
.ip-btn--down {
  left: -2px;
  top: 33.5%;
  height: 7.5%;
}
.ip-btn--power {
  right: -2px;
  top: 27%;
  height: 11%;
  background: linear-gradient(90deg, #4a4e57, #2c2f37);
}
.shot__screen {
  position: relative;
  border-radius: 44px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  background: #0a0e1a;
  box-shadow: inset 0 0 0 2px #000;
}
.shot__island {
  position: absolute;
  /* relative units so the island stays aligned to the screenshot at any frame size */
  top: 1.9%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 3.5%;
  background: #000;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
}
.shot__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.shot__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.shot__img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shot__slide.is-loaded .shot__img {
  display: block;
}
.shot__slide.is-loaded .shot__ph {
  display: none;
}
.shot__ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 16px;
  color: #6b7385;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}
.shot__ph span {
  font-size: 0.76rem;
  font-weight: 400;
  opacity: 0.8;
}

/* hero variant of the iPhone frame: original headline-shot size (unchanged) */
.hero__device {
  width: 310px;
}

/* ----------------------------------------------------------------- steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 52px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.step {
  position: relative;
  padding: 0 18px;
  text-align: center;
}
/* connector line linking the numbered nodes into one flow */
.step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 27px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.16), rgba(5, 150, 105, 0.5));
  z-index: 0;
}
.step__num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 10px 22px rgba(5, 150, 105, 0.28);
}
.step h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
}
.step p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  max-width: 26ch;
  margin-inline: auto;
}
/* the loop is the whole point: a closing caption that ties the steps together */
.steps__loop {
  margin: 44px auto 0;
  max-width: 32rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
}
.steps__loop svg {
  display: inline-block;
  vertical-align: -0.32em;
  margin-right: 8px;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* ----------------------------------------------------------------- faq */
.faq {
  border-bottom: 1px solid var(--glass-border);
  padding: 4px 0;
}
.faq:first-of-type {
  border-top: 1px solid var(--glass-border);
  margin-top: 40px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  font-weight: 600;
  font-size: 1.05rem;
  position: relative;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.faq p {
  color: var(--text-secondary);
  padding: 0 40px 20px 0;
  font-size: 0.98rem;
}

/* ----------------------------------------------------------------- cta */
.cta {
  position: relative;
  padding: 110px 0;
  text-align: center;
  overflow: hidden;
}
.cta__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, var(--accent-glow), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.cta__inner {
  position: relative;
  z-index: 1;
}
.cta__title {
  font-size: clamp(2rem, 4.5vw, 3rem);
}
.cta__sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 16px auto 0;
  max-width: 520px;
}
.cta .signup {
  margin-top: 32px;
}
.cta__note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 16px;
}

/* ----------------------------------------------------------------- legal pages */
.legal {
  padding: 64px 0 96px;
}
.legal__title {
  font-size: clamp(2rem, 5vw, 2.75rem);
}
.legal__updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 10px;
}
.legal__scope {
  margin-top: 32px;
  padding: 22px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}
.legal__scope h2 {
  font-size: 1.05rem;
}
.legal__scope h3 {
  font-size: 0.95rem;
  margin-top: 18px;
  color: var(--text-primary);
}
.legal__scope p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
  line-height: 1.65;
}
.legal__scope p:first-of-type {
  margin-top: 10px;
}
.legal__prose {
  margin-top: 48px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}
.legal__prose > p {
  margin-top: 14px;
  line-height: 1.75;
}
.legal__prose h2 {
  font-size: 1.22rem;
  color: var(--text-primary);
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--glass-border);
}
.legal__prose ul {
  margin: 14px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.legal__prose li {
  line-height: 1.65;
}
.legal__prose a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ----------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  padding: 56px 0 48px;
}
.footer__inner {
  display: grid;
  gap: 22px;
  text-align: center;
  justify-items: center;
}
.footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.55rem;
  font-weight: 700;
}
.footer__brand .brand__logo {
  width: 46px;
  height: 46px;
  border-radius: 11px;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.footer__links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.footer__links a:hover {
  color: var(--text-primary);
}
.footer__disclaimer {
  color: var(--text-muted);
  font-size: 0.82rem;
  max-width: 640px;
  line-height: 1.7;
}
.footer__copy {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ----------------------------------------------------------------- responsive */
@media (max-width: 920px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .hero__sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__note {
    justify-content: center;
  }
  .grid--features,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    gap: 44px 24px;
  }
  .step:not(:first-child)::before {
    display: none;
  }
  .showcase {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  /* mobile showcase: a smaller phone on top, compact tap-list right beneath it,
     so picking a feature updates the phone within the same glance */
  .showcase__phone {
    order: -1;
  }
  .showcase__phone .shot__frame {
    width: 210px;
  }
  .showcase__title,
  .showcase__lead {
    text-align: center;
  }
  .showcase__cards {
    gap: 10px;
  }
  .showcase__card {
    padding: 13px 18px;
  }
  .showcase__card p {
    display: none;
  }
  .showcase__card.is-active {
    transform: none;
  }
}

@media (max-width: 620px) {
  .section {
    padding: 64px 0;
  }
  .legal {
    padding: 40px 0 64px;
  }
  .nav__links {
    display: none;
  }
  .grid--features,
  .steps {
    grid-template-columns: 1fr;
  }
  .showcase__card.is-active {
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}
