/* SignalFractureCore: misma identidad que la portada (landing.css). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #f4f4f2;
  --card: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #44443f;
  --muted: #66665f;
  --line: #d9d9d4;
  --accent: #b3410e;
  --accent-ink: #8f3309;
  --accent-soft: #f6e9e1;
  --term-bg: #0b0f14;
  --term-line: #3b2f6b;
  --term-text: #c9d1dc;
  --term-accent: #b49cff;
  --font: 'Manrope', 'Segoe UI', system-ui, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 8px;
  --gutter: clamp(16px, 4vw, 64px);
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1312px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Cabecera y botones: iguales a la portada */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.top .name { font-weight: 700; color: var(--ink); }
.top .name a { color: inherit; }
.top .name .sub { color: var(--muted); font-weight: 500; }
.top nav { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 6px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
}
.btn:hover { text-decoration: none; background: #000; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(0,0,0,0.05); }

/* Zona principal */
.term { flex: 1 0 auto; display: flex; flex-direction: column; padding-bottom: 12px; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 32px; align-items: end; padding: 16px 0 18px 0; }
.intro .kicker { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.intro h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; max-width: 30ch; text-wrap: balance; }
.intro .lead { color: var(--ink-2); max-width: 70ch; margin-top: 8px; font-size: 15px; }
.intro .meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.7; white-space: nowrap; }
.intro .meta strong { color: var(--ink); font-weight: 700; }

/* Explicación desplegable */
.about { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px; margin-bottom: 14px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.about summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.about summary::before { content: "+"; display: inline-block; width: 16px; font-weight: 700; }
.about[open] summary::before { content: "–"; }
.about summary::-webkit-details-marker { display: none; }
.about summary:hover { text-decoration: underline; }
.about[open] summary { margin-bottom: 8px; }
.about p { margin-bottom: 8px; max-width: 100ch; }
.about p:last-child { margin-bottom: 4px; }
.about strong { color: var(--ink); }
.about code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); background: var(--paper); padding: 1px 5px; border-radius: 3px; }

/* Conversación: tarjeta blanca */
.log {
  flex: 0 1 auto; min-height: 260px; max-height: max(300px, calc(100vh - 470px)); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.banner { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.banner p { overflow-wrap: anywhere; }
.banner p.title { font-family: var(--mono); color: var(--ink); font-size: 13.5px; }
.banner p.title .star { color: var(--accent); font-weight: 700; margin-right: 6px; }
.banner strong { color: var(--ink); font-weight: 700; }
.dim { color: var(--muted); }

.line { display: flex; gap: 12px; padding: 5px 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.line .pre { flex-shrink: 0; width: 18px; text-align: center; color: var(--accent); font-weight: 700; }
.line .txt { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92ch; color: var(--ink-2); }
.line.user { background: var(--paper); border-radius: 6px; padding: 8px 12px; margin: 6px 0 2px 0; }
.line.user .txt { color: var(--ink); font-weight: 700; }
.line.bot .txt { color: var(--ink); }
.line .txt strong { color: var(--ink); font-weight: 700; }
.line.think .txt { color: var(--muted); }
.line.think .pre { animation: pulse 1s ease-in-out infinite; }
.line .txt.typing::after { content: ""; display: inline-block; width: 8px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .line.think .pre, .line .txt.typing::after { animation: none; } }

/* Sugerencias: botones fantasma de la portada */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 10px 0; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 6px; padding: 8px 12px; min-height: 38px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Entrada: el mismo bloque oscuro que el reclamo de la portada */
.entry {
  display: flex; gap: 12px; align-items: center;
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--term-line); border-radius: var(--r);
  padding: 8px 10px 8px 16px; margin-bottom: 8px;
  font-family: var(--mono);
}
.entry .caret { color: var(--term-accent); font-weight: 700; }
.inp { flex: 1 1 auto; min-width: 0; background: transparent; border: none; outline: none; color: #eef2f7; font: inherit; font-size: 15px; line-height: 1.5; padding: 8px 0; }
.inp::placeholder { color: #6b7889; }
.inp:focus-visible { outline: none; }
.entry:focus-within { border-color: var(--term-accent); box-shadow: 0 0 0 3px rgba(180, 156, 255, 0.25); }
.entry .chip { border-color: var(--term-accent); background: var(--term-accent); color: var(--term-bg); font-family: var(--font); }
.entry .chip:hover { background: #c9b8ff; color: var(--term-bg); }

.status { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Pie: igual a la portada */
footer.foot { margin-top: 12px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; }
  .intro .meta { text-align: left; white-space: normal; }
}
@media (max-width: 640px) {
  .log { padding: 14px 14px; min-height: 220px; max-height: 60vh; }
  .line { font-size: 13px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: 0 0 auto; }
  .entry { padding: 6px 8px 6px 12px; }
  .inp::placeholder { color: transparent; }
  .top nav .btn { padding: 8px 12px; }
}
