/* ═══════════════════════════════════════════════════════════════
   VIRAL BRAIN · The Credit Brothers
   Hand-coded for Luis Carrillo · 2026-05-11
   Inheritors: Claude.ai left-nav · YSL restraint · Apple type · CapCut energy
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ink (refined from amber-yellow web2 to champagne luxury) */
  --ink-0:    #000000;
  --ink-1:    #0a0a0a;     /* canvas — YSL black */
  --ink-2:    #121212;     /* sidebar */
  --ink-3:    #181818;     /* card */
  --ink-4:    #1f1f1f;     /* elevated */
  --ink-line: #262626;     /* hairline */
  --ink-line-soft: #1d1d1d;

  /* text */
  --text-hi:  #f5f5f5;
  --text:     #d4d4d4;
  --text-lo:  #8a8a8a;
  --text-dim: #4a4a4a;

  /* ONE accent — champagne gold (Saint Laurent + Apple After Dark) */
  --gold:       #d4af37;
  --gold-soft:  rgba(212, 175, 55, 0.10);
  --gold-glow:  rgba(212, 175, 55, 0.18);

  /* status */
  --ok:   #6ed4a8;
  --warn: #e8c46a;
  --bad:  #d96363;

  /* fonts */
  --f-display: 'Fraunces', 'Times New Roman', serif;
  --f-body:    'IBM Plex Sans', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--ink-1);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 1400px 800px at 15% -20%, var(--gold-glow), transparent 60%),
    radial-gradient(ellipse 900px 500px at 100% 110%, rgba(217, 99, 99, 0.05), transparent 60%),
    var(--ink-1);
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═════════════════════ APP SHELL ═════════════════════ */
.app {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

/* ═════════════════════ LEFT NAV ═════════════════════ */
.nav {
  background: var(--ink-2);
  border-right: 1px solid var(--ink-line);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wm-line-1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  font-size: 36px;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--text-hi);
  background: linear-gradient(120deg, var(--text-hi) 0%, var(--gold) 50%, var(--text-hi) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 1.2s ease;
  cursor: default;
}
.wm-line-1:hover { background-position: 100% 50%; }
.wm-line-2 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}
.wm-line-3 {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1.6;
  margin-top: 4px;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  background: transparent;
  border: none;
  color: var(--text-lo);
  font-family: var(--f-body);
  font-size: 14px;
  text-align: left;
  padding: 14px 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: baseline;
  gap: 4px;
  transition: color 0.2s, background 0.2s;
  border-left: 2px solid transparent;
}
.nav-item:hover {
  color: var(--text);
  background: var(--ink-3);
}
.nav-item.active {
  color: var(--text-hi);
  background: var(--ink-3);
  border-left-color: var(--gold);
}
.nav-num {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--gold);
  line-height: 1;
}
.nav-label {
  font-weight: 500;
  letter-spacing: -0.005em;
}

.nav-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-lo);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
}
.dot.live {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.nav-meta {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* ═════════════════════ WORKSPACE ═════════════════════ */
.workspace {
  overflow-y: auto;
  padding: 56px 64px 80px;
  max-width: 1400px;
}
.workspace::-webkit-scrollbar { width: 8px; }
.workspace::-webkit-scrollbar-track { background: transparent; }
.workspace::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 4px; }

.tab { display: none; animation: fadeIn 0.4s ease-out; }
.tab.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-head {
  margin-bottom: 56px;
  max-width: 760px;
}
.tab-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.tab-title {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--text-hi);
  margin-bottom: 18px;
}
.tab-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}
.tab-sub {
  font-size: 16px;
  color: var(--text-lo);
  max-width: 640px;
}

/* ═════════════════════ BLOCK ═════════════════════ */
.block { margin-bottom: 48px; }
.block-head { margin-bottom: 20px; }
.block-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

/* ═════════════════════ TAB 1 · VIRALS ═════════════════════ */
.virals {
  display: flex;
  flex-direction: column;
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  overflow: hidden;
}
.viral {
  display: grid;
  grid-template-columns: 64px 130px 1fr 90px;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--ink-line-soft);
  cursor: pointer;
  transition: background 0.2s;
}
.viral:last-child { border-bottom: none; }
.viral:hover { background: var(--ink-4); }
.viral.open { background: var(--ink-4); }
.viral-rank {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  color: var(--gold);
  line-height: 1;
}
.viral-views {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.025em;
  color: var(--text-hi);
}
.viral-hook {
  font-family: var(--f-display);
  font-size: 15px;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
}
.viral-platform {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-lo);
  text-align: right;
}
.viral-script {
  grid-column: 1 / -1;
  display: none;
  padding: 20px 0 4px 88px;
  border-top: 1px dashed var(--ink-line);
  margin-top: 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  max-width: 900px;
}
.viral.open .viral-script { display: block; }

/* ═════════════════════ TAB 1 · HOOKS ═════════════════════ */
.hooks {
  display: flex;
  flex-direction: column;
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  overflow: hidden;
}
.hook {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--ink-line-soft);
  transition: background 0.2s;
}
.hook:last-child { border-bottom: none; }
.hook:hover { background: var(--ink-4); }
.hook-rank {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}
.hook-name {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.hook-example {
  font-size: 13px;
  font-style: italic;
  color: var(--text-lo);
}
.hook-views {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 800;
  font-size: 22px;
  color: var(--text-hi);
  letter-spacing: -0.025em;
}
.hook-uses {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-lo);
  margin-top: 2px;
  text-align: right;
}

/* ═════════════════════ TAB 2 · BUILD ═════════════════════ */
.build-pane { max-width: 900px; }

.build-input-card {
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 32px;
}
.build-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}
.build-input {
  width: 100%;
  background: var(--ink-1);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  padding: 16px 18px;
  color: var(--text-hi);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s, background 0.2s;
}
.build-input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ink-2);
}
.build-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

.build-options { margin-top: 24px; }
.build-option-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-lo);
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}
.build-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--ink-1);
  border: 1px solid var(--ink-line);
  border-radius: 4px;
  padding: 8px 14px;
  color: var(--text-lo);
  font-family: var(--f-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  color: var(--text);
  border-color: var(--gold);
}
.chip.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.build-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink-0);
  border: none;
  padding: 14px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  transition: transform 0.15s, background 0.15s;
}
.btn-primary:hover { background: #e0ba3e; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-icon { font-size: 16px; }
.btn-meta {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--ink-line);
  padding: 14px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 14px;
  transition: all 0.15s;
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-tiny {
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--text-lo);
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.15s;
}
.btn-tiny:hover { border-color: var(--gold); color: var(--gold); }

.build-output {
  background: var(--ink-3);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 28px;
}
.build-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-line);
}
.build-output-actions { display: flex; gap: 8px; }
.build-script {
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--text-hi);
  line-height: 1.7;
  white-space: pre-wrap;
  min-height: 60px;
}
.build-script .cursor::after {
  content: '▍';
  color: var(--gold);
  animation: blink 1s infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.build-citations {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--ink-line);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-lo);
}
.build-citations a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}

/* ═════════════════════ TAB 3 · FILMING QUEUE ═════════════════════ */
.queue-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.queue-card {
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  padding: 22px 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.queue-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.queue-num {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.queue-framework {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-lo);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.queue-topic {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 16px;
  color: var(--text-hi);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .nav {
    position: sticky; top: 0;
    border-right: none; border-bottom: 1px solid var(--ink-line);
    z-index: 10;
    padding: 24px 20px;
  }
  .nav-items { flex-direction: row; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .workspace { padding: 32px 20px 60px; overflow-y: visible; }
  body { overflow: auto; }
  .viral { grid-template-columns: 48px 1fr; gap: 16px; }
  .viral-views, .viral-platform { grid-column: 2; }
}
