/* Riff — the landing page's call stage, call-to-action bands and sticky bar.
   Tokens come from site.css (ink / brass / verdigris). The transcript, fields, booking view and calendar reuse the
   build page's styles (site.css, booking-view.css, riff-calendar.css). */

/* ---- the one action, everywhere ------------------------------------------------------------------ */
.call-btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-family: var(--font-display);
  min-height: 48px; padding: 0.8rem 1.5rem; border-radius: var(--r-pill); letter-spacing: 0.01em;
  background: var(--brass); color: var(--brass-ink); transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.call-btn:hover { background: var(--brass-2); transform: translateY(-1px); }
.call-btn:focus-visible { outline: 3px solid var(--chalk); outline-offset: 3px; }
.call-btn--web { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 2px var(--brass); }
.call-btn--web:hover { background: rgba(224, 174, 78, 0.14); }
.homepage .hero-copy [data-call-cta] { margin: 1.4rem 0 0.4rem; }
.call-cta__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); margin: 0 0 0.25rem; }
.call-cta__note { color: var(--chalk-2); font-size: var(--t-sm); margin: 0 0 0.9rem; max-width: 40rem; }
.call-cta__row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.call-cta--band {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(1.4rem, 4vw, 2.2rem) var(--gutter);
  background: var(--ink); color: var(--chalk); border-top: 1px solid var(--line-ink); border-bottom: 1px solid var(--line-ink);
  text-align: center;
}
.call-cta--band .call-cta__note { margin-left: auto; margin-right: auto; }
.call-cta--band .call-cta__row { justify-content: center; }
.button--quiet { background: transparent; color: inherit; box-shadow: none; text-decoration: underline; text-underline-offset: 0.25em; padding-left: 0; }
.call-sticky { display: none; }
@media (max-width: 719px) {
  .call-sticky {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--ink) 70%, transparent);
  }
  .call-sticky .call-btn { width: 100%; }
  html.cs-cta-near .call-sticky { display: none; }
  body.homepage { padding-bottom: 4.5rem; }
}

/* ---- the page changes in place ------------------------------------------------------------------ */
html.cs-active #main > :not(#call-stage),
html.cs-active .call-cta,
html.cs-active .call-sticky,
html.cs-active footer,
html.cs-active header.nav { display: none !important; }
html.cs-active body.homepage { padding-bottom: 0; background: var(--ink); }

.call-stage { background: var(--ink); color: var(--chalk); min-height: 60vh; display: flex; flex-direction: column; }
.call-stage > * { width: 100%; box-sizing: border-box; }
.cs-bar { order: -3; }
.cs-notice { order: -2; }
/* When the call is over, what the visitor does next -- the summary and "make it yours" -- comes first, with the
   transcript and the calendar below as the evidence. It used to sit under a long calendar, out of sight. */
.call-stage[data-state="ended"] .cs-ended { order: -1; }
.cs-greeting { display: grid; gap: 0.1rem; margin: 0 0 0.7rem; font-size: var(--t-sm); line-height: 1.45; }
.cs-greeting-who { font-family: var(--font-display); font-weight: 600; font-size: var(--t-xs); color: var(--brass); }
.cs-greeting-what { color: var(--chalk); }
html.cs-active .call-stage { min-height: 100vh; }
.call-stage[hidden], .call-stage [hidden] { display: none !important; }
html.cs-engaged .call-sticky { display: none !important; }
.cs-role--ringing { max-width: 30rem; margin: 1.4rem auto 0; text-align: left; }
.call-stage h2 { font-family: var(--font-display); }

.cs-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem var(--gutter);
  background: var(--ink-2); border-bottom: 1px solid var(--line-ink);
}
.cs-title { font-family: var(--font-display); font-size: var(--t-base); }
.cs-time { font-variant-numeric: tabular-nums; color: var(--chalk-2); margin-right: auto; }
.cs-bar-btn { appearance: none; cursor: pointer; font: inherit; font-size: var(--t-sm); color: var(--chalk); background: transparent;
  border: 1px solid var(--line-ink); border-radius: var(--r-pill); padding: 0.45rem 1rem; min-height: 40px; }
.cs-bar-btn:hover { border-color: var(--brass); }
.cs-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--verdigris-2); box-shadow: 0 0 0 0 rgba(107, 208, 191, 0.7); animation: cs-ring 1.6s infinite; }
.call-stage[data-state="ringing"] .cs-pulse { background: var(--brass); box-shadow: 0 0 0 0 rgba(224, 174, 78, 0.7); }
.call-stage[data-state="ended"] .cs-pulse { animation: none; background: var(--slate); }
@keyframes cs-ring { 70% { box-shadow: 0 0 0 14px rgba(107, 208, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(107, 208, 191, 0); } }

.cs-notice { margin: 1rem var(--gutter); padding: 1rem 1.2rem; border-radius: var(--r-card); background: var(--ink-3); border: 1px solid var(--ember); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.cs-notice p { margin: 0; flex: 1 1 18rem; }

.cs-ringing { max-width: 44rem; margin: 0 auto; padding: clamp(2rem, 8vw, 5rem) var(--gutter); text-align: center; }
.cs-eyebrow { color: var(--chalk-2); font-size: var(--t-sm); letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.4rem; }
.cs-number { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 9vw, 4.2rem); color: var(--brass); text-decoration: none; letter-spacing: 0.01em; }
.cs-ring-note { font-size: var(--t-md); margin: 1rem 0; }
.cs-ring-role { color: var(--chalk-2); }

.cs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; max-width: 1280px; margin: 0 auto; padding: 1.2rem var(--gutter) 3rem; }
@media (min-width: 1024px) { .cs-grid { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }
.cs-live.live-call { margin-top: 0; }
.cs-live .live-transcript { max-height: 46vh; min-height: 12rem; }
.call-stage[data-state="booking"] .cs-live .live-transcript { max-height: 18vh; }
.call-stage .riffcal-live, .call-stage .booking-view { scroll-margin-top: 5rem; }
/* The calendar arrives when the call reaches booking, not before. It is mounted early (FullCalendar needs a box of
   the right width to measure) but held at zero height until then. */
.call-stage:not(.cs-booking) .riffcal-live,
.call-stage:not(.cs-booking) .booking-view {
  height: 0; min-height: 0; overflow: hidden; visibility: hidden; margin: 0; padding: 0; border: 0;
}

.cs-side { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 1024px) { .cs-side { position: sticky; top: 5rem; } }
.cs-card { background: var(--ink-2); border: 1px solid var(--line-ink); border-radius: var(--r-card); padding: 1rem 1.1rem; }
.cs-card h2 { margin: 0 0 0.5rem; font-size: var(--t-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--chalk-2); }
.cs-role { border-color: var(--brass); }
.cs-role-name { font-size: var(--t-md); margin: 0 0 0.4rem; }
.cs-role ul, .cs-could ol { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.cs-small { color: var(--chalk-2); font-size: var(--t-xs); margin: 0.6rem 0 0; }
.cs-happening p { margin: 0; font-size: var(--t-base); }
.cs-could li { color: var(--chalk-2); font-size: var(--t-sm); }
.cs-could li.cs-new { color: var(--chalk); animation: cs-in 0.6s var(--ease); }
@keyframes cs-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1023px) {
  /* One column: your role first, then "What's happening" pinned under the call bar while the rest scrolls. */
  .cs-side { display: contents; }
  .cs-role { order: -2; }
  .cs-happening { order: -1; position: sticky; top: 3.5rem; z-index: 20; box-shadow: 0 10px 24px rgba(15, 27, 45, 0.85); }
  .cs-could { order: 1; }
}

.cs-ended { max-width: 44rem; margin: 0 auto; padding: 1rem var(--gutter) 4rem; text-align: center; }
.cs-ended h2 { font-size: var(--t-xl); margin: 0 0 0.5rem; }
.cs-r1 { display: grid; gap: 0.8rem; margin: 1.6rem 0 0.6rem; text-align: left; background: var(--ink-2); border: 1px solid var(--brass); border-radius: var(--r-card); padding: 1.2rem; }
.cs-r1-title { margin: 0; font-family: var(--font-display); font-size: var(--t-md); }
.cs-r1 label { display: grid; gap: 0.25rem; font-size: var(--t-sm); color: var(--chalk-2); }
.cs-r1 input { font: inherit; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--line-ink); background: var(--ink); color: var(--chalk); min-height: 44px; }
.cs-r1 input:focus-visible { outline: 3px solid var(--brass); outline-offset: 1px; }
.cs-link { appearance: none; background: none; border: 0; color: var(--chalk-2); text-decoration: underline; cursor: pointer; font: inherit; }

.cs-return { position: fixed; right: var(--gutter); bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 60; appearance: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; padding: 0.8rem 1.3rem; border-radius: var(--r-pill); background: var(--brass); color: var(--brass-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .cs-pulse, .cs-could li.cs-new { animation: none; }
  .call-btn { transition: none; }
}
