/* Hamsa landing — frozen identity ev-1 "Evidence sheet" (brutalist, product-coherent).
   Mobile-first: base rules target 320px with no media queries; ascending min-width
   blocks add only space, columns, or scale. Radius 0, 2px structural borders, no
   elevation. All text pairs >= 4.5:1 (see evidence/identity.json). */

:root {
  --surface: #ffffff;
  --surface-tint: #f4f2ef;
  --ink: #111827;
  --ink-muted: #4b5563;
  --border: #111827;
  --border-soft: #d1d5db;
  --accent: #c84a3a;
  --accent-hover: #a83a2c;
  --accent-display: #dd614c;
  --ok-bg: #e6f4ea;
  --ok-fg: #14532d;
  --ok-border: #1b7a3d;
  --bad-bg: #fdebea;
  --bad-fg: #7f1d1d;
  --bad-border: #b3261e;
  --unsure-bg: #fbf3dc;
  --unsure-fg: #713f12;
  --unsure-border: #8a5a0b;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

h1 { font-size: clamp(1.9rem, 5.5vw + 1rem, 3.4rem); letter-spacing: -0.02em; }

h2 {
  font-size: clamp(1.5rem, 3vw + 0.9rem, 2.25rem);
  letter-spacing: -0.01em;
}

h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

a { color: var(--accent); }

.container { padding-inline: 16px; }

/* Focus visibility (keyboard) */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  background: var(--ink);
  color: var(--surface);
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus-visible { top: 8px; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mark {
  width: 14px;
  height: 14px;
  background: var(--accent-display);
  border: 2px solid var(--border);
}

.lang-toggle { display: flex; }

.lang-btn {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  cursor: pointer;
}

.lang-btn + .lang-btn { border-left: 0; }

.lang-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: block;
  padding: 14px 20px;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--surface-tint); }

/* ── Hero + mock (smallest width: stacked) ──────────────── */
.hero { padding-block: 40px; }

.hero-sub { font-size: 1.0625rem; color: var(--ink-muted); max-width: 34em; }

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* ── Mock ───────────────────────────────────────────────── */
.mock {
  padding-block: 8px 48px;
  background: var(--surface-tint);
  border-block: 2px solid var(--border);
}

.mock-title { margin-bottom: 16px; }

.player-mock {
  background: var(--surface);
  border: 2px solid var(--border);
  font-size: 1em;
}

.player-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.player-mock .player-video {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.6)),
    url("assets/debate.png");
  background-size: cover;
  background-position: center;
}

.live-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  border: 2px solid var(--accent-display);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-display);
}

.player-caption { font-size: 0.875rem; color: var(--surface); margin: 0; }

.player-timecode {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--surface);
}

.player-panes { display: grid; }

.pane { padding: 12px; }

.pane + .pane { border-top: 2px solid var(--border); }

.pane-head {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.tc { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-muted); }

.spk {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  align-self: center;
}

.row-live { animation: row-in 2.4s ease-in-out infinite alternate; }

.player-mock:hover .row-live,
.player-mock:focus-within .row-live { animation-play-state: paused; }

@keyframes row-in {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .row-live { animation: none; }
}

.note {
  border: 2px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.note:last-child { margin-bottom: 0; }

.note-refute { border-color: var(--bad-border); }

.note-unsure { border-color: var(--unsure-border); }

.note-support { border-color: var(--ok-border); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 2px solid var(--border);
  margin: 0 0 8px;
}

.chip-support { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-border); }

.chip-refute { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-border); }

.chip-unsure { background: var(--unsure-bg); color: var(--unsure-fg); border-color: var(--unsure-border); }

.note-claim { font-size: 0.875rem; margin: 0 0 6px; }

.note-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-muted);
}

.note-meta .pct { font-size: 0.8125rem; font-weight: 700; color: var(--ink); }

/* ── How ────────────────────────────────────────────────── */
.how { padding-block: 48px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
}

.step h3 { margin-bottom: 0.25em; }

.step p { margin: 0; color: var(--ink-muted); }

/* ── Who ────────────────────────────────────────────────── */
.who {
  padding-block: 48px;
  background: var(--surface-tint);
  border-block: 2px solid var(--border);
}

.cards { display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 20px;
}

.card h3 { margin-bottom: 0.25em; }

.card p { margin: 0; color: var(--ink-muted); }

/* ── Privacy ────────────────────────────────────────────── */
.privacy { padding-block: 48px; }

.privacy-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.privacy-list li {
  padding-left: 22px;
  position: relative;
}

.privacy-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--accent-display);
  border: 2px solid var(--border);
}

/* ── Elevator pitch (plan 91) ───────────────────────────── */
.pitch {
  border-top: 2px solid var(--border);
  padding-block: 48px;
}

.pitch h2 { margin-top: 0; }

.pitch-doc {
  max-width: 38em;
  color: var(--ink-muted);
}

.pitch-doc[hidden] { display: none; }

.pitch-doc h3 {
  font-size: 1.125rem;
  color: var(--ink);
  margin: 32px 0 8px;
}

.pitch-doc h4 {
  font-size: 1rem;
  color: var(--ink);
  margin: 24px 0 8px;
}

.pitch-doc p { margin: 0 0 12px; }

.pitch-doc blockquote {
  margin: 0 0 24px;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}

.pitch-doc ul,
.pitch-doc ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.pitch-doc li {
  margin: 0 0 8px;
  position: relative;
}

.pitch-doc ul li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--accent-display);
  border: 2px solid var(--border);
}

.pitch-doc ol { list-style: none; counter-reset: pitch-ol; padding-left: 28px; }

.pitch-doc ol li { counter-increment: pitch-ol; }

.pitch-doc ol li::before {
  content: counter(pitch-ol);
  position: absolute;
  left: -28px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
}

.pitch-doc hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 24px 0;
}

.pitch-doc a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 2px solid var(--border);
  background: var(--surface-tint);
  padding-block: 48px;
  text-align: left;
}

.footer-line { max-width: 34em; }

.site-footer .btn { display: inline-block; margin-bottom: 24px; }

.copyright {
  margin: 24px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ── Try Hamsa (interactive replay, plan 70) ─────────────────── */
.try {
  padding-block: 48px;
  border-bottom: 2px solid var(--border);
}

.try-sub { max-width: 34em; }

.try-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 24px 0;
}

.try-card,
.try-card:link {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.try-card:hover { background: var(--surface-tint); }

.try-card[aria-current="true"] { background: var(--surface-tint); }

/* Language-matched demo card: only the matching demo shows (EN→EN, PT→PT. */
.try-card[hidden] { display: none; }

.try-card[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.try-card-title {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.try-card-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.try-card-chips .chip { margin: 0; }

.try-card-note {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.try-viewer { margin-top: 24px; }

.try-viewer[hidden] { display: none; }

.try-media {
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
}

.try-media::before {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.demo-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  background: var(--ink);
  border: 2px solid var(--surface);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 8px;
}

.try-media-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--surface);
  margin: 0 0 2px;
}

.try-media-caption {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.try-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.try-media--video::before,
.try-media--video .try-media-title,
.try-media--video .try-media-caption { display: none; }

/* Plan 79: file-session poster — a real video frame as the media
   background; only the ▶ placeholder is hidden (title/caption stay). */
.try-media--poster {
  background-size: cover;
  background-position: center;
}

.try-media--poster::before { display: none; }

.try-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-top: 2px solid var(--border);
}

.try-controls .btn { padding: 8px 16px; font-size: 0.875rem; }

.try-timecode {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
}

.try-rows .row { transition: background 0.15s ease; }

.row--active {
  background: var(--surface-tint);
  outline: 2px solid var(--border);
}

.try-error {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--bad-fg);
  background: var(--bad-bg);
  border: 2px solid var(--bad-border);
  padding: 8px 12px;
}

.try-error[hidden] { display: none; }

/* ── Demo page (hash-route replay — plan 76 fix) ─────────── */
.demo {
  border-top: 2px solid var(--border);
  padding-block: 48px;
}

#demo[hidden],
.lead[hidden],
main > section[hidden] { display: none; }

.demo-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.demo-close { flex: none; }

.demo-title { margin: 0; font-size: 1.25rem; }

.demo-provenance {
  margin: 0 0 24px;
  max-width: 34em;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* Plan 79: shared files row (transcript + factchecks) under the
   provenance note; hidden when the session shares no files. */
.demo-files {
  margin: -16px 0 24px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.demo-files a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-files a + a::before {
  content: " · ";
  color: var(--ink-muted);
}

.demo-files[hidden] { display: none; }

.demo .try-viewer { margin-top: 0; }

.note--revealed { animation: note-in 0.35s ease; }

@keyframes note-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .try-rows .row { transition: none; }
  .note--revealed { animation: none; }
}

/* ── Sessions list (plan 78) ─────────────────────────────────── */
.sessions { padding-block: 48px; }

.sessions-sub { max-width: 34em; color: var(--ink-muted); }

.session-list { display: grid; gap: 12px; margin-top: 24px; }

.session-row {
  display: block;
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
}

.session-row:hover { background: var(--surface-tint); }

.session-row-title { display: block; font-weight: 700; margin-bottom: 8px; }

.session-row-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.session-row-chips .chip { margin: 0; }

.session-row-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.try-all { display: inline-block; margin-top: 12px; }

/* ── 480px: wider gutters, capped line length (recorded) ── */
@media (min-width: 480px) {
  .container { padding-inline: 24px; }

  .try-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px: mock panes side by side; who cards in columns ─ */
@media (min-width: 768px) {
  .container { padding-inline: 32px; }

  .player-panes { grid-template-columns: 1fr 1fr; }

  .pane + .pane { border-top: 0; border-left: 2px solid var(--border); }

  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* ── 1024px: hero text + mock side by side; how in columns;
      container capped and centered ───────────────────────── */
@media (min-width: 1024px) {
  .container { padding-inline: 32px; max-width: 1100px; margin-inline: auto; }

  .lead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
    align-items: start;
  }

  .lead > .hero { padding-block: 96px; }

  .lead > .mock {
    padding-block: 96px 64px;
    border-block: 0;
    border-left: 2px solid var(--border);
  }

  /* mock pane sits in a narrower column again — stack panes */
  .player-panes { grid-template-columns: 1fr; }

  .pane + .pane { border-top: 2px solid var(--border); border-left: 0; }

  /* plan 70: the TRY HAMSA replays keep panes side-by-side on wide screens */
  .try-viewer .player-panes { grid-template-columns: 1fr 1fr; }

  .try-viewer .pane + .pane {
    border-top: 0;
    border-left: 2px solid var(--border);
  }

  .hero-actions {
    flex-direction: row;
    align-items: center;
  }

  .hero-actions .btn { display: inline-block; }

  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* ── 1440px: wider gutters, slight scale-up of the mock ─── */
@media (min-width: 1440px) {
  .container { padding-inline: 64px; }

  .player-mock { font-size: 1.0625em; }
}
