/* ──────────────────────────────────────────────────────────────────────
   alice-tokens.css

   Brand tokens + shared component styles for the chatbot-attack demos.
   Mirrors design/colors_and_type.css; adds a scoped ".demo-frame"
   inspector palette for status semantics (safe / warn / danger / breach)
   that the marketing brand intentionally lacks.
   ────────────────────────────────────────────────────────────────────── */

/* ── Fonts ────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Romie';
  src: url('/fonts/Romie-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Romie';
  src: url('/fonts/Romie-MediumItalic.woff') format('woff');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('/fonts/HaasGrotDisp-45Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('/fonts/HaasGrotDisp-55Roman.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('/fonts/HaasGrotDisp-65Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('/fonts/HaasGrotDisp-75Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Haas Grot Mono';
  src: url('/fonts/NeueHaasGroteskTextMono-55Roman.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haas Grot Mono';
  src: url('/fonts/NeueHaasGroteskTextMono-65Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haas Grot Mono';
  src: url('/fonts/NeueHaasGroteskTextMono-75Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Brand tokens ─────────────────────────────────────────────────── */

:root {
  --black:               #0D0D0D;
  --midnight-blue:       #03041D;
  --anti-contrast-black: #1E1E1E;
  --dark-neutral-gray:   #464645;
  --medium-neutral-gray: #6E6D6B;
  --light-neutral-gray:  #BDBBB8;
  --bright-neutral-gray: #F0EBE3;
  --anti-flash-white:    #F7F5F1;
  --white:               #FFFFFF;
  --brown:               #362C2C;
  --yellow:              #FFD57A;
  --gold:                #DE972D;
  --pink:                #E686B4;
  --medium-pink:         #B6276B;
  --seafoam:             #9FD2DA;
  --mint-green:          #8AD6CB;
  --aquatic-green:       #108496;
  --beige-pink:          #F6F0E9;

  --bg-page:    var(--beige-pink);
  --bg-paper:   var(--anti-flash-white);
  --bg-surface: var(--bright-neutral-gray);
  --ink:        var(--black);
  --body-color: var(--dark-neutral-gray);
  --muted:      var(--medium-neutral-gray);
  --border:     var(--light-neutral-gray);
  --cta-light:  var(--aquatic-green);

  --font-display: "Romie", "Libre Baskerville", "Times New Roman", serif;
  --font-body:    "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono:    "Haas Grot Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
}

/* ── Inspector status palette ─────────────────────────────────────────
   Scoped to .demo-frame. Brand has yellow/pink/green but no semantic
   safe/warn/danger/breach mapping, and no red. The breach red is the
   single intentional non-brand value; everything else is a brand token.
   ─────────────────────────────────────────────────────────────────── */

.demo-frame {
  --status-safe:        var(--mint-green);
  --status-safe-bg:     rgba(138, 214, 203, 0.20);
  --status-warn:        var(--gold);
  --status-warn-bg:     rgba(222, 151, 45, 0.16);
  --status-danger:      var(--medium-pink);
  --status-danger-bg:   rgba(182, 39, 107, 0.12);
  --status-breach:      #C0392B;
  --status-breach-bg:   rgba(192, 57, 43, 0.10);
  --status-breach-soft: rgba(192, 57, 43, 0.18);

  --code-bg: var(--anti-contrast-black);
  --code-fg: var(--anti-flash-white);
}

/* ── Page chrome ──────────────────────────────────────────────────── */

* { box-sizing: border-box; }

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

body {
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4) var(--s-2);
}

/* ── Frame ────────────────────────────────────────────────────────── */

.demo-frame {
  width: 100%;
  max-width: 520px;
  background: var(--bg-paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  box-shadow: 6px 9px 0 var(--ink);
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────── */

.demo-header {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.demo-header__avatar {
  font-size: 22px;
  line-height: 1;
}

.demo-header__meta {
  flex: 1;
  min-width: 0;
}

.demo-header__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

.demo-header__subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ── Threat pill ──────────────────────────────────────────────────── */

.threat-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  white-space: nowrap;
  background: var(--bg-paper);
  color: var(--ink);
  flex-shrink: 0;
}
.threat-pill.safe   { background: var(--status-safe-bg);   border-color: var(--status-safe);   color: var(--ink); }
.threat-pill.warn   { background: var(--status-warn-bg);   border-color: var(--status-warn);   color: var(--ink); }
.threat-pill.danger { background: var(--status-danger-bg); border-color: var(--status-danger); color: var(--medium-pink); }
.threat-pill.breach { background: var(--status-breach-bg); border-color: var(--status-breach); color: var(--status-breach); animation: pillBlink 1.2s infinite; }
@keyframes pillBlink { 50% { opacity: 0.55; } }

/* ── Body / scroll area ───────────────────────────────────────────── */

.demo-body {
  padding: var(--s-2) var(--s-3);
  background: var(--bg-paper);
}

/* ── Chat bubbles ─────────────────────────────────────────────────── */

.bubble {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border: 0.5px solid var(--ink);
  border-radius: 0;
  background: var(--bg-paper);
  margin-bottom: var(--s-1);
  max-width: 85%;
  word-wrap: break-word;
}
.bubble.user {
  background: var(--ink);
  color: var(--anti-flash-white);
  margin-left: auto;
}
.bubble.bot {
  background: var(--bg-paper);
  color: var(--ink);
}

/* ── Typing dots ──────────────────────────────────────────────────── */

.typing-row {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  align-items: center;
}
.typing-row span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingDot 1.2s infinite;
}
.typing-row span:nth-child(2) { animation-delay: 0.15s; }
.typing-row span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0);     opacity: 0.45; }
  30%           { transform: translateY(-3px);  opacity: 1; }
}

/* ── Controls / play button ───────────────────────────────────────── */

.demo-controls {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.play-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  height: 37px;
  padding: 0 16px;
  background: var(--cta-light);
  color: var(--white);
  border: 0.5px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
  letter-spacing: 0.01em;
}
.play-btn:hover  { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.play-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.play-btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--ink); }

/* ── Progress (score / chain) ─────────────────────────────────────── */

.score-track {
  flex: 1;
  height: 6px;
  background: var(--bright-neutral-gray);
  border: 0.5px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.score-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--cta-light);
  width: 0;
  transition: width 0.3s ease;
}

/* ── Breach banner ────────────────────────────────────────────────── */

.breach-banner {
  display: none;
  padding: var(--s-2) var(--s-3);
  background: var(--status-breach-bg);
  border-top: 1px solid var(--status-breach);
  border-bottom: 1px solid var(--status-breach);
  color: var(--ink);
}
.breach-banner.is-visible { display: block; }
.breach-banner__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--status-breach);
  margin-bottom: 4px;
}
.breach-banner__body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
}
.breach-banner__notes {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 6px;
}

/* ── Blurred / redacted ───────────────────────────────────────────── */

.blurred {
  filter: blur(5px);
  user-select: none;
}

/* ── Code block (inspector mode) ──────────────────────────────────── */

.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: var(--s-1) var(--s-2);
  border: 0.5px solid var(--ink);
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Tiny labels (eyebrows, captions) ─────────────────────────────── */

.demo-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Headings inside frames ───────────────────────────────────────── */

.demo-h2,
.demo-h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}
.demo-h2 { font-size: 22px; line-height: 1.2; }
.demo-h3 { font-size: 18px; line-height: 1.2; }
.demo-h2 em, .demo-h3 em { font-weight: 500; font-style: italic; }
