/* ============================================================
   components.css - Reusable UI building blocks
   ------------------------------------------------------------
   Goal: define each reusable element ONCE as a class. The HTML
   only composes these classes - no block re-styles them and no
   raw values are hardcoded (everything is a var(--…) token).

   Contains: buttons + button row, full-width strip, fine print,
   the status pill, the feature card, the industry card (incl.
   its slideshow layers, shared by hover and touch via the
   JS-toggled .is-playing class), the FAQ accordion item, the
   live transcript popover, the mobile-nav hamburger button, and
   the cookie consent banner (dormant).

   Each component is self-contained: its own responsive and
   reduced-motion rules sit next to the component, so it can be
   reused without hunting down media queries elsewhere. Authored
   MOBILE-FIRST (base = phone; min-width enhances; breakpoint
   scale documented in tokens.css).

   Depends on: tokens.css (loads after base.css, before sections.css).
   ============================================================ */

/* ─── buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: var(--radius-md);
  font-family: inherit; font-weight: 600; font-size: 16px; line-height: 20px;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out),
              transform 150ms var(--ease-out);
}
/* Primary - white-on-Rausch gradient */
.btn-coral {
  background: var(--gradient-rausch);
  color: #fff; border: none;
}
.btn-coral:hover {
  background: var(--gradient-rausch-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-coral:active { background: var(--color-rausch-deep); }
/* Secondary - outline */
.btn-outline {
  background: transparent; color: var(--color-ink);
  border: 1px solid var(--color-ink);
}
.btn-outline:hover { background: var(--color-bg-secondary); }
.btn-outline:active { background: var(--color-bg-tertiary); }
.btn-lg { padding: 16px 28px; font-size: 16px; }

.cta-row { display: inline-flex; gap: 12px; flex-wrap: wrap; }

/* ─── full-width strip ─── */
.strip { width: 100%; }
.strip-soft { background: var(--color-bg-secondary); }

/* ─── brand logo image - used in the nav anchor and the footer.
   Height comes from --logo-height; width follows the image's aspect ratio. ─── */
.logo-img {
  height: var(--logo-height);
  width: auto;
  display: block;
}

/* ─── brand wordmark - the "Answerlux" text in the logo lockup, beside the
   mark. Reuses the hero-H1 type (Cereal, 800, -0.02em) and its two-tone
   treatment: the base is ink ("Answer"), the <em> ("lux") is Rausch - the
   same black + pink pairing as "Meet Maya". ─── */
.logo-word {
  font-family: var(--font-cereal);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: var(--logo-word-size);
  line-height: 1;
  color: var(--color-ink);
}
.logo-word em { color: var(--color-rausch); font-style: normal; font-weight: 800; }

/* ─── fine print ─── */
.fine { color: var(--color-ink-secondary); font-size: 14px; line-height: 18px; }

/* ─── status pill - dark waveform pill (the voice-demo trigger).
   Rendered as a <button>, so the button defaults are reset here: no border,
   pointer cursor, inherited font. Sits below the portrait, in normal flow. ─── */
.hero-status-pill {
  margin-top: 32px;
  background: var(--color-ink);
  color: #fff;
  font-family: var(--font-cereal);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.01em;
  padding: 16px 28px;
  border: none;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
.hero-status-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-status-pill:disabled { cursor: default; opacity: 0.75; transform: none; box-shadow: var(--shadow-md); }

/* the 6 animated bars on the left of the pill - a continuous "voice" indicator */
.hero-status-bars {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px;
}
.hero-status-bars span {
  display: block; width: 4px;
  background: var(--color-rausch);
  border-radius: 3px;
  transform-origin: center;
  animation: heroBars 1.1s ease-in-out infinite;
}
.hero-status-bars span:nth-child(1) { animation-delay: 0s;    height: 30%; }
.hero-status-bars span:nth-child(2) { animation-delay: 0.12s; height: 65%; }
.hero-status-bars span:nth-child(3) { animation-delay: 0.24s; height: 95%; }
.hero-status-bars span:nth-child(4) { animation-delay: 0.36s; height: 70%; }
.hero-status-bars span:nth-child(5) { animation-delay: 0.48s; height: 45%; }
.hero-status-bars span:nth-child(6) { animation-delay: 0.60s; height: 25%; }
@keyframes heroBars {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1.2); }
}
/* The waveform loops forever - stop it for visitors who ask for reduced
   motion (it is purely decorative; the pill stays fully usable). */
@media (prefers-reduced-motion: reduce) {
  .hero-status-bars span { animation: none; }
}

/* ─── feature card ───
   .feat-head has a minimum height so headers line up and the first bullet
   starts at the same y-position across every card in a row, while a long
   heading can still grow the header instead of overflowing it (matters in
   the one- and two-column mobile/tablet layouts). */
.feat {
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--motion-base) var(--ease-standard);
}
.feat:hover { box-shadow: var(--shadow-md); }
.feat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;      /* identical header height across cards in a row */
  margin-bottom: 16px;
}
.feat-icon {
  font-size: 30px;
  line-height: 1;
  color: var(--color-rausch);
  flex: 0 0 auto;
}
/* The icon is an inline Tabler SVG (stroke: currentColor) - 1em ties its
   box to the .feat-icon font-size above, exactly like the old font glyph.
   The -1px translate seats the SVG at the same height the original Tabler
   webfont glyph rendered at (its glyph sat ~1.5px higher in its line box
   than a box-centered SVG), so the icons read a touch high - optically
   centered on the heading's cap line. An integer px keeps strokes crisp on
   every display, matching the webfont's crispness. */
.feat-icon svg { width: 1em; height: 1em; transform: translateY(-1px); }
.feat h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}
.feat-list { list-style: none; padding: 0; margin: 0; }
.feat-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--color-ink-secondary);
  font-size: 15px;
  line-height: 1.5;
}
.feat-list li:last-child { margin-bottom: 0; }
.feat-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-rausch);
}

/* ─── industry tile - the rounded photo and its caption sit directly on the grey
   section (Airbnb category-tile pattern); there is no card box behind them, so the
   photo's 16px rounding reads cleanly instead of a rounded image stranded on a
   square white panel. ─── */
.ind-card {
  display: flex; flex-direction: column;
  /* Touch: keep native vertical page scrolling, but let our horizontal
     swipe / press-and-hold gestures through; suppress the iOS long-press
     callout and text selection during a hold. */
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.ind-img {
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--color-bg-secondary);
}
.ind-card h3 {
  margin: 0; padding: 12px 0 2px;
  font-size: 16px; line-height: 20px; font-weight: 600;
  letter-spacing: 0;
  color: var(--color-ink);
}
.ind-examples {
  margin: 0; padding: 0 0 4px;
  font-size: 14px; line-height: 18px; font-weight: 400;
  color: var(--color-ink-secondary);
}
/* Middot separator between adjacent sub-industry spans */
.ind-examples span + span::before {
  content: " · ";
  color: var(--color-ink-secondary);
  font-weight: 400;
}
.ind-examples span { transition: color var(--motion-base) var(--ease-standard); }
.ind-examples span.is-active {
  color: var(--color-rausch);
  font-weight: 600;
}

/* And-More placeholder: soft panel with a centered arrow.
   :has() auto-hides the arrow once real slides appear. */
.ind-more {
  display: grid;
  place-items: center;
  color: var(--color-ink-secondary);
}
.ind-more::before {
  content: "→";
  font-size: 60px;
  font-weight: 300;
  line-height: 1;
}
.ind-img:has(.ind-slide)::before { display: none; }

/* Slideshow layers - image scales restrained, slides translate horizontally.
   The translate targets are pushed --ind-slide-gap past the parent edge so a
   strip of white panel stays visible between the photos during transit.
   The play state is the JS-toggled .is-playing class (added on mouseenter
   and on touch press-and-hold, removed on mouseleave / release), so desktop
   hover and touch hold share this one set of rules. */
.ind-static-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  pointer-events: none;
  transform: translateX(0);
  transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.ind-card.is-playing .ind-static-bg {
  transform: translateX(calc(-100% - var(--ind-slide-gap)));
}
/* A swipe step moves the resting image out for the duration of that one
   step: .is-step-next exits left (like the cycle, but without the
   .is-playing shadow lift), .is-step-prev exits right. */
.ind-card.is-step-next .ind-static-bg {
  transform: translateX(calc(-100% - var(--ind-slide-gap)));
}
.ind-card.is-step-prev .ind-static-bg {
  transform: translateX(calc(100% + var(--ind-slide-gap)));
}
/* On session end the JS adds .is-snap-back for one frame so the static-bg
   returns to translateX(0) instantly, with no exit animation. */
.ind-card.is-snap-back .ind-static-bg { transition: none; }
.ind-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: translateX(calc(100% + var(--ind-slide-gap)));
  transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  pointer-events: none;
}
/* A swipe-previous slide enters from the LEFT instead of the right. */
.ind-slide.is-from-left { transform: translateX(calc(-100% - var(--ind-slide-gap))); }
.ind-slide.is-in  { transform: translateX(0); }
.ind-slide.is-out { transform: translateX(calc(-100% - var(--ind-slide-gap))); }
/* Subtle shadow lift on the photo while playing, true to Airbnb's restraint */
.ind-card.is-playing .ind-img { box-shadow: var(--shadow-card); }
/* Reduced motion: a hold or swipe still changes the image - it just swaps
   instantly instead of sliding. */
@media (prefers-reduced-motion: reduce) {
  .ind-static-bg, .ind-slide { transition: none; }
}

/* ─── FAQ accordion item ─── */
.faq-item { border-top: 1px solid var(--color-divider); }
.faq-item:last-of-type { border-bottom: 1px solid var(--color-divider); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 24px 40px 24px 0;
  font-weight: 600; font-size: 18px; line-height: 24px; color: var(--color-ink);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-bg-secondary); color: var(--color-ink);
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  transition: background var(--motion-base) var(--ease-standard);
}
.faq-item[open] summary::after {
  content: "−"; background: var(--color-rausch); color: #fff;
}
.faq-item .faq-body {
  padding: 0 40px 24px 0; color: var(--color-ink-secondary);
  font-size: 16px; line-height: 24px;
}

/* ─── mobile-nav hamburger - the <button> that toggles the menu sheet
   (js/mobile_nav.js). Mobile-only: hidden from the md breakpoint up. The
   single .nav-burger-bars span is the middle bar; its ::before/::after
   are the top and bottom bars. ─── */
.nav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap-target-min); height: var(--tap-target-min);
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  transition: background var(--motion-fast) var(--ease-standard);
}
.nav-burger:hover { background: var(--color-bg-secondary); }
.nav-burger-bars,
.nav-burger-bars::before,
.nav-burger-bars::after {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: var(--radius-pill);
}
.nav-burger-bars { position: relative; }
.nav-burger-bars::before,
.nav-burger-bars::after { content: ""; position: absolute; left: 0; }
.nav-burger-bars::before { top: -6px; }
.nav-burger-bars::after  { top: 6px; }
@media (min-width: 745px) {
  .nav-burger { display: none; }
}

/* ─── live transcript popover - modal lightbox for the voice demo.
   The overlay dims and blocks the whole page; the centered panel holds the
   live transcript. Hidden until js/transcript_popover.js adds .is-open. */
.transcript-popover {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-popover);
  background: var(--color-scrim);
  align-items: center;
  justify-content: center;
}
.transcript-popover.is-open { display: flex; }

/* the panel - on phones it fills the viewport minus a small inset, using
   small-viewport units so the mobile address bar can't clip it (the svh
   line is the fallback; dvh overrides it where supported); on desktop
   (min-width: 745px) it is the centered 65% x 65% panel. */
.transcript-panel {
  display: flex;
  flex-direction: column;
  width: calc(100vw - 2 * var(--transcript-inset-mobile));
  height: calc(100svh - 2 * var(--transcript-inset-mobile));
  height: calc(100dvh - 2 * var(--transcript-inset-mobile));
  overflow: hidden;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 745px) {
  .transcript-panel {
    width: var(--transcript-width);
    height: var(--transcript-height);
  }
}

/* header - title + ✕ (the ✕ ends the call) */
.transcript-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.transcript-title { font-size: 14px; font-weight: 600; color: var(--color-ink); }
.transcript-close {
  background: none; border: none; cursor: pointer;
  padding: var(--space-1);
  font-size: 16px; line-height: 1; color: var(--color-ink-secondary);
  transition: color var(--motion-fast) var(--ease-standard);
  /* phone: a full-size touch target; desktop restores the compact ✕ */
  min-width: var(--tap-target-min);
  min-height: var(--tap-target-min);
  display: inline-flex; align-items: center; justify-content: center;
}
.transcript-close:hover { color: var(--color-ink); }
@media (min-width: 745px) {
  .transcript-close { min-width: 0; min-height: 0; }
}

/* scrollable message list - flex:1 + min-height:0 lets it scroll inside the
   panel's fixed height instead of clipping the newest messages */
.transcript-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4);
  overflow-y: auto;
}

/* footer - the "End call" button */
.transcript-foot {
  flex: 0 0 auto;
  display: flex; justify-content: flex-end;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-divider);
}

/* one chat bubble - speaker label above the text */
.transcript-msg {
  display: flex; flex-direction: column;
  max-width: var(--transcript-bubble-max);
}
.transcript-msg-speaker {
  margin-bottom: var(--space-1);
  font-size: 12px; font-weight: 600; color: var(--color-ink-secondary);
}
.transcript-msg-text {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px; line-height: 1.4;
}
/* Maya - left side, neutral surface */
.transcript-msg-agent { align-self: flex-start; }
.transcript-msg-agent .transcript-msg-text {
  background: var(--color-bg-secondary); color: var(--color-ink);
}
/* visitor - right side, brand surface */
.transcript-msg-user { align-self: flex-end; }
.transcript-msg-user .transcript-msg-speaker { text-align: right; }
.transcript-msg-user .transcript-msg-text {
  background: var(--color-rausch); color: #fff;
}

/* ─── connecting overlay - the blocking modal shown while the voice call
   connects (js/connecting_overlay.js). A dimmed backdrop over the whole page
   with a centered card: Maya's avatar ringed by a spinner, a title and a line.
   It hands off to the transcript popover on call start, so both share the
   --z-popover layer and the is-scroll-locked body class (never open together).
   Hidden until the module adds .is-open. ─── */
.connecting-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-popover);
  background: var(--color-scrim);
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.connecting-overlay.is-open { display: flex; }
.connecting-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: min(340px, 100%);
  padding: var(--space-6) var(--space-7);
  text-align: center;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
/* Maya's avatar - a round photo. The photo is a background image so the browser
   only fetches it when the overlay is first shown (the overlay is display:none
   until then), never at page load; the grey panel shows behind until it loads. */
.connecting-avatar {
  position: relative;
  width: var(--connecting-avatar-size);
  height: var(--connecting-avatar-size);
  border-radius: 50%;
  background: var(--color-bg-secondary) url("../assets/hero-640.jpg") center top / cover;
}
/* the spinner ring around the avatar */
.connecting-avatar-ring {
  position: absolute;
  inset: calc(-1 * var(--space-2));
  border-radius: 50%;
  border: var(--connecting-ring-width) solid var(--color-bg-tertiary);
  border-top-color: var(--color-rausch);
  animation: connectingSpin 0.8s linear infinite;
}
@keyframes connectingSpin { to { transform: rotate(360deg); } }
.connecting-title {
  font-family: var(--font-cereal);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
.connecting-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-ink-secondary);
}
/* reduced motion: stop the spin and show a full ring, so the state still reads */
@media (prefers-reduced-motion: reduce) {
  .connecting-avatar-ring { animation: none; border-color: var(--color-rausch); }
}

/* ─── cookie consent banner - fixed bottom bar shown by js/cookie_consent.js.
   Hidden until the script adds .is-open. The two actions reuse the .btn
   components; everything is a var(--…) token.
   CLAUDE: the cookie-consent feature is DISABLED for now (its script include is
   commented out on every page), so these styles are currently dormant. Do NOT
   delete them - keep for the future; they activate again when the feature is
   re-enabled. ─── */
.cookie-banner {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-cookie-banner);
  background: var(--color-bg);
  border-top: 1px solid var(--color-divider);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-5);
}
.cookie-banner.is-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
}
/* phone: the text wraps freely so it never overflows; from md up the bar is
   a single row and the copy stays on one line (rules in the query below). */
.cookie-banner-text {
  margin: 0;
  max-width: none;
  white-space: normal;
  color: var(--color-ink);
  font-size: 14px; line-height: 1.5;
}
.cookie-banner-link { color: var(--color-rausch); text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: var(--space-3); flex: 0 0 auto; justify-content: flex-end; }
.cookie-banner .btn { padding: var(--space-2) 18px; font-size: 14px; }

/* a footer text-link rendered as a <button> (the "Cookie settings" re-opener) */
.cookie-settings-btn {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 14px; line-height: 18px;
  color: var(--color-ink); cursor: pointer;
}
.cookie-settings-btn:hover { text-decoration: underline; }

/* from md up the banner is a single row: text left, actions right, copy on
   one no-wrap line (full vendor detail lives in the linked Privacy Policy). */
@media (min-width: 745px) {
  .cookie-banner.is-open { flex-direction: row; align-items: center; }
  .cookie-banner-text { white-space: nowrap; }
  .cookie-banner-actions { justify-content: flex-start; }
}
