/* Grove case study, page-specific: the Redesign / 2024 toggle and the AI Garden chat.
   V2 tokens come from /assets/v2.css (--black, --paper, --ink, --display Anton,
   --serif Instrument Serif). The greens are Grove's own palette, local to this page. */
:root {
  --grove: #2f7d3e;
  --grove-dark: #256b34;
  --grove-bright: #57c84e;
  --sage: #edf3ee;
  --sage-line: #e1ede2;
  --chat-ink: #1c2a1f;
  --chat-muted: #6b7a6e;
}

/* ---------- Redesign / 2024 segmented control ---------- */
.seg-wrap { display: flex; justify-content: center; margin: 0 0 32px; }
.seg { position: relative; display: inline-flex; background: transparent; border: 2px solid var(--paper); border-radius: 999px; padding: 4px; }
.seg-thumb { position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px); background: var(--grove-bright); border-radius: 999px; transition: transform .38s cubic-bezier(.45,.02,.25,1); }
.seg.show-old .seg-thumb { transform: translateX(100%); }
.seg-btn { position: relative; z-index: 1; appearance: none; border: 0; background: transparent; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: 16px; width: 118px; text-align: center; padding: 10px 0; border-radius: 999px; color: var(--paper); cursor: pointer; transition: color .3s; }
.seg-btn.is-active { color: #0b120c; }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } }

/* Toggle instruction: centered above the segmented control, full width. */
.block__head .toggle-note { grid-column: 1 / -1; text-align: center; }

/* Before and after, one slot per screen: the toggle swaps the phone's image. */
.ba-slot { display: grid; gap: 0; justify-items: center; }
.ba-slot .pair__title { font-family: var(--display); text-transform: uppercase; font-size: 20px; letter-spacing: .04em; margin: 0 0 16px; }
.ba-slot .pair__year { display: block; margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--silver); }
.ba-img { transition: opacity .3s ease; }
.ba-img.ba-fading { opacity: 0; }

/* ---------- AI Garden chat ---------- */
.gchat-stage { display: grid; justify-items: center; gap: 20px; margin-top: 8px; }
.gchat-wrap { position: relative; width: fit-content; }
.gchat { width: 100%; height: 100%; background: var(--sage); color: var(--chat-ink); display: flex; flex-direction: column; overflow: hidden; text-align: left; font-family: "DM Sans", system-ui, sans-serif; }
.gchat-head { display: flex; align-items: center; gap: 10px; background: #fff; padding: 40px 14px 12px; border-bottom: 1px solid var(--sage-line); flex: none; }
.gchat-back { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(23,40,26,.14); display: flex; align-items: center; justify-content: center; }
.gchat-title { flex: 1; min-width: 0; line-height: 1.25; }
.gchat-title strong { display: block; font-size: 16.5px; font-weight: 700; color: #14231a; }
.gchat-title span { display: block; font-size: 11.5px; color: var(--chat-muted); }
.gchat-listen { flex: none; display: inline-flex; align-items: center; gap: 5px; background: #e4f0e4; color: var(--grove); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 6px 11px; }
.gchat-body { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 9px; scrollbar-width: none; }
.gchat-body::-webkit-scrollbar { display: none; }
.gchat-day { text-align: center; font-size: 11px; color: #7a8a7d; padding: 8px 0 1px; }
.gchat-row { display: flex; }
.gchat-ai { gap: 7px; align-items: flex-start; }
.gchat-stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.gchat-bubble { background: #fff; color: var(--chat-ink); border-radius: 16px; border-bottom-left-radius: 5px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; max-width: 250px; box-shadow: 0 1px 2px rgba(23,40,26,.07); }
.gchat-user { justify-content: flex-end; }
.gchat-ub { background: var(--grove); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; box-shadow: 0 1px 2px rgba(23,40,26,.10); }
.gchat-chips { gap: 8px; }
.gchat-chip { border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; background: #fff; color: var(--grove); border: 1px solid #c4dcc6; }
.gchat-chip-on { background: var(--grove); color: #fff; border-color: var(--grove); }
.gchat-photo-row { justify-content: flex-end; }
.gchat-photo { margin: 0; width: 74%; border-radius: 16px; border-bottom-right-radius: 5px; overflow: hidden; box-shadow: 0 1px 2px rgba(23,40,26,.10); }
.gchat-photo img { width: 100%; height: auto; border-radius: 0; box-shadow: none; outline: none; }
.gchat-photo figcaption { background: var(--grove-dark); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 12px; }
.gchat-respond { display: none; align-items: center; gap: 9px; }
.gchat-dots { position: relative; flex: none; width: 18px; height: 17px; }
.gchat-dots i { position: absolute; left: 50%; top: 50%; width: 4.5px; height: 4.5px; margin: -2.25px 0 0 -2.25px; border-radius: 50%; background: var(--grove); }
.gchat-resp-pill { background: #fff; border-radius: 999px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; color: var(--chat-ink); box-shadow: 0 1px 2px rgba(23,40,26,.07); }
.gchat-input { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px 14px; }
.gchat-round { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #ddeedd; display: flex; align-items: center; justify-content: center; }
.gchat-field { flex: 1; background: #fff; border-radius: 999px; padding: 10px 14px; font-size: 13.5px; color: #8a9a8d; box-shadow: 0 1px 2px rgba(23,40,26,.06); white-space: nowrap; overflow: hidden; }
.gchat-img { flex: none; display: flex; align-items: center; justify-content: center; }
.gchat-toggle { position: absolute; top: 12px; right: 12px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--grove); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.gchat-toggle:hover { background: var(--grove-dark); }
.gchat-toggle:focus-visible { outline: 2px solid var(--grove); outline-offset: 2px; }
.gchat-toggle span:not([hidden]) { display: flex; align-items: center; justify-content: center; }
.gchat-cap { font-style: italic; color: var(--silver); max-width: 34em; text-align: center; margin: 0; }
.gchat-replay { font-size: 18px; }
