/* ── Reusable components ──────────────────────────────────────────────── */

/* ── Sticky nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.25s ease, backdrop-filter 0.25s ease;
}
.nav--scrolled {
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: var(--nav-h);
}
.nav-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; flex: none; }
/* Fluid lockup: 32px on phones (≤ ~438), full 38px from ~521 up — scales in
   step with --nav-h instead of snapping at a breakpoint. Footer matches. */
.nav-brand .logo-lockup, .footer-brand .logo-lockup { height: clamp(32px, 7.3vw, 38px); width: auto; display: block; }
.nav-brand .wordmark { font-size: var(--text-3); font-weight: 400; letter-spacing: 0.01em; color: var(--text-primary); }

.nav-right { display: flex; align-items: center; gap: var(--space-4); flex: none; }
/* All CTAs (nav, hero, closing) now share the one .btn-pill sizing. */
/* CTA handoff — the nav pill stays hidden until the hero's own "Get started"
   scrolls up under the header (ui.js toggles .cta-in on .nav), then it settles
   into place. Reverses on the way back up, so the two are never on screen at
   once. */
.nav-right .btn-pill {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav.cta-in .btn-pill {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .nav-right .btn-pill { transform: none; transition: opacity 0.2s ease; }
}
/* ── Primary pill button (carried from the current site) ── */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-5);
  background: var(--foreground);
  color: var(--app-background);
  font-family: var(--font-mono);
  font-size: var(--text-1);
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: background-color 0.15s ease-out, box-shadow 0.15s ease-out,
              transform 0.15s ease-out, opacity 0.15s ease-out;
}
@media (hover: hover) {
  .btn-pill:hover { background: oklch(0.98 0 0 / 0.9); box-shadow: var(--shadow-md); }
}
.btn-pill:active { transform: scale(0.98); }
.btn-pill:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--overlay-20); }

/* App arrow animation — one arrow slides out, its twin slides in */
.arrow-swap {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.arrow-swap svg {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.arrow-swap svg:last-child { transform: translateX(-20px); }
@media (hover: hover) {
  .btn-pill:hover .arrow-swap svg:first-child { transform: translateX(20px); }
  .btn-pill:hover .arrow-swap svg:last-child { transform: translateX(0); }
}

/* ── Card ── */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface-1);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
  a.card:hover, .card.interactive:hover {
    transform: translateY(-3px);
    background: var(--surface-2);
    box-shadow: var(--shadow-md);
  }
}
.card h3 { font-size: var(--text-3); font-weight: 500; color: var(--text-primary); letter-spacing: -0.012em; }
.card p  { font-size: var(--text-2); line-height: 1.5; color: var(--text-secondary); }

/* ── Avatars — the app's monogram style: a solid, stable per-person colour
   disc with a single white initial (no gradients, no mono). Colour set
   inline via --a from the app's member-colour palette. ── */
.avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
  background: var(--a, oklch(0.6 0.14 240));
  user-select: none;
}

/* Maker attribution row on gallery cards */
.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
  font-size: var(--text-1);
}
.card-meta .avatar { width: 24px; height: 24px; font-size: 10px; object-fit: cover; }
.card-by { color: var(--text-muted); }
.card-by b { font-weight: 500; color: var(--text-primary); }

/* ── Media placeholder — a soft product frame that reserves its box so real
   screenshots drop in with zero layout shift. A gentle top screen-glow +
   fine dot grid (the dot-field motif) reads as an app preview, not an empty
   box. Swapping in a screenshot later just replaces the background. */
.media {
  position: relative;
  width: 100%;
  border-radius: var(--radius-card);
  background-color: var(--app-background);
  background-image:
    radial-gradient(140% 90% at 50% -10%, var(--overlay-10), transparent 55%),
    radial-gradient(var(--overlay-10) 1px, transparent 1.3px);
  background-size: auto, 20px 20px;
  overflow: hidden;
}
/* Portrait frame used by the gallery cards (see .gallery-card .media). */
.media.ar-portrait { aspect-ratio: 4 / 5; }
/* Real cover photo dropped in via inline background-image */
.media.photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── FAQ accordion (native <details>) ── */
#faq .section-head { margin-bottom: calc(clamp(var(--space-8), 3vw, var(--space-12)) + 8px); }
.accordion { max-width: var(--container-narrow); margin-inline: auto; }
.faq {
  border-top: 1px solid var(--overlay-5);
  transition: border-color 0.35s ease;
}
.faq:first-child { border-top: none; }
.faq:last-child { border-bottom: 1px solid var(--overlay-5); }
.faq > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-1);
  font-size: var(--fs-reading);
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  /* Questions are written to fit one line on phones; don't soft-wrap mid-phrase. */
  white-space: nowrap;
}
/* --fs-reading is fluid, so the question size eases down to --text-3 on phones
   by itself; only the row gap needs tightening here. */
@media (max-width: 640px) {
  .faq > summary { gap: var(--space-4); }
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary:hover { color: var(--text-primary); }
.faq.is-open > summary { color: var(--text-primary); }

/* Plus → minus: vertical bar soft-scales out; bar color lifts on open/hover */
.faq > summary .plus {
  flex: none;
  width: 18px;
  height: 18px;
  position: relative;
  border-radius: 50%;
  transition: background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq > summary .plus::before,
.faq > summary .plus::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  border-radius: 1px;
  background: var(--text-muted);
  transform-origin: center;
  transition: background 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq > summary .plus::after {
  transform: rotate(90deg);
}
.faq[open] > summary .plus::after,
.faq.is-open > summary .plus::after {
  transform: rotate(90deg) scaleY(0);
  opacity: 0;
}
.js .faq:not(.is-open) > summary .plus::after {
  transform: rotate(90deg) scaleY(1);
  opacity: 1;
}
.js .faq.is-open > summary .plus::after {
  transform: rotate(90deg) scaleY(0);
  opacity: 0;
}
.faq > summary:hover .plus::before,
.faq > summary:hover .plus::after,
.faq.is-open > summary .plus::before,
.faq.is-open > summary .plus::after {
  background: var(--text-primary);
}
.faq > summary:hover .plus {
  background-color: var(--overlay-7);
  transform: scale(1.06);
}
.faq.is-open > summary .plus {
  background-color: var(--overlay-10);
  transform: scale(1);
}

.faq-body {
  overflow: hidden;
  color: var(--text-muted);
  /* Same reading size as .handled-item p (capabilities) — midpoint of the
     former FAQ (~20.75) and capabilities (16) sizes. */
  font-size: var(--text-3);
  line-height: 1.55;
  padding: 0 var(--space-1);
  /* will-change only while animating is set in JS; keep paint cheap at rest */
}
.faq-body-inner {
  padding-bottom: var(--space-5);
  max-width: 640px;
}

/* Content reveal rides along with height (JS toggles .is-open).
   Open: soft rise + fade. Close: quicker fade so it doesn't linger.
   GPU-friendly only (opacity + transform) — no blur/filters. */
.js .faq .faq-body {
  height: 0;
}
.js .faq .faq-body-inner {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .faq.is-open .faq-body-inner {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.06s, 0.04s;
}
.js .faq:not(.is-open) .faq-body-inner {
  transition-duration: 0.16s, 0.2s;
  transition-delay: 0s, 0s;
}

@media (prefers-reduced-motion: reduce) {
  .js .faq .faq-body-inner {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .faq > summary,
  .faq > summary .plus,
  .faq > summary .plus::before,
  .faq > summary .plus::after {
    transition: none;
  }
}
