:root {
  /* Cubby palette */
  --bg: #dfdfdf;
  --ink: #1c1c1e;
  --muted: #8e8e93;
  --line: #cfcfcf;
  --orange: #e5390c;
  --card: #ffffff;

  --display-font: "Geologica", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --body-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  /* Phone frame aspect (matches Shnayim's iPhone frame) */
  --frame-w: 1794.58;
  --frame-h: 3673.11;
}

@font-face {
  font-family: "Geologica";
  src: url("/assets/fonts/Geologica-VariableFont.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0; padding: 0;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(32px, 6vw, 64px) 24px 24px;
  gap: clamp(20px, 3.5vw, 36px);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  max-width: 720px;
}

.hero h1 {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 3.1rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.tagline {
  margin: 8px 0 0;
  font-family: var(--display-font);
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.blurb {
  margin: 16px auto 0;
  max-width: 30rem;
  font-family: var(--body-font);
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- App Store CTA ---------- */
.cta {
  display: flex;
  justify-content: center;
}

.appstore {
  display: inline-block;
  height: 52px;
  transition: transform 150ms ease;
}

.appstore img { height: 100%; width: auto; display: block; }

/* ---------- Device + slideshow ---------- */
.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: clamp(14px, 2.4vw, 22px);
}

.phone {
  display: block;
  aspect-ratio: var(--frame-w) / var(--frame-h);
  height: min(78svh, 820px);
  width: auto;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  filter:
    drop-shadow(0 10px 14px rgba(0, 0, 0, 0.14))
    drop-shadow(0 26px 28px rgba(0, 0, 0, 0.07));
  transform: translateZ(0);
}

.phone.is-shaking {
  animation: phone-shake 800ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes phone-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-0.25deg); }
  20%, 80% { transform: translate3d(1.5px, 0, 0) rotate(0.4deg); }
  30%, 50%, 70% { transform: translate3d(-2.5px, 0, 0) rotate(-0.55deg); }
  40%, 60% { transform: translate3d(2.5px, 0, 0) rotate(0.55deg); }
}

.phone #screen-images > g {
  opacity: 0;
  transition: opacity 800ms ease;
}
.phone #screen-images > g.is-active { opacity: 1; }

/* Rotating feature caption + compartment dots (dormant until screenshots exist) */
.caption-deck {
  position: relative;
  width: 100%;
  max-width: 30ch;
  display: grid;
  grid-template-areas: "stack";
  text-align: center;
}
.caption-deck:empty, .dots:empty { display: none; }

.caption {
  grid-area: stack;
  margin: 0;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}
.caption.is-active { opacity: 1; transform: none; }

.dots {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.dot {
  width: 16px; height: 16px;
  padding: 0; border: 0;
  border-radius: 5px;
  background: var(--line);
  cursor: pointer;
  transition: background 250ms ease, transform 250ms ease;
  -webkit-tap-highlight-color: transparent;
}
.dot:hover { transform: translateY(-1px); }
.dot.is-active { background: var(--orange); }

/* ---------- Reviews ---------- */
.reviews {
  width: 100%;
  max-width: 640px;
  margin: clamp(32px, 6vw, 64px) auto 0;
  padding: 0 16px;
}

.reviews__list {
  display: grid;
  grid-template-areas: "stack";
  list-style: none;
  margin: 0; padding: 0;
}

.review {
  grid-area: stack;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 8px 12px;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}
.review.is-active { opacity: 1; pointer-events: auto; }

.review__stars { color: var(--orange); letter-spacing: 3px; font-size: 1rem; line-height: 1; }
.review__title { margin: 0; font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.review__content {
  margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.6; max-width: 540px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  padding-bottom: 0.15em;
}
.review__meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- FAQ ---------- */
.faq {
  width: 100%;
  max-width: 640px;
  margin: clamp(32px, 6vw, 56px) auto 0;
  padding: 0 16px;
  text-align: left;
}

.faq h2 {
  margin: 0 0 clamp(16px, 3vw, 24px);
  font-family: var(--display-font);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink);
}

.faq__list { margin: 0; padding: 0; }

.faq__item {
  padding: clamp(14px, 2.4vw, 18px) 0;
  border-top: 1px solid var(--line);
}
.faq__item:last-child { border-bottom: 1px solid var(--line); }

.faq__item dt {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.faq__item dd {
  margin: 8px 0 0;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Footer (plain block flow, wraps naturally) ---------- */
footer {
  padding-top: 16px;
  width: 100%;
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 13px;
  text-align: center;
}

footer p { margin: 6px 0 0; }

footer a { color: inherit; font-weight: 600; text-decoration: none; }
footer a:hover { text-decoration: none; }

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.footer-social svg { display: block; width: auto; fill: currentColor; }
/* Official brand marks have different proportions; size each to match visually. */
.footer-x svg { width: 18px; }
.footer-ig svg { height: 18px; }
.footer-mail svg { height: 16px; }

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

/* ---------- Legal pages (Terms, Privacy) ---------- */
.legal {
  display: block;
  min-height: 100svh;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) 24px 40px;
}

.legal-head {
  text-align: center;
  max-width: none;
  margin-bottom: clamp(28px, 5vw, 44px);
}

.legal-head h1 {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.legal-body {
  width: 100%;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  text-align: left;
}

.legal-body .legal-meta {
  margin: 0 0 1.5em;
  color: var(--ink);
}

.legal-body h2 {
  margin: 2em 0 0.5em;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.legal-body p { margin: 0 0 1em; }

.legal-body ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}
.legal-body li { margin: 0.35em 0; }

.legal-body a { color: var(--orange); font-weight: 600; text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }

.legal footer {
  margin-top: clamp(40px, 7vw, 72px);
}

/* ---------- Desktop: 2-column, Shnayim sizing ---------- */
@media (min-width: 960px) {
  main {
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(360px, 560px);
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "hero device"
      "cta device"
      "reviews device"
      "spacer device"
      "footer footer";
    justify-content: center;
    align-items: start;
    column-gap: 24px;
    row-gap: 22px;
    padding: clamp(48px, 7svh, 76px) clamp(32px, 6vw, 88px) 24px;
  }

  .hero { grid-area: hero; justify-self: center; text-align: center; padding-top: 4px; margin-top: clamp(16px, 4.5svh, 48px); }
  .hero h1 { font-size: 3.1rem; }
  .tagline { font-size: 0.92rem; line-height: 1.4; }
  .cta { grid-area: cta; justify-content: center; width: 100%; }
  .device { grid-area: device; justify-self: start; align-self: start; }
  .phone { height: min(74svh, 760px); max-height: calc(100svh - 152px); }
  .reviews { grid-area: reviews; justify-self: center; margin: 18px 0 0; padding: 0; max-width: 560px; }
  .review { align-items: center; text-align: center; padding: 8px 0; }
  footer { grid-area: footer; justify-self: center; width: 100%; padding-top: 20px; }
}

/* ---------- Small phones, Shnayim sizing ---------- */
@media (max-width: 600px) {
  .phone { width: min(88vw, 390px); height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .phone.is-shaking { animation: none; }
  .phone #screen-images > g,
  .caption, .review, .dot, .appstore { transition: none; }
  .caption { transform: none; }
}
