/* Firmum α — design tokens.
   Compiled Tailwind CSS (public/build/tailwind.css) handles utility classes;
   this file holds typography, theme variables, and component refinements
   that don't belong in utility-soup. Ports cleanly to a Twig project's
   global stylesheet. */

:root {
  /* Default: paper — warm off-white */
  --bg:        #f5f1e8;
  --bg-1:     #ebe6d9;
  --bg-2:     #ddd6c5;
  --bg-3:     #d0c8b3;
  --line:      #cbc3ad;
  --line-1:    #b8af96;
  --fg:        #1a1814;
  --fg-1:      #2c2a23;
  --fg-2:      #5c584c;
  --fg-3:      #807b6c;

  --accent:    #8b1f1f;        /* deep editorial red */
  --accent-1:  #a83333;
  --accent-faint: rgba(139, 31, 31, .08);

  --status-active:    #4a7a47;
  --status-suspended: #9c6d2a;
  --status-dissolved: #8c3e3e;
  --status-unknown:   #5c584c;

  --font-headline: 'Newsreader', ui-serif, Georgia, serif;
  --font-sans:     'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Density */
  --pad-y: 1.5rem;
  --pad-x: 2rem;
  --row-y: 1rem;
  --gap:   1.25rem;
}

[data-theme="dark"] {
  --bg:        #0d0d0d;
  --bg-1:     #131313;
  --bg-2:     #181818;
  --bg-3:     #1f1f1f;
  --line:      #262626;
  --line-1:    #2e2e2e;
  --fg:        #f5f4ef;
  --fg-1:      #d4d2cb;
  --fg-2:      #8a8881;
  --fg-3:      #5a5854;
  --accent:    #c4a55a;
  --accent-1:  #d8bb6e;
  --accent-faint: rgba(196, 165, 90, .12);
  --status-active:    #6fa86b;
  --status-suspended: #d1a155;
  --status-dissolved: #a85f5f;
  --status-unknown:   #8a8881;
}

[data-theme="paper"] {
  --bg:        #f5f1e8;
  --bg-1:     #ebe6d9;
  --bg-2:     #ddd6c5;
  --bg-3:     #d0c8b3;
  --line:      #cbc3ad;
  --line-1:    #b8af96;
  --fg:        #1a1814;
  --fg-1:      #2c2a23;
  --fg-2:      #5c584c;
  --fg-3:      #807b6c;
  --accent-faint: rgba(139, 31, 31, .08);
  --accent:    #8b1f1f;
  --accent-1:  #a83333;
}

[data-theme="ink"] {
  --bg:        #fafaf7;
  --bg-1:     #f1f1ec;
  --bg-2:     #e6e6e0;
  --bg-3:     #d8d8d1;
  --line:      #c8c8c0;
  --line-1:    #aeaea4;
  --fg:        #0a0a0a;
  --fg-1:      #1f1f1f;
  --fg-2:      #555;
  --fg-3:      #7e7e7e;
  --accent:    #1e3a5f;
  --accent-1:  #2c5285;
  --accent-faint: rgba(30, 58, 95, .10);
}

[data-theme="light"] {
  --bg:        #f5f1e8;
  --bg-1:     #ebe6d9;
  --bg-2:     #ddd6c5;
  --bg-3:     #d0c8b3;
  --line:      #cbc3ad;
  --line-1:    #b8af96;
  --fg:        #1a1814;
  --fg-1:      #2c2a23;
  --fg-2:      #5c584c;
  --fg-3:      #807b6c;
  --accent-faint: rgba(196, 165, 90, .18);
}

[data-density="compact"] {
  --pad-y: 1rem;
  --pad-x: 1.25rem;
  --row-y: 0.625rem;
  --gap: 0.875rem;
}

/* ── Account area: dark-terminal palette ──────────────────────────────────
   Used by templates/account/**. Tailwind color tokens are mapped to these
   --a-* variables (see tailwind.config.js). The account UI is always dark
   regardless of the public data-theme setting. */
:root {
  --a-cream:        #e8e3d4;   /* primary text — warm off-white */
  --a-cream-soft:   #9a9585;   /* secondary text */
  --a-flame:        #c4a55a;   /* accent — gold/amber */
  --a-flame-wash:   rgba(196,165,90,0.10); /* background tint for error/warning states */
  --a-hair:         #2a2520;   /* subtle border — very dark brown */
  --a-hair-3:       #3a3530;   /* slightly lighter border variant */
  --a-dim:          #5c5850;   /* muted text */
  --a-deep:         #0a0905;   /* darkest background */
  --a-elev:         #141210;   /* elevated surface (cards) */
  --a-pulse:        #4a7a47;   /* success / active green */
  --a-signal-amber: #b87333;   /* warning amber */
}

/* Headline family swap */
[data-headline="serif"] { --font-headline: 'Newsreader', ui-serif, Georgia, serif; }
[data-headline="sans"]  { --font-headline: 'Geist', ui-sans-serif, system-ui, sans-serif; }
[data-headline="mono"]  { --font-headline: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 15px;
  line-height: 1.5;
}

.font-headline { font-family: var(--font-headline); font-feature-settings: normal; }
.font-mono     { font-family: var(--font-mono); }

/* Headline: when serif, use larger sizes + tighter tracking */
[data-headline="serif"] h1.h-display,
[data-headline="serif"] h2.h-display { letter-spacing: -0.022em; font-weight: 500; }
[data-headline="mono"] h1.h-display,
[data-headline="mono"] h2.h-display { letter-spacing: -0.04em; font-weight: 500; text-transform: none; }
[data-headline="sans"] h1.h-display,
[data-headline="sans"] h2.h-display { letter-spacing: -0.03em; font-weight: 600; }

.h-display { font-family: var(--font-headline); line-height: 1.02; }

/* Focus rings: visible, accent-coloured, never invisible */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection */
::selection { background: var(--accent); color: #fff; }
[data-theme="dark"] ::selection { color: #0d0d0d; }

/* Numeric tabular by default for mono */
.font-mono, .tnum { font-variant-numeric: tabular-nums; }

/* Subtle hairline rule */
.rule { border-color: var(--line); }

/* α badge */
.alpha-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--accent-faint);
}

/* Status badge — colour + glyph, never colour alone (WCAG) */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.badge-status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge-active     { color: var(--status-active); }
.badge-suspended  { color: var(--status-suspended); }
.badge-dissolved  { color: var(--status-dissolved); }
.badge-unknown    { color: var(--status-unknown); }
.badge-dissolved::before { border-radius: 0; transform: rotate(45deg); }
.badge-suspended::before { border-radius: 0; }

/* Ticker — fine line at very top */
.ticker {
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-1);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.ticker-label {
  background: var(--accent);
  color: #fff;
  padding: 0 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ticker-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  animation: tickerPulse 1.4s ease-in-out infinite;
}
@keyframes tickerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.ticker-track {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: tickerScroll 180s linear infinite;
  padding-left: 2.5rem;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.ticker-item .sep { color: var(--fg-3); }
.ticker-item a { color: var(--accent-1); }
.ticker-item a:hover { text-decoration: underline; }

/* Hero stream */
.stream-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.stream-list {
  flex: 1;
  padding: 0.25rem 1.5rem 0.5rem;
}
.stream-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 1.25rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: streamIn 0.6s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  align-items: center;
}
.stream-line:first-child { border-top: 0; }
.stream-line .time {
  color: var(--accent-1);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.stream-line .pubid { color: var(--fg-3); font-size: 10.5px; letter-spacing: 0.04em; }
.stream-line .name  { color: var(--fg); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.stream-line .type  {
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--line-1);
  white-space: nowrap;
}
@keyframes streamIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stream-footer {
  border-top: 1px solid var(--line);
  padding: 0.875rem 1.5rem;
  display: flex;
  gap: 2rem;
  background: var(--bg-2);
  font-size: 12px;
}
.stream-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: streamPing 1.6s ease-out infinite;
}
@keyframes streamPing {
  0%   { box-shadow: 0 0 0 0 var(--accent-faint); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* NIPC input */
.nipc-input {
  font-family: var(--font-mono);
  font-size: 56px;
  letter-spacing: 0.06em;
  background: transparent;
  border: none;
  color: var(--fg);
  padding: 0.5rem 0;
  width: 100%;
  caret-color: var(--accent);
  outline: none;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}
.nipc-input::placeholder { color: var(--fg-3); font-weight: 400; }
.nipc-input.small {
  font-size: 24px;
  font-weight: 500;
}

/* NIPC form layout — input + submit button at parity */
.nipc-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0;
  border: 2px solid var(--fg);
  background: var(--bg-1);
  position: relative;
}
.nipc-form.small {
  border-width: 1px;
}
.nipc-form:focus-within {
  border-color: var(--accent);
}
.nipc-form .nipc-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.75rem 1.25rem;
  gap: 0.25rem;
  min-width: 0;
}
.nipc-form.small .nipc-field {
  padding: 0.75rem 1rem;
}
.nipc-form .nipc-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.nipc-form .nipc-meter {
  position: absolute;
  right: 7.5rem;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
}
.nipc-form.small .nipc-meter { display: none; }
.nipc-form .nipc-submit {
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-left: 2px solid var(--fg);
  padding: 0 2.25rem;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  display: flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}
.nipc-form.small .nipc-submit {
  padding: 0 1.25rem;
  font-size: 13px;
  border-left-width: 1px;
}
.nipc-form .nipc-submit:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
}
.nipc-form .nipc-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.nipc-form:focus-within .nipc-submit {
  background: var(--accent);
  color: #fff;
  border-left-color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.625rem 1rem;
  border: 1px solid var(--line-1);
  background: transparent;
  color: var(--fg);
  border-radius: 2px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.btn:hover { background: var(--bg-2); border-color: var(--fg-3); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover { color: #0d0d0d; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); }

/* Cards / panels */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.panel-hd {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.panel-bd { padding: 1rem 1.25rem; }

/* KPI numbers */
.kpi {
  font-family: var(--font-headline);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
[data-headline="mono"] .kpi { font-size: 40px; letter-spacing: -0.04em; }

/* Act type chip */
.act-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--bg-2);
  color: var(--fg-1);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.act-chip.key { color: var(--accent-1); border-color: var(--accent); background: var(--accent-faint); }

/* Act body text — used in the "Livro de actos" timeline rows.
   Readable prose width, comfortable line-height, clear secondary colour.
   The --raw variant (from raw_text fallback) uses a slightly muted colour
   to signal lower fidelity vs a fully-parsed summary. */
.act-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg-1);
  margin-bottom: 0.625rem;
  max-width: 72ch;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.act-text--raw {
  color: var(--fg-2);
}

/* Officers table — "Órgãos sociais em funções"
   Fixed layout gives predictable column widths. The name column gets the
   majority of the space; role and date columns are constrained. */
.officers-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.officers-table th {
  padding: 0.625rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}
.officers-table th.col-date { text-align: right; }
.officers-table td {
  padding: 0.875rem 1.25rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.officers-table tbody tr:last-child td { border-bottom: 0; }
/* Column widths: name takes remaining space, role and date are fixed */
.officers-table .col-name  { width: auto; }
.officers-table .col-role  { width: 140px; }
.officers-table .col-date  { width: 110px; text-align: right; }

/* Contact details inside the officers name cell */
.officer-contact {
  margin-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.officer-contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: 12px;
  line-height: 1.45;
}
.officer-contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-3);
  flex-shrink: 0;
  min-width: 68px;
}
.officer-contact-value {
  color: var(--fg-2);
  overflow-wrap: break-word;
  min-width: 0;
}

/* Timeline rail */
.timeline {
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6.5rem;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.tl-row:first-child { border-top: 0; }
.tl-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  padding-top: 2px;
  position: relative;
}
.tl-date::after {
  content: '';
  position: absolute;
  right: -1.625rem;
  top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg-3);
  border: 2px solid var(--bg);
}
.tl-row.key .tl-date::after { background: var(--accent); }

/* Links */
a.link {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line-1);
}
a.link:hover { border-bottom-color: var(--accent); color: var(--accent-1); }

a.link-mono {
  font-family: var(--font-mono);
  color: var(--accent-1);
}
a.link-mono:hover { text-decoration: underline; }

/* Section labels */
.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
}

/* Hairline divider */
.hairline { height: 1px; background: var(--line); }

/* Backfill bar */
.backfill-bar {
  position: relative;
  height: 4px;
  background: var(--bg-2);
  overflow: hidden;
}
.backfill-bar .fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
}

/* Pricing tier */
.tier {
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column;
  border-radius: 3px;
}
.tier.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-faint) 0%, var(--bg-1) 60%);
}

/* Sticky-y sidebar — top offset accounts for the full sticky top-bar
   (ticker ≈18px + header ≈76px = ≈94px) plus 1rem breathing room. */
.sticky-sidebar { position: sticky; top: 6.5rem; }

/* No-scroll for body when needed (tweaks panel doesn't need this; keep) */

/* Mobile reads — 360-414px */
@media (max-width: 720px) {
  .nipc-input { font-size: 28px; }
  .kpi { font-size: 36px; }
  .timeline::before { left: 5rem; }
  .tl-row { grid-template-columns: 5rem 1fr; gap: 0.75rem; }
  .stream-line { grid-template-columns: 60px 1fr; }
  .stream-line .pubid { display: none; }
}

/* Tooltip-ish field labels */
.field-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 0.25rem;
}
.field-value {
  font-size: 14px;
  color: var(--fg);
}
.field-value.large { font-size: 18px; font-family: var(--font-headline); }

/* "Pré-2006" banner */
.banner-pre2006 {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-left: 3px solid var(--accent);
  padding: 0.875rem 1.25rem;
  font-size: 13px;
  color: var(--fg-1);
}

/* Skip Tailwind preflight conflict on root */
#root { min-height: 100vh; display: flex; flex-direction: column; }

/* Container width */
.container-x { max-width: 1280px; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 1024px) { .container-x { padding-inline: 2rem; } }

/* Top-bar wrapper — sticks the entire ticker + nav block to the viewport top.
   Wrapping both elements in a single sticky container ensures they always
   render as a unit at the very top of the document (natural flow position = 0),
   which also fixes full-page screenshot tools that displace individual sticky
   elements mid-page. z-index: 50 keeps the block above all content panels. */
.top-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Site header — no longer individually sticky; inherits from .top-bar-wrap */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.nav-link {
  font-size: 13px;
  color: var(--fg-1);
  padding: 0.5rem 0.75rem;
  border-radius: 2px;
}
.nav-link:hover { color: var(--fg); background: var(--bg-2); }
.nav-link.active { color: var(--accent-1); }

/* Person-graph card */
.pg-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
}
.pg-card.historic { opacity: 0.78; }

/* ─────────────────────────────────────────────────────────────────────────
   CINEMA HERO — always-dark, full-bleed dramatic intro
   ────────────────────────────────────────────────────────────────────── */

.cinema-root {
  --c-bg: #050505;
  --c-bg-1: #0c0c0c;
  --c-fg: #f6f3eb;
  --c-fg-2: #8c887e;
  --c-fg-3: #595550;
  --c-line: #1b1b1b;
  --c-accent: #c4a55a;
  background: var(--c-bg);
  color: var(--c-fg);
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  font-family: var(--font-sans);
}

.cinema-wall {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.cinema-act {
  position: absolute;
  top: 100%;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--c-fg);
  letter-spacing: 0.04em;
  transform: translate(-50%, 0);
  pointer-events: none;
  display: inline-flex;
  gap: 1.25rem;
  align-items: baseline;
  animation-name: cinemaDrift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
@keyframes cinemaDrift {
  from { transform: translate(-50%, 0); }
  to   { transform: translate(-50%, calc(-100vh - 200%)); }
}
.cinema-act-time { color: var(--c-accent); }
.cinema-act-pub { color: var(--c-fg-3); font-size: 0.85em; }
.cinema-act-name { color: var(--c-fg); }
.cinema-act-type {
  color: var(--c-fg-2);
  text-transform: uppercase;
  font-size: 0.78em;
  letter-spacing: 0.12em;
  padding: 1px 6px;
  border: 1px solid var(--c-line);
}
.cinema-fade-top, .cinema-fade-bot, .cinema-fade-l, .cinema-fade-r {
  position: absolute;
  pointer-events: none;
}
.cinema-fade-top { top: 0; left: 0; right: 0; height: 30%; background: linear-gradient(to bottom, var(--c-bg) 0%, rgba(5,5,5,0.85) 55%, transparent 100%); }
.cinema-fade-bot { bottom: 0; left: 0; right: 0; height: 35%; background: linear-gradient(to top, var(--c-bg), transparent); }
.cinema-fade-l { top: 0; bottom: 0; left: 0; width: 16%; background: linear-gradient(to right, var(--c-bg), transparent); }
.cinema-fade-r { top: 0; bottom: 0; right: 0; width: 16%; background: linear-gradient(to left, var(--c-bg), transparent); }

.cinema-glow {
  position: absolute;
  top: 38%; left: 50%;
  width: 880px; height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(196, 165, 90, 0.16) 0%, rgba(196, 165, 90, 0.04) 32%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Dark centred suppressor — dims wall particles behind the stage content zone.
   Sits at z-index 1 (above wall z:0, below stage z:3) so text remains fully
   legible while particles are pushed to near-invisible in the content area. */
.cinema-stage-mask {
  position: absolute;
  top: 0; left: 50%;
  width: min(960px, 100%);
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 70% 58% at 50% 40%,
    rgba(5,5,5,0.72) 0%,
    rgba(5,5,5,0.45) 38%,
    transparent 68%);
  pointer-events: none;
  z-index: 1;
}

.cinema-corner {
  position: absolute;
  top: 1.75rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cinema-corner.tl { left: 2rem; }
.cinema-corner.tr { right: 2rem; align-items: flex-end; }

.cinema-corner-stat { font-family: var(--font-mono); min-width: 180px; }
.cinema-corner-stat.right { text-align: right; }
.cinema-corner-l {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-fg-3);
  margin-bottom: 3px;
}
.cinema-corner-v {
  font-size: 15px;
  color: var(--c-fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.cinema-corner-bar {
  margin-top: 6px;
  height: 1px;
  background: var(--c-line);
  position: relative;
}
.cinema-corner-bar > div {
  height: 100%;
  background: var(--c-accent);
  transition: width 800ms ease-out;
}

.cinema-stage {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 6vh 2rem 4vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
  text-align: center;
  justify-content: center;
}

.cinema-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-fg-2);
}
.cinema-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 0 var(--c-accent);
  animation: cinemaPing 1.6s ease-out infinite;
}
@keyframes cinemaPing {
  0%   { box-shadow: 0 0 0 0 rgba(196,165,90,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(196,165,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(196,165,90,0); }
}

.cinema-headline {
  font-family: 'Newsreader', ui-serif, Georgia, serif;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 400;
  color: var(--c-fg);
  margin: 0;
  max-width: 22ch;
  margin-inline: auto;
}
.cinema-caret {
  display: inline-block;
  color: var(--c-accent);
  animation: caretBlink 700ms steps(1) infinite;
  margin-left: 4px;
  font-weight: 300;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.cinema-tagline {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-fg-2);
  max-width: 56ch;
  margin: 0 auto;
}

.cinema-nipc {
  margin: 0 auto;
  width: 100%;
  max-width: 720px;
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid #2a2620;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(196,165,90,0.05);
  text-align: left;
}
.cinema-nipc.shake { animation: cinemaShake 0.42s; }
@keyframes cinemaShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.cinema-nipc-label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid #1d1d1d;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-fg-3);
}
.cinema-prefix { color: var(--c-accent); }
.cinema-nipc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
}
.cinema-nipc-input {
  background: transparent;
  border: none;
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: clamp(34px, 5.4vw, 64px);
  letter-spacing: 0.06em;
  padding: 1.25rem 1.5rem;
  outline: none;
  font-variant-numeric: tabular-nums;
  caret-color: var(--c-accent);
  font-weight: 500;
  width: 100%;
  min-width: 0;
}
.cinema-nipc-input::placeholder { color: #3a3631; }
.cinema-nipc-submit {
  background: var(--c-accent);
  color: #0a0a0a;
  border: none;
  padding: 0 2rem;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  transition: filter 120ms;
  white-space: nowrap;
}
.cinema-nipc-submit:hover { filter: brightness(1.08); }
.cinema-nipc-submit:disabled {
  background: #1d1b16;
  color: #58544a;
  cursor: not-allowed;
}
.cinema-nipc-helper {
  display: flex; gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--c-fg-3);
  letter-spacing: 0.08em;
  border-top: 1px solid #1a1a1a;
  align-items: center;
}
.cinema-nipc-helper button { background: transparent; border: 0; color: inherit; cursor: pointer; }

.cinema-examples {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  align-items: center;
  margin-top: 0.75rem;
}
.cinema-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.75rem;
  border: 1px solid #2a2620;
  color: var(--c-fg);
  background: rgba(20,18,14,0.6);
  text-decoration: none;
  transition: border-color 120ms, color 120ms;
}
.cinema-chip:hover { border-color: var(--c-accent); color: var(--c-accent); }

.cinema-kpis {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #161616;
  background: rgba(5,5,5,0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.cinema-kpi {
  padding: 1.25rem 1.5rem;
  border-right: 1px solid #161616;
  font-family: var(--font-mono);
}
.cinema-kpi:last-child { border-right: 0; }
.cinema-kpi-l {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-fg-3);
  margin-bottom: 6px;
}
.cinema-kpi-v {
  font-family: 'Newsreader', ui-serif, Georgia, serif;
  font-size: clamp(22px, 3vw, 36px);
  color: var(--c-fg);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.cinema-kpi-bar {
  margin-top: 8px;
  height: 1px;
  background: #1d1d1d;
}
.cinema-kpi-bar > div {
  height: 100%;
  background: var(--c-accent);
}

.cinema-scroll {
  position: absolute;
  bottom: calc(120px + 1.25rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-fg-3);
  text-decoration: none;
}
.cinema-scroll-arrow { font-size: 14px; animation: scrollDown 1.6s ease-in-out infinite; }
@keyframes scrollDown { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(4px); opacity: 1; } }

/* Hide the floating scroll hint at viewports ≤1359px.
   At these widths the cinema-stage content (including the examples strip)
   grows tall enough that the absolute-positioned scroll arrow collides with
   the .cinema-examples chip row (confirmed overlap at 1280×720: 33px, and
   at 375×812: 42px). The hint is decorative — omitting it at compact widths
   causes no functional regression. It reappears at ≥1360px where measured
   gap to the closest element is always ≥40px. */
@media (max-width: 1359px) {
  .cinema-scroll { display: none; }
}

@media (max-width: 900px) {
  .cinema-corner.tl, .cinema-corner.tr { display: none; }
  .cinema-kpis { grid-template-columns: repeat(2, 1fr); }
  .cinema-kpi:nth-child(2) { border-right: 0; }
  .cinema-kpi:nth-child(1), .cinema-kpi:nth-child(2) { border-bottom: 1px solid #161616; }
  .cinema-nipc-row { grid-template-columns: 1fr; }
  .cinema-nipc-submit { padding: 1rem; justify-content: center; }
  /* KPI strip is 2×2 at ≤900px — taller (~232px). */
  .cinema-stage { padding: 4vh 1.5rem 3vh; gap: 1rem; }
}

/* ─────────────────────────────────────────────────────────────────────────
   COMMAND PALETTE (Cmd+K)
   ────────────────────────────────────────────────────────────────────── */

.cmdk-scrim[hidden] { display: none !important; }
.cmdk-scrim {
  position: fixed; inset: 0;
  z-index: 2147483600;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: cmdkIn 140ms ease-out;
}
@keyframes cmdkIn { from { opacity: 0; } to { opacity: 1; } }
.cmdk-panel {
  width: min(640px, calc(100vw - 2rem));
  background: var(--bg);
  border: 1px solid var(--line-1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--line);
}
.cmdk-prompt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}
.cmdk-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--fg);
}
.cmdk-input::placeholder { color: var(--fg-3); }
.cmdk-hint, .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  border: 1px solid var(--line-1);
  padding: 2px 6px;
  background: var(--bg-1);
}
.cmdk-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem 0;
}
.cmdk-empty {
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--fg-2);
  font-size: 13px;
}
.cmdk-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: baseline;
  gap: 0.875rem;
  padding: 0.625rem 1.125rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.cmdk-item.active {
  background: var(--bg-1);
  border-left-color: var(--accent);
}
.cmdk-kind {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  border: 1px solid var(--line-1);
  padding: 2px 6px;
  background: var(--bg-1);
  min-width: 44px;
  text-align: center;
}
.cmdk-item.active .cmdk-kind { border-color: var(--accent); color: var(--accent-1); }
.cmdk-kind.kind-empresa { }
.cmdk-kind.kind-pessoa { }
.cmdk-kind.kind-pagina { }
.cmdk-title {
  font-size: 14px;
  color: var(--fg);
}
.cmdk-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  text-align: right;
}
.cmdk-go {
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-size: 12px;
}
.cmdk-item.active .cmdk-go { color: var(--accent); }
.cmdk-foot {
  border-top: 1px solid var(--line);
  padding: 0.625rem 1.125rem;
  display: flex; gap: 0.75rem; align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-2);
  letter-spacing: 0.06em;
  background: var(--bg-1);
}

/* CmdK trigger in header */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 0.375rem 0.75rem 0.375rem 0.875rem;
  color: var(--fg-2);
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.cmdk-trigger:hover { border-color: var(--fg-3); color: var(--fg); }

/* ─────────────────────────────────────────────────────────────────────────
   2nd-degree NETWORK · full-width, zoomable
   ────────────────────────────────────────────────────────────────────── */

.net-full {
  border: 1px solid var(--line);
  background: var(--bg);
  width: 100%;
  display: flex;
  flex-direction: column;
}

.net-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.875rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.net-toolbar-r {
  display: flex; align-items: center; gap: 0.25rem;
}
.net-tool-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
  background: var(--bg);
  border: 1px solid var(--line-1);
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  min-width: 28px;
  line-height: 1;
}
.net-tool-btn:hover { border-color: var(--accent); color: var(--accent-1); }

.net-canvas {
  position: relative;
  background: var(--bg);
  cursor: grab;
}
.net-canvas.is-dragging { cursor: grabbing; }
.net-canvas .net-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  background:
    radial-gradient(ellipse at center, var(--bg) 55%, var(--bg-1) 100%);
}

.net-hud {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  padding: 0.75rem 0.875rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  pointer-events: none;
}
[data-theme="dark"] .net-hud { background: rgba(13,13,13,0.85); }
.net-hud-row {
  display: flex; align-items: center; gap: 0.625rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-1);
}
.net-sw {
  width: 14px; height: 3px;
  background: var(--fg-2);
}
.net-sw.sq {
  width: 10px; height: 10px;
  border: 1.5px solid var(--fg-2);
}
.net-sw.sq.solid { background: var(--accent); border-color: var(--accent); }
.net-sw.sq.hollow { background: var(--bg-1); border-color: var(--line-1); }
.net-sw.round {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-1);
  background: var(--bg);
}

.net-strip {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
}
@media (max-width: 920px) {
  .net-strip { grid-template-columns: 1fr; }
}
.net-strip-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-right: 1px solid var(--line);
}
.net-strip-stat {
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg);
}
.net-strip-stat:last-child { border-right: 0; }
.net-stat-l {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.kpi-small {
  font-family: var(--font-headline);
  font-size: 32px;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1;
}
.net-strip-detail, .net-strip-list {
  padding: 1.5rem 1.75rem;
}
.net-strip-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1180px) {
  .net-strip-list { grid-template-columns: 1fr; gap: 1.25rem; }
}
.net-col-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg);
  text-decoration: none;
  transition: border-color 120ms, background 120ms;
}
.net-col-item:hover {
  border-color: var(--accent);
  background: var(--bg);
}
.net-col-tick {
  width: 4px; height: 28px;
  display: block;
  flex-shrink: 0;
}

/* Legacy wrap kept for any old call sites */
.net-wrap { display: none; }

/* PT atlas / map */
.pt-map { display: block; }
.pt-map text { user-select: none; }

/* Orbit graph */
.orbit-wrap {
  background: var(--bg);
  border: 1px solid var(--line);
}
.orbit-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg);
}
.orbit-legend {
  border-top: 1px solid var(--line);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-1);
  font-size: 12px;
}

/* Pretty tabs for person-graph variants */
.tabs {
  display: inline-flex;
  border: 1px solid var(--line-1);
  background: var(--bg-1);
}
.tabs .tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  padding: 0.5rem 0.875rem;
  border-right: 1px solid var(--line-1);
  cursor: pointer;
  background: transparent;
  border-top: none; border-bottom: none; border-left: none;
}
.tabs .tab:last-child { border-right: none; }
.tabs .tab:hover { color: var(--fg); }
.tabs .tab.active {
  color: var(--accent-1);
  background: var(--bg);
  box-shadow: inset 0 -2px 0 var(--accent);
}
