/* ==========================================================================
   WERNER CLOETE — AI-NATIVE PORTFOLIO
   Ground-up rebuild. One theme (graphite void), one layout system.

   Principles:
   - The stage is a GRID. Reply, proof, twin, suggestions, prompt each own a
     cell. Nothing can paint over anything else — collisions are impossible
     by construction, so nothing needs to hide or fade to survive.
   - Scene changes MORPH. The five persistent elements carry
     view-transition-names, so they travel and reshape between scenes instead
     of cutting.
   - Content is the hero. The room is quiet; the work and the words are loud.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --void: #202429;
  --void-deep: #14181b;
  --ink: #f4f4f1;
  --paper: #f4f4f1;
  --paper-soft: rgba(244, 244, 241, 0.74);
  --muted: rgba(244, 244, 241, 0.5);
  --line: rgba(255, 255, 255, 0.13);
  --signal: #a9d9e5;
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.46);
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
}

/* Route accents tint the signal colour so the room subtly shifts with topic. */
#app[data-route="awards"] { --signal: #f0c769; }
#app[data-route="ai"],
#app[data-route="inhouse"],
#app[data-route="not-another-portfolio"] { --signal: #9fc2ff; }

/* ---------- base ---------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--void);
  color: var(--paper);
  overflow: hidden;
}

/* The void: a lit column of air over graphite. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 42% at 50% 30%, rgba(188, 199, 207, 0.26), transparent 70%),
    linear-gradient(120deg, #111417 0%, #343a40 48%, #13171a 100%);
}

body::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 0;
  bottom: 0;
  z-index: -1;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(220, 232, 238, 0.16) 30%, rgba(220, 232, 238, 0.1) 60%, transparent);
  pointer-events: none;
}

button, input, a { font: inherit; }
button, a { touch-action: manipulation; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

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

input {
  min-width: 0;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  background: rgba(238, 241, 242, 0.92);
  color: #171a1d;
  padding: 0 16px;
  font-size: 0.98rem;
  font-weight: 600;
}

input::placeholder { color: rgba(23, 26, 29, 0.48); }

input:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(169, 217, 229, 0.22);
}

button:disabled { cursor: wait; opacity: 0.65; }

/* ---------- shared small pieces ---------- */
.eyebrow, .system-line {
  margin: 0;
  color: var(--signal);
  font-size: 0.72rem;
  line-height: 1.3;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.password-row, .prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(18, 21, 24, 0.76);
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.login-form button, .prompt-form button {
  min-height: 50px;
  border-radius: 8px;
  background: #e7e9e9;
  color: #16191c;
  padding: 0 20px;
  font-weight: 800;
  transition: transform 160ms var(--ease-out), opacity 160ms ease;
}

.login-form button:hover, .prompt-form button:hover { transform: translateY(-1px); }

#app[data-layout="encounter"] .prompt-form input {
  border-color: rgba(169, 217, 229, 0.2);
  background: rgba(10, 14, 17, 0.82);
  color: var(--paper);
  box-shadow: none;
}

#app[data-layout="encounter"] .prompt-form input::placeholder { color: rgba(244, 244, 241, 0.42); }

#app[data-layout="encounter"] .prompt-form input:focus {
  border-color: rgba(169, 217, 229, 0.58);
  box-shadow: 0 0 0 3px rgba(169, 217, 229, 0.1);
}

#app[data-layout="encounter"] .prompt-form button {
  width: 52px;
  min-height: 50px;
  padding: 0;
  border: 1px solid rgba(169, 217, 229, 0.26);
  background: rgba(169, 217, 229, 0.11);
  color: var(--paper);
  font-size: 1.25rem;
}

.form-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: #f0c769;
  font-size: 0.88rem;
  text-align: center;
}

/* The presenter's grounding disc. Breathes so the room never feels frozen. */
.twin-disc::before,
.gate-twin::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(110%, 400px);
  height: clamp(28px, 6vw, 64px);
  transform: translateX(-50%);
  border: 1px solid rgba(169, 217, 229, 0.22);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(180, 196, 205, 0.16), rgba(9, 12, 14, 0.55) 62%, transparent 74%);
  box-shadow: inset 0 4px 22px rgba(220, 232, 238, 0.1), 0 24px 70px rgba(0, 0, 0, 0.4);
  animation: discBreath 5.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes discBreath {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

/* ==========================================================================
   GATE
   ========================================================================== */
.gate-shell {
  position: fixed;
  inset: 0;
  display: grid;
}

.gate-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  padding: 20px 20px 40px;
}

.gate-identity {
  position: absolute;
  left: 22px;
  top: 18px;
  display: grid;
  gap: 4px;
}

.gate-id { margin: 0; font-size: 0.82rem; font-weight: 750; }
.gate-id span { color: var(--signal); padding: 0 4px; }
.gate-identity .eyebrow { color: var(--muted); font-size: 0.66rem; }

.gate-twin {
  position: relative;
  grid-row: 2;
  align-self: end;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(80vw, 420px);
  padding-bottom: 10px;
}

.gate-twin img {
  position: relative;
  z-index: 1;
  width: min(30vw, 340px);
  max-height: 62svh;
  object-fit: contain;
  filter: brightness(0.96) contrast(1.05) saturate(0.92) drop-shadow(0 34px 44px rgba(0, 0, 0, 0.55));
  animation: twinBreath 6.5s ease-in-out infinite;
}

.gate-copy {
  grid-row: 3;
  width: min(480px, 100%);
  margin-top: clamp(20px, 4vh, 44px);
  text-align: center;
}

.gate-links { margin-top: 14px; }

.gate-links a {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(169, 217, 229, 0.44);
}

.gate-links a:hover { color: var(--paper); border-color: var(--signal); }

/* ==========================================================================
   APP SHELL + TOPBAR (a quiet overlay)
   ========================================================================== */
.app-shell {
  position: fixed;
  inset: 0;
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 0;
  pointer-events: none;
}

.brand-mark { display: none; }

.top-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.top-actions a, .top-actions button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: rgba(244, 244, 241, 0.5);
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.68);
  transition: color 160ms ease;
}

.top-actions a:hover, .top-actions button:hover { color: var(--paper); }

.void-stage {
  position: relative;
  height: 100svh;
  isolation: isolate;
}

/* Legacy zones that no longer render content. */
.detail-zone, #stageTitle { display: none; }

/* ==========================================================================
   THE TWIN (shared)
   ========================================================================== */
.twin-zone {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.twin-plate {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  max-width: 100%;
}

.twin-plate img {
  position: relative;
  z-index: 1;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0.95) contrast(1.05) saturate(0.9) drop-shadow(0 26px 34px rgba(0, 0, 0, 0.58));
  transform: translate3d(var(--twin-shift-x, 0px), var(--twin-shift-y, 0px), 0) rotateY(var(--twin-rotate-y, 0deg));
  transform-origin: 50% 92%;
  transition: transform 600ms var(--ease-out), opacity 420ms ease;
  animation: twinBreath 6.5s ease-in-out infinite;
}

.twin-plate img.is-changing { opacity: 0; }

.twin-plate span {
  position: absolute;
  left: 4px;
  bottom: 2px;
  z-index: 2;
  color: rgba(244, 244, 241, 0.34);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes twinBreath {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -0.6%; }
}

/* ==========================================================================
   ENCOUNTER — Werner alone in the void, one question away.
   ========================================================================== */
#app[data-layout="encounter"] .void-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  padding: 24px 22px clamp(22px, 4.5vh, 52px);
  row-gap: 16px;
}

#app[data-layout="encounter"] .twin-zone {
  grid-row: 1;
  width: min(90vw, 560px);
  padding-bottom: 4px;
}

#app[data-layout="encounter"] .twin-plate { justify-content: center; }

#app[data-layout="encounter"] .twin-plate img {
  max-height: min(58svh, 560px);
  width: auto;
}

#app[data-layout="encounter"] .twin-plate span { display: none; }

#app[data-layout="encounter"] .twin-zone::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(60vw, 460px);
  height: clamp(30px, 6vw, 70px);
  transform: translateX(-50%);
  border: 1px solid rgba(169, 217, 229, 0.22);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(180, 196, 205, 0.16), rgba(9, 12, 14, 0.5) 64%, transparent 75%);
  animation: discBreath 5.4s ease-in-out infinite;
}

#app[data-layout="encounter"] .conversation-zone { display: none; }

#app[data-layout="encounter"] .suggestion-row {
  grid-row: 3;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(760px, 100%);
  margin-top: 2px;
}

.entry-case-links {
  display: grid;
  justify-items: center;
  gap: 9px;
}

.entry-case-links > span {
  color: rgba(244, 244, 241, 0.42);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0;
}

.entry-case-links > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 32px;
}

#app[data-layout="encounter"] .suggestion-row button.is-case-highlight {
  padding-left: 0;
  color: rgba(244, 244, 241, 0.62);
  font-size: 0.88rem;
  font-weight: 650;
  transition: color 180ms ease, box-shadow 180ms ease;
}

#app[data-layout="encounter"] .suggestion-row button.is-case-highlight::before {
  display: none;
}

#app[data-layout="encounter"] .suggestion-row button.is-case-highlight:hover,
#app[data-layout="encounter"] .suggestion-row button.is-case-highlight:focus-visible {
  color: var(--paper);
  box-shadow: inset 0 -1px 0 rgba(169, 217, 229, 0.7);
}

#app[data-layout="encounter"] .evidence-zone { display: none; }

#app[data-layout="encounter"] .prompt-form {
  grid-row: 2;
  width: min(700px, 100%);
}

/* ==========================================================================
   SCENE — the working grid. Proof owns the left, the conversation owns the
   right rail (reply, then Werner, then suggestions), the prompt sits under
   everything. Cells cannot overlap; long text redistributes space.
   ========================================================================== */
#app.has-scene:not([data-layout="encounter"]) .void-stage {
  --scene-twin-height: clamp(150px, 24svh, 250px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 440px);
  grid-template-rows: minmax(min-content, 1fr) var(--scene-twin-height) auto auto;
  grid-template-areas:
    "proof reply"
    "proof twin"
    "proof suggest"
    "prompt prompt";
  column-gap: clamp(20px, 3vw, 48px);
  row-gap: 14px;
  padding: clamp(48px, 7vh, 68px) clamp(20px, 3vw, 48px) clamp(16px, 2.6vh, 30px);
}

/* --- reply (top of the rail) --- */
#app.has-scene .conversation-zone {
  grid-area: reply;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

#app.has-scene #stageReply {
  margin: 0;
  color: var(--paper);
  font-size: clamp(0.96rem, min(1.15vw, 2svh), 1.18rem);
  line-height: 1.38;
  white-space: pre-wrap;
  text-wrap: pretty;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 30px rgba(0, 0, 0, 0.6);
}

@media (min-width: 901px) and (max-height: 760px) {
  #app.has-scene:not([data-layout="encounter"]) .void-stage {
    --scene-twin-height: 132px;
    row-gap: 10px;
    padding-top: 46px;
    padding-bottom: 14px;
  }

  #app.has-scene .suggestion-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
  }
}

/* --- Werner (middle of the rail; yields space when words need it) --- */
#app.has-scene .twin-zone {
  grid-area: twin;
  justify-content: flex-end;
  height: var(--scene-twin-height);
  min-height: 0;
  padding-right: clamp(4px, 1vw, 20px);
}

#app.has-scene .twin-plate {
  width: 100%;
  height: 100%;
  justify-content: flex-end;
}

#app.has-scene .twin-plate img {
  width: 100%;
  height: 100%;
}

#app.has-scene .twin-plate::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120%;
  height: clamp(18px, 2.2vw, 34px);
  transform: translateX(-50%);
  border: 1px solid rgba(169, 217, 229, 0.18);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(180, 196, 205, 0.12), rgba(9, 12, 14, 0.45) 64%, transparent 76%);
  animation: discBreath 5.4s ease-in-out infinite;
}

/* --- suggestions (bottom of the rail): a quiet ticked list --- */
#app.has-scene .suggestion-row {
  grid-area: suggest;
  display: grid;
  gap: 4px;
  align-content: end;
  justify-items: start;
}

/* --- proof: the hero cell --- */
.evidence-zone {
  grid-area: proof;
  position: relative;
  min-height: 0;
  min-width: 0;
  display: grid;
}

.proof-reveal {
  display: grid;
  min-height: 0;
  min-width: 0;
}

.case-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.case-media.has-video, .case-media.has-image {
  align-self: center;
  border-radius: 12px;
  background: #0d1013;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.05);
}

.case-media video, .case-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #0d1013;
}

/* Cinema keeps the film at 16:9, as large as the cell allows. */
#app.has-cinematic-proof .proof-reveal { place-items: center; }

#app.has-cinematic-proof .case-media {
  width: min(100%, calc((100svh - 240px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

/* A campaign series is one evolving proof, not a thumbnail gallery. The active
   asset owns the stage; the remaining films sit as a quiet strip of fragments. */
.proof-reveal.is-series,
.case-series {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.case-series {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 52px;
  gap: 10px;
}

.series-feature-shell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

#app.has-series-proof .case-media.series-feature {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 10px;
}

#app.has-series-proof .case-media.series-feature.is-portrait {
  width: min(68%, calc((100svh - 285px) * 4 / 5));
  height: 100%;
  background: rgba(13, 16, 19, 0.76);
}

.series-feature video,
.series-feature img {
  object-position: center;
}

.series-caption {
  position: absolute;
  left: clamp(12px, 2vw, 28px);
  bottom: clamp(10px, 1.7vw, 24px);
  z-index: 4;
  display: grid;
  gap: 2px;
  max-width: min(70%, 380px);
  padding: 12px 14px 11px;
  background: rgba(6, 9, 10, 0.76);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.series-caption span {
  color: var(--signal);
  font-size: 0.6rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.series-caption strong {
  color: var(--paper);
  font-size: clamp(0.88rem, 1.1vw, 1.05rem);
  line-height: 1.2;
}

.series-fragments {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.series-fragment {
  position: relative;
  flex: 0 1 60px;
  min-width: 34px;
  overflow: hidden;
  border: 0;
  border-bottom: 2px solid rgba(244, 244, 241, 0.16);
  border-radius: 0;
  background: #0d1013;
  opacity: 0.52;
  filter: grayscale(0.72);
  transition: flex-basis 320ms var(--ease-out), opacity 240ms ease, filter 240ms ease, border-color 240ms ease;
}

.series-fragment:hover,
.series-fragment:focus-visible {
  opacity: 0.82;
  filter: grayscale(0.2);
}

.series-fragment.is-active {
  flex-basis: 104px;
  border-bottom-color: var(--signal);
  opacity: 1;
  filter: none;
}

.series-fragment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-fragment span {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  text-shadow: 0 1px 8px #000;
}

/* Image-led proof */
#app.has-visual-proof:not(.has-cinematic-proof) .case-media { width: 100%; height: 100%; }

/* Text-led proof: the title is the poster, floating on the void. */
.case-media.is-abstract {
  width: 100%;
  height: 100%;
  align-content: center;
  justify-items: start;
  padding: clamp(24px, 4vw, 64px);
  background:
    radial-gradient(120% 90% at 22% 18%, rgba(169, 217, 229, 0.12), transparent 46%),
    radial-gradient(140% 120% at 30% 50%, rgba(6, 8, 10, 0.42), transparent 70%);
}

.case-media.is-abstract span, .case-media.is-abstract small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-media.is-abstract strong {
  max-width: 10ch;
  margin: 10px 0 0;
  color: var(--paper);
  font-size: clamp(3rem, 6.4vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.45);
}

.case-media.is-abstract small { margin-top: 16px; }

.proof-reveal-copy {
  position: absolute;
  right: clamp(16px, 2.4vw, 40px);
  bottom: clamp(14px, 2.2vw, 36px);
  width: min(30%, 300px);
  display: grid;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(169, 217, 229, 0.34);
}

.proof-reveal-copy span {
  color: var(--signal);
  font-size: 0.64rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.proof-reveal-copy h2 { display: none; }

.proof-reveal-copy p {
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Film and photo proof: the media speaks for itself. */
#app.has-visual-proof .proof-reveal-copy { display: none; }

/* No case on stage: the theme intro floats quietly. */
.empty-proof {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: clamp(24px, 4vw, 64px);
}

.empty-proof span {
  color: var(--signal);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-proof p {
  max-width: 30ch;
  margin: 0;
  color: var(--paper-soft);
  font-size: 1.3rem;
  line-height: 1.4;
}

/* --- prompt: centred under everything --- */
.prompt-form { position: relative; }

#app.has-scene:not([data-layout="encounter"]) .prompt-form {
  grid-area: prompt;
  justify-self: center;
  width: min(640px, 100%);
}

/* Native video overlay play button */
.case-play {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  background: rgba(22, 25, 28, 0.78);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  transition: transform 180ms var(--ease-out), opacity 180ms ease;
}

.case-play:hover { transform: translate(-50%, -50%) scale(1.06); }

.case-play span {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #fff;
}

.case-media.has-video.is-playing .case-play { pointer-events: none; opacity: 0; }

/* ---------- suggestions (shared look) ---------- */
.suggestion-row button {
  position: relative;
  border: 0;
  background: transparent;
  padding: 5px 0 5px 18px;
  color: rgba(244, 244, 241, 0.64);
  font-size: 0.88rem;
  font-weight: 650;
  text-align: left;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
  transition: color 180ms ease;
}

.suggestion-row button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 1px;
  background: var(--signal);
  opacity: 0.6;
  transform: translateY(-50%);
  transition: width 200ms var(--ease-out), opacity 200ms ease;
}

.suggestion-row button:hover { color: #fff; }
.suggestion-row button:hover::before { width: 16px; opacity: 1; }

.suggestion-row .contact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid rgba(169, 217, 229, 0.42);
  border-radius: 999px;
  background: rgba(169, 217, 229, 0.1);
  color: var(--signal);
  font-size: 0.8rem;
  font-weight: 740;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.suggestion-row .contact-chip:hover {
  border-color: rgba(169, 217, 229, 0.8);
  background: rgba(169, 217, 229, 0.18);
  color: #fff;
}

/* ==========================================================================
   STATES
   ========================================================================== */
/* Thinking: the previous words and options step back; the room listens. */
#app.has-scene .conversation-zone,
#app.has-scene .suggestion-row {
  transition: opacity 320ms ease;
}

#app.is-thinking .conversation-zone,
#app.is-thinking .suggestion-row { opacity: 0.35; }

/* Speaking: a whisper of light on the presenter. */
#app.is-speaking .twin-plate img {
  filter: brightness(0.98) contrast(1.05) saturate(0.92)
    drop-shadow(0 26px 34px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 26px rgba(169, 217, 229, 0.18));
}

.app-shell.is-listening .prompt-row { border-color: rgba(169, 217, 229, 0.4); }

/* The reply is revealed by a paced character queue in JS. The caret is the
   only decorative motion, so uneven network chunks never become visible. */
#app.is-speaking #stageReply::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-left: 0.12em;
  background: var(--signal);
  vertical-align: -0.08em;
  animation: typingCaret 760ms steps(1, end) infinite;
}

@keyframes typingCaret { 50% { opacity: 0; } }

/* ==========================================================================
   MORPH TRANSITIONS — named elements travel between scenes.
   ========================================================================== */
.twin-zone { view-transition-name: twin; }
.evidence-zone { view-transition-name: proof; }
.conversation-zone { view-transition-name: reply; }
.suggestion-row { view-transition-name: suggestions; }
.prompt-form { view-transition-name: prompt; }

::view-transition-group(*) {
  animation-duration: 620ms;
  animation-timing-function: cubic-bezier(0.3, 0.75, 0.22, 1);
}

::view-transition-group(twin) {
  animation-duration: 880ms;
  animation-timing-function: cubic-bezier(0.22, 0.78, 0.2, 1);
}

::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: 620ms;
}

/* Contents inside a moving group crossfade gently rather than blink. */
::view-transition-old(proof), ::view-transition-new(proof),
::view-transition-old(reply), ::view-transition-new(reply),
::view-transition-old(suggestions), ::view-transition-new(suggestions) {
  animation-duration: 480ms;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   MOBILE — one column, in flow, nothing overlaps.
   ========================================================================== */
@media (max-width: 900px) {
  #app.has-scene:not([data-layout="encounter"]) .void-stage {
    --scene-twin-height: clamp(64px, 15svh, 120px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) var(--scene-twin-height) auto auto;
    grid-template-areas:
      "reply"
      "proof"
      "twin"
      "suggest"
      "prompt";
    padding: 52px 16px 14px;
    row-gap: 10px;
  }

  #app.has-scene .conversation-zone { max-height: 32svh; }

  #app.has-scene #stageReply { font-size: 0.98rem; line-height: 1.36; }

  #app.has-scene .twin-zone { justify-content: flex-end; padding-right: 6px; }

  #app.has-scene .suggestion-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, black 0 88%, transparent);
  }

  #app.has-scene .suggestion-row::-webkit-scrollbar { display: none; }

  #app.has-scene .suggestion-row button { white-space: nowrap; }

  #app.has-cinematic-proof .case-media { width: 100%; }

  .case-series { grid-template-rows: minmax(0, 1fr) 44px; gap: 6px; }

  #app.has-series-proof .case-media.series-feature.is-portrait {
    width: min(78%, calc(44svh * 4 / 5));
  }

  .series-fragments {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .series-fragments::-webkit-scrollbar { display: none; }

  .series-fragment { flex-basis: 44px; min-width: 44px; }
  .series-fragment.is-active { flex-basis: 72px; min-width: 72px; }

  .series-caption {
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 8px 10px;
  }

  .proof-reveal-copy { display: none; }

  .case-media.is-abstract strong { font-size: clamp(2.2rem, 11vw, 4rem); }

  #app[data-layout="encounter"] .twin-plate img { max-height: 48svh; }

  .gate-twin img { width: min(56vw, 300px); max-height: 50svh; }

  .gate-copy { width: 100%; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
