/* Trauma at the Tree — SAC Youths, 27-29 Aug 2026
   Palette sampled programmatically from web/public/assets/poster.jpg (see
   docs/ARCHITECTURE.md, "Branding"), not hand-transcribed. Dark-only by
   design: the audience is phone-first in a dark auditorium (handoff §6) —
   no light theme, no toggle, to keep scope down to what was actually asked
   for. Tokens are still named generically so a future SAC Youths event can
   swap values here without touching markup or JS. */

@import url("https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #101127;
  --bg-page-glow-a: rgba(200, 48, 97, 0.22);
  --bg-page-glow-b: rgba(59, 75, 151, 0.28);
  --surface: rgba(30, 33, 80, 0.82);
  --surface-solid: #191c46;
  --panel-border: rgba(255, 242, 155, 0.16);
  --text: #f5f0e6;
  --muted: #a9a6c9;
  --accent-yellow: #fff29b;
  --accent-magenta: #c83061;
  --accent-pink: #e8365e;
  --accent-orange: #f2874a;
  --accent-blue: #3b4b97;
  --bot-bubble: rgba(255, 255, 255, 0.06);
  --bot-border: rgba(255, 255, 255, 0.08);
  --user-bubble: linear-gradient(135deg, rgba(232, 54, 94, 0.92), rgba(200, 48, 97, 0.95));
  --user-text: #ffffff;
  --composer-bg: rgba(0, 0, 0, 0.25);
  --input-bg: rgba(0, 0, 0, 0.32);
  --input-border: rgba(255, 255, 255, 0.14);
  --duty-bg: rgba(242, 135, 74, 0.12);
  --duty-border: rgba(242, 135, 74, 0.35);
  --font-display: "Cormorant", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius-panel: 1.25rem;
  --radius-bubble: 1rem;
  --shadow-panel: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--panel-border);
  --chat-max: 28rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, var(--bg-page-glow-a), transparent 55%),
    radial-gradient(circle at 90% 30%, var(--bg-page-glow-b), transparent 60%);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0 0 2rem;
}

.app {
  width: 100%;
  max-width: var(--chat-max);
  display: flex;
  flex-direction: column;
}

/* --- Hero ------------------------------------------------------------- */

.hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Chat panel --------------------------------------------------------- */

.chat-panel {
  margin: -1.5rem 0.75rem 0;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.chat-header {
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--bot-border);
}

.chat-header__title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.25rem;
  margin: 0 0 0.15rem;
  color: var(--accent-yellow);
}

.chat-header__status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.progress {
  display: flex;
  gap: 0.35rem;
  padding: 0.75rem 1.25rem 0;
}

.progress__seg {
  flex: 1;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress__seg.is-active {
  background: var(--accent-orange);
}

.progress__seg.is-done {
  background: var(--accent-yellow);
}

/* --- Messages ----------------------------------------------------------- */

.messages {
  flex: 1;
  min-height: 14rem;
  max-height: 24rem;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  scroll-behavior: smooth;
}

.msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-bubble);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg--bot {
  align-self: flex-start;
  background: var(--bot-bubble);
  border: 1px solid var(--bot-border);
  border-bottom-left-radius: 0.3rem;
}

.msg--user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 0.3rem;
}

/* --- Response multi-select ---------------------------------------------- */

.response {
  padding: 0 1.1rem;
}

.response:empty {
  padding: 0;
}

.response__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.response-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--bot-border);
  background: var(--bot-bubble);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.response-pill:hover {
  border-color: var(--panel-border);
}

.response-pill.is-selected {
  background: rgba(255, 242, 155, 0.12);
  border-color: var(--accent-yellow);
}

.response-pill__check {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.3rem;
  border: 1.5px solid var(--muted);
  position: relative;
}

.response-pill.is-selected .response-pill__check {
  border-color: var(--accent-yellow);
  background: var(--accent-yellow);
}

.response-pill.is-selected .response-pill__check::after {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.08rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.response-pill__continue {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.85rem;
  border: none;
  background: var(--accent-orange);
  color: #1a0e05;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.response-pill__continue:hover {
  filter: brightness(1.08);
}

/* --- Duty of care --------------------------------------------------------
   Non-negotiable text near the free-text field (handoff §8) — styled to be
   noticed without reading as an alarm. */

.duty-of-care {
  margin: 0 1.1rem 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  background: var(--duty-bg);
  border: 1px solid var(--duty-border);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.45;
}

.duty-of-care[hidden] {
  display: none;
}

/* --- Suggestions / chips ------------------------------------------------- */

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.1rem 0.5rem;
}

.suggestions:empty {
  padding: 0;
}

.chip {
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent-yellow);
}

/* --- Footer / composer ---------------------------------------------------- */

.panel-footer {
  padding: 0 1.1rem;
  display: flex;
  justify-content: flex-end;
}

.panel-footer:empty {
  padding: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem 0;
}

.composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--composer-bg);
  border-top: 1px solid var(--bot-border);
}

.composer__input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.85rem;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.composer__input:disabled {
  opacity: 0.5;
}

.composer__input:focus {
  outline: none;
  border-color: var(--accent-yellow);
}

.composer__send {
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.85rem;
  border: none;
  background: var(--accent-magenta);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.composer__send:disabled {
  opacity: 0.4;
  cursor: default;
}

.composer__send svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: #fff;
}

.privacy-note {
  margin: 0;
  padding: 0.5rem 1.1rem 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.privacy-note a {
  color: var(--muted);
}

/* --- Teaser landing (before Day 2 arrives) --------------------------------
   Full-bleed backdrop using trauma-youth-bg.png — a text-free, blurred
   colour wash derived from the poster (Adrian's asset), used purely as
   atmosphere. The literal poster is deliberately NOT shown here: the card
   below already fully typesets the event's name/date/venue/speakers, so a
   poster hero on top of it would just be saying the same thing twice — see
   docs/ARCHITECTURE.md ("Teaser"). The live chat flow's hero keeps showing
   the actual poster, since that flow never re-states this info as text. */

.app.is-teaser .hero,
.app.is-teaser .chat-panel {
  display: none;
}

body.is-teaser {
  padding: 0;
  background-image: none;
  overflow-x: hidden;
}

body.is-teaser::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../assets/trauma-youth-bg.png") center / cover no-repeat;
  animation: teaser-drift 46s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Light touch on purpose — the previous full-bleed attempt darkened this
   down to ~96% opacity and the warm side of the wash read as a dead void.
   The card carries its own --surface background for text contrast, so this
   overlay only needs to unify tone, not do the legibility work itself. */
body.is-teaser::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 26%, rgba(16, 17, 39, 0.1), rgba(16, 17, 39, 0.58) 76%),
    linear-gradient(180deg, rgba(16, 17, 39, 0.2) 0%, rgba(16, 17, 39, 0.5) 100%);
  pointer-events: none;
}

.app.is-teaser {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  justify-content: center;
  padding: 3rem 1.1rem;
}

.teaser {
  margin: 0;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 2.1rem 1.5rem 2.4rem;
  position: relative;
  z-index: 1;
  animation: teaser-card-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.teaser:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.teaser[hidden] {
  display: none;
}

/* Entrance: a gentle, staggered rise-and-fade — slow, calm easing, never
   bouncy or fast. This event is trauma-themed; playful motion would be
   tonally wrong even at "subtle" amplitude. prefers-reduced-motion turns
   all of this off further down. */
.teaser__org,
.teaser__title,
.teaser__tagline,
.teaser__meta,
.teaser__blurb,
.teaser__speakers {
  animation: teaser-item-in 0.6s ease-out both;
}

.teaser__org {
  animation-delay: 0.05s;
}

.teaser__title {
  animation-delay: 0.12s;
}

.teaser__tagline {
  animation-delay: 0.24s;
}

.teaser__rule {
  animation: teaser-rule-in 0.7s ease-out 0.32s both;
}

.teaser__meta {
  animation-delay: 0.4s;
}

.teaser__blurb {
  animation-delay: 0.48s;
}

.teaser__speakers {
  animation-delay: 0.56s;
}

/* The one actionable line gets its own entrance plus a slow, low-amplitude
   glow once settled — just enough to draw the eye as the thing to notice,
   not enough to feel like a notification badge. */
.teaser__note {
  animation: teaser-item-in 0.6s ease-out 0.64s both, teaser-note-glow 5s ease-in-out 1.4s infinite;
}

@keyframes teaser-drift {
  from {
    transform: scale(1.06) translate(0, 0);
  }
  to {
    transform: scale(1.16) translate(-1.5%, -1%);
  }
}

@keyframes teaser-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teaser-item-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teaser-rule-in {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 2.25rem;
    opacity: 0.5;
  }
}

@keyframes teaser-note-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 242, 155, 0);
    border-color: rgba(255, 242, 155, 0.28);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 242, 155, 0.14);
    border-color: rgba(255, 242, 155, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-teaser::before,
  .teaser,
  .teaser__org,
  .teaser__title,
  .teaser__tagline,
  .teaser__rule,
  .teaser__meta,
  .teaser__blurb,
  .teaser__speakers,
  .teaser__note {
    animation: none !important;
  }
}

.teaser__org {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.teaser__title {
  margin: 0;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 11vw, 3rem);
  line-height: 1.02;
  letter-spacing: 0.03em;
  overflow-wrap: break-word;
  text-transform: uppercase;
  color: var(--accent-yellow);
  text-wrap: balance;
}

.teaser__title span {
  display: block;
  margin-top: 0.14em;
  font-size: 0.76em;
  letter-spacing: 0.05em;
}

.teaser__tagline {
  margin: 1.1rem 0 0;
  max-width: 26rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

.teaser__rule {
  width: 2.25rem;
  height: 1px;
  margin: 1.5rem 0 1.4rem;
  background: var(--accent-yellow);
  opacity: 0.5;
}

.teaser__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  width: 100%;
  margin: 0;
}

.teaser__meta-item {
  margin: 0;
  min-width: 0;
}

.teaser__meta dt {
  margin: 0 0 0.4rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.teaser__meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  line-height: 1.35;
  color: var(--accent-yellow);
  overflow-wrap: break-word;
}

.teaser__meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 242, 155, 0.4);
}

.teaser__meta a:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.teaser__blurb {
  margin: 1.4rem 0 0;
  max-width: 26rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

.teaser__speakers {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin: 1.6rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--bot-border);
}

.teaser__speaker-name {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-yellow);
  overflow-wrap: break-word;
}

.teaser__speaker-title,
.teaser__speaker-org {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.teaser__speaker-org {
  margin-top: 0.06rem;
}

.teaser__speakers li {
  min-width: 0;
}

/* The one actionable line — when responses actually open — gets a light
   accent treatment so it reads as a call-out, not another paragraph of
   muted copy competing with the tagline/blurb above it. */
.teaser__note {
  margin: 1.6rem 0 0;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255, 242, 155, 0.08);
  border: 1px solid rgba(255, 242, 155, 0.28);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
}

@media (min-width: 480px) {
  .teaser__speakers {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    border-top: none;
    padding-top: 0;
    margin-top: 1.75rem;
  }

  .teaser__speakers li {
    flex: 1;
    max-width: 12rem;
  }
}

/* --- Closed state --------------------------------------------------------- */

.closed-state {
  margin: -1.5rem 0.75rem 0;
  background: var(--surface);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 2rem 1.5rem;
  text-align: center;
}

.closed-state[hidden] {
  display: none;
}

.closed-state p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

@media (min-width: 480px) {
  .app:not(.is-teaser) {
    margin-top: 1.5rem;
    border-radius: var(--radius-panel);
    overflow: hidden;
  }
}
