/* ============ Foundinity — design system ============ */
:root {
  --bg: #fdfcf8;
  --ink: #1b1913;
  --muted: #7d7765;
  --soft: #a39d88;
  --cream: #f4efe2;
  --cream-2: #f7f2e6;
  --line: #e9e2d0;
  --accent: #ec8f3f;
  --accent-deep: #e2a05c;
  --font-serif: "Crimson Pro", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --section-pad: clamp(72px, 7vw, 110px);
  --title-gap: clamp(40px, 4.5vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

.container {
  width: min(1240px, 92vw);
  margin-inline: auto;
}

section { padding: var(--section-pad) 0; }

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

/* ============ Typography — anchored to Figma 1920 scale ============ */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 48px @1920 */
.section-title {
  font-size: clamp(1.85rem, 2.5vw, 3rem);
  line-height: 1.12;
}

.section-title.center { text-align: center; }

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: clamp(0.95rem, 0.95vw, 1.1rem);
  margin-top: 12px;
}

/* orange marker underline */
.hl {
  position: relative;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: -3%;
  right: -7%;
  bottom: -0.12em;
  height: 0.3em;
  background: url("/Assets/brush-stroke.svg") no-repeat center / 100% 100%;
  transform: scaleX(0);
  transform-origin: left center;
  animation: hl-grow 0.7s var(--ease-out) 0.9s forwards;
  z-index: -1;
}
.features .hl::after { animation-delay: 0.2s; }
@keyframes hl-grow { to { transform: scaleX(1); } }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-dark {
  background: var(--ink);
  color: #fbf9f3;
  box-shadow: 0 10px 24px -12px rgba(27, 25, 19, 0.5);
}
.btn-dark:hover { box-shadow: 0 16px 32px -12px rgba(27, 25, 19, 0.55); }

.btn-outline {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { border-color: #d8cfb6; }

.btn-icon { flex: none; width: 20px; height: 20px; }

/* ============ Header ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transform: translateY(0);
  transition: transform 0.45s var(--ease-out), background 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.site-header.scrolled {
  background: rgba(253, 252, 248, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header.hidden { transform: translateY(-100%); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 28px; height: 28px; border-radius: 6px; }
.brand-name {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.32em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.events-btn {
  background: transparent;
  color: #2c2212;
  border: 1px solid rgba(27, 25, 19, 0.55);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 8px;
  transition: transform 0.3s var(--ease-out), background 0.3s;
}
.events-btn:hover { background: #f9cea3; transform: translateY(-1px); }
.events-btn.active { background: #f9cea3; }
.events-btn.active:hover { background: #f2b970; }
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--ink);
  color: #fbf9f3;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out);
}
.social-btn:hover { transform: translateY(-2px); }

/* ============ Hero stage: text + half-cut dashboard ============ */
.hero-stage {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hero-content {
  padding-top: clamp(96px, 16vh, 150px);
  text-align: center;
}
/* 64px @1920 */
.hero-title {
  font-size: clamp(2.4rem, 3.5vw, 4rem);
  line-height: 1.05;
  font-weight: 600;
}
.hero-title .line { display: block; }
.hero-copy {
  max-width: 560px;
  margin: clamp(20px, 3vh, 30px) auto 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 0.95vw, 1.125rem);
  line-height: 1.65;
}
/* centred by .hero-content's text-align, exactly like .events-soon */
.launch-status { margin-top: clamp(20px, 3.4vh, 30px); }
/* slightly tighter than the copy→status gap above it, so the status line binds
   to the CTA it explains rather than to the paragraph */
.hero-content .btn { margin-top: var(--cta-gap, clamp(18px, 3vh, 28px)); }

.hero-visual {
  margin-top: clamp(56px, 13vh, 130px);
}
.dash-frame {
  width: min(1240px, 92vw);
  aspect-ratio: 3760 / 2246;
  margin: 0 auto;
  border-radius: clamp(14px, 1.6vw, 24px);
  box-shadow: 0 40px 90px -30px rgba(60, 50, 25, 0.35);
  transform-origin: 50% 0;
}
.dash-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

/* pinned (JS-enhanced) state: lock stage to viewport, dashboard half-cut at fold */
.hero-stage.pinned {
  height: 100svh;
  overflow: clip;
  overflow-clip-margin: 140px;
}
/* first-paint anchor (= DASH_ANCHOR in main.js — keep in sync). placeVisual
   may lower it so the CTA sits centred between the status line and the
   dashboard; the fold cut stays proportional on every desktop size */
.hero-stage.pinned .hero-visual {
  position: absolute;
  top: 68svh;
  left: 0;
  right: 0;
  margin-top: 0;
}
.hero-stage.pinned .dash-frame {
  width: min(1240px, 92vw, calc((100svh - 64px) * 1.674));
}
/* non-pinned fallback (mobile / reduced motion / no JS): dashboard fully visible */
.hero-stage:not(.pinned) { padding-bottom: var(--section-pad); }

/* short viewports (13" laptops): reclaim room from the dead space above the
   title, not from the copy/status/CTA rhythm. Unscoped from .pinned so the
   stack doesn't jump when JS adds that class after first paint */
@media (max-height: 820px) {
  .hero-stage .hero-content { padding-top: clamp(72px, 12vh, 100px); }
}
/* 13" laptops at OS scaling (~590px viewports): trim further. The CTA gap
   itself (--cta-gap) is set by main.js */
@media (max-height: 680px) {
  .hero-stage .hero-content { padding-top: 60px; }
}

/* ============ Events page ============ */
.events-hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  text-align: center;
}
.events-hero .container { width: min(980px, 92vw); }
.events-sub {
  color: var(--muted);
  font-size: clamp(0.98rem, 0.95vw, 1.125rem);
  line-height: 1.65;
  margin-top: clamp(28px, 4vh, 44px);
}
.events-nots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 6px;
  color: var(--muted);
  font-size: clamp(0.95rem, 0.9vw, 1.08rem);
  margin-top: clamp(20px, 3vh, 32px);
}
.events-nots span + span::before {
  content: "•";
  margin-right: 14px;
  color: var(--ink);
  font-size: 0.8em;
}
/* Shared eyebrow token — all-caps status line.
   Used by the events hero ("More details soon") and the index hero
   ("Early access"). Keep these two in lockstep. */
.events-soon,
.launch-status {
  font-size: clamp(0.98rem, 0.95vw, 1.125rem);   /* matches .events-sub / .hero-copy */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink);
}
.events-soon { margin-top: clamp(44px, 7vh, 72px); }
.events-hero .btn { margin-top: clamp(36px, 6vh, 64px); }

/* ============ Features ============ */
.features .section-title { margin-bottom: clamp(28px, 3.5vh, 48px); }
.features-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.2fr;
  gap: clamp(40px, 4vw, 72px);
  align-items: center;
}
.feature { padding: clamp(14px, 2vh, 20px) 0; }
/* 24px @1920 */
.feature h3 {
  font-size: clamp(1.1rem, 1.25vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.35s ease;
}
.feature p {
  color: var(--muted);
  font-size: clamp(0.92rem, 0.85vw, 1rem);
  line-height: 1.65;
  max-width: 48ch;
  padding-top: 10px;
}
.feature-body { display: block; }
.feature-body-inner { min-height: 0; overflow: hidden; }
.feature-inline { display: none; }

.features-media { position: relative; }
.media-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 880 / 620;
  max-height: calc(100svh - 150px);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.media {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  border-radius: 16px;
  object-fit: cover;
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out);
}
.media.active {
  opacity: 1;
  transform: none;
}
.media--contain {
  object-fit: contain;
  padding: 14px;
}
.media--natural {
  object-fit: scale-down;
  padding: 14px;
}

/* stepped mode (JS-enhanced): collapsed by default, active expands */
.features.steps .feature h3 { color: var(--soft); }
.features.steps .feature.active h3 { color: var(--ink); }
.features.steps .feature-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.65s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.45s ease;
}
.features.steps .feature-body-inner > * {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) 0.08s, opacity 0.45s ease 0.08s;
}
.features.steps .feature.active .feature-body {
  grid-template-rows: 1fr;
  opacity: 1;
}
.features.steps .feature.active .feature-body-inner > * {
  transform: none;
  opacity: 1;
}

/* pinned layout (desktop) */
.features.pinned {
  height: 100svh;
  padding: 0;
  margin-top: clamp(40px, 8vh, 96px);
  display: flex;
  align-items: center;
}

/* ============ How it works ============ */
.how .section-title { margin-bottom: 0; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2vw, 28px);
  margin-top: var(--title-gap);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 26px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -25px rgba(60, 50, 25, 0.22);
}
.card .illus {
  background: var(--cream);
  border-radius: 13px;
  aspect-ratio: 4 / 2.4;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.card h3 {
  font-size: clamp(1.05rem, 1.15vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 10px 10px;
}
.card p {
  color: var(--muted);
  font-size: clamp(0.88rem, 0.82vw, 0.95rem);
  line-height: 1.62;
  margin: 0 10px;
}

/* ============ Pricing ============ */
.plans {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(24px, 2.6vw, 36px);
  max-width: 900px;
  margin: var(--title-gap) auto 0;
  align-items: stretch;
}
.plan {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(28px, 2.6vw, 36px) clamp(26px, 2.5vw, 34px);
  display: flex;
  flex-direction: column;
}
.plan.plus {
  background: var(--cream);
  border-color: #e7ddc4;
}
.plan h3 { font-size: clamp(1.25rem, 1.3vw, 1.55rem); font-weight: 600; }
.plus-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}
.toggle button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.toggle button.on { background: var(--ink); color: #fbf9f3; }
.price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}
.price { font-size: clamp(1.7rem, 1.8vw, 2.1rem); font-weight: 600; letter-spacing: -0.02em; }
.per { color: var(--muted); font-size: 0.9rem; }
.pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 6px;
}
.plan ul {
  list-style: none;
  margin: 24px 0 32px;
  display: grid;
  gap: 13px;
  flex: 1;
}
.plan li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.92rem;
  color: #4c4738;
}
.plan li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  transform: translateY(-1px);
}
.info {
  display: inline-flex;
  color: var(--soft);
  cursor: pointer;
  margin-left: 3px;
  vertical-align: -3.5px;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  position: relative;
  transition: color 0.18s ease;
}
/* widen the tap target to ~35px without touching the 17px box */
.info::after { content: ""; position: absolute; inset: -9px; }
.info svg { width: 17px; height: 17px; }
.info:hover,
.info[aria-expanded="true"] { color: var(--ink); }
.info:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 50%; }

/* ---- info popovers (top layer, JS-positioned) ---- */
.pop {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 13px 15px;
  background: var(--ink);
  color: #ece7da;
  border: 0;
  border-radius: 13px;
  font-size: 0.83rem;
  line-height: 1.55;
  box-shadow: 0 16px 38px -14px rgba(27, 25, 19, 0.45);
  overflow: visible;
}
.pop-arrow {
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
}
.pop.flip .pop-arrow { top: auto; bottom: -4px; }
@media (prefers-reduced-motion: no-preference) {
  .pop {
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.16s var(--ease-out), transform 0.16s var(--ease-out),
                overlay 0.16s allow-discrete, display 0.16s allow-discrete;
  }
  .pop.flip { transform: translateY(5px); }
  .pop:popover-open { opacity: 1; transform: translateY(0); }
  @starting-style {
    .pop:popover-open { opacity: 0; transform: translateY(-5px); }
    .pop.flip:popover-open { opacity: 0; transform: translateY(5px); }
  }
}
.plan .btn { justify-content: center; width: 100%; }

/* ============ Use it anywhere ============ */
.anywhere { text-align: center; }
.device-tabs {
  display: flex;
  justify-content: center;
  gap: clamp(40px, 4.5vw, 64px);
  margin: var(--title-gap) 0 36px;
  font-size: clamp(0.95rem, 0.9vw, 1.05rem);
  color: var(--muted);
}
.device-tabs span { font-weight: 600; color: var(--ink); }
.devices-img {
  width: min(920px, 92vw);
  height: auto;
  margin: var(--title-gap) auto 0;
  display: block;
}

/* ============ FAQ ============ */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(48px, 5.5vw, 80px);
  align-items: start;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.faq-item.open { border-color: #ddd2b8; }
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: none;
  border: 0;
  padding: 18px 22px;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.faq-q svg {
  flex: none;
  color: var(--muted);
  transition: transform 0.4s var(--ease-out);
}
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out);
}
.faq-a p {
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.66;
  max-width: 62ch;
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 5vw, 64px) 0 0;
}
.footer-main {
  display: flex;
  justify-content: space-between;
  gap: clamp(32px, 5vw, 80px);
  flex-wrap: wrap;
  padding-bottom: clamp(32px, 4vw, 48px);
}
.footer-brand { display: flex; align-items: flex-start; }
.footer-cols {
  display: flex;
  gap: clamp(40px, 6vw, 96px);
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.25s;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-note { color: var(--soft); font-size: 0.88rem; }
.site-footer .social-btn { width: 32px; height: 32px; }

/* ============ Legal pages ============ */
.legal-page {
  min-height: calc(100svh - 240px);
  padding-top: clamp(140px, 20vh, 200px);
}
.legal-note {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 20px;
}

/* Legal prose. Constrained to a readable measure rather than the full
   1240px container, which would run past a comfortable line length. */
.legal-body {
  max-width: 42rem;
  margin-inline: auto;
  padding-bottom: clamp(60px, 8vh, 100px);
}
.legal-effective {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 14px;
}
.legal-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.4vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  margin-top: clamp(34px, 4vh, 46px);
}
.legal-body p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
  margin-top: 14px;
}
.legal-body ul {
  margin-top: 14px;
  padding-left: 22px;
}
.legal-body li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
  margin-top: 8px;
}
.legal-body li::marker { color: var(--soft); }
.legal-body strong {
  color: var(--ink);
  font-weight: 600;
}
.legal-body code {
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--cream);
  color: var(--ink);
}
.legal-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
}
.legal-body a:hover { color: var(--accent); }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .features-grid { grid-template-columns: 1fr; gap: 0; align-items: start; }
  .features-media { display: none; }
  .feature { padding: 26px 0; }
  .feature-inline {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 360px;
    height: auto;
    margin: 20px auto 0;
    border-radius: 12px;
  }
  .faq-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 760px) {
  .hero-stage .hero-content { padding-top: 120px; }
  .cards { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .device-tabs { gap: 30px; }
  .brand-name { letter-spacing: 0.22em; font-size: 0.8rem; }
  .events-btn { padding: 7px 14px; }
  .footer-main { flex-direction: column; }
  .footer-cols { gap: 36px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .hl::after { animation: none; transform: scaleX(1); }
  * { transition-duration: 0.01ms !important; }
}
