/* Terminal State library skin — carbon fibre, a burning orange skyline, violet smog. 2089.
   Structure: lib_skin.css. Body class: .lk-trmnl. */

.lk-trmnl {
  --lk-bg: #07060a;
  --lk-panel-a: #16131c;
  --lk-panel-b: #0c0a10;
  --lk-line: rgba(255, 138, 31, 0.18);
  --lk-line-strong: rgba(255, 138, 31, 0.42);
  --lk-accent: #ff8a1f;
  --lk-accent-2: #ff3d2e;
  --lk-violet: #9b6cff;
  --lk-ink: #0d0806;
  --lk-title: #fbf3ea;
  --lk-text: #dcd3d0;
  --lk-dim: #9a8f99;
  --lk-head: "Saira Condensed", "Bahnschrift SemiBold Condensed", "Arial Narrow", sans-serif;
  --lk-radius: 4px;
  --lk-fire: linear-gradient(100deg, #ffd166 0%, #ff8a1f 35%, #ff3d2e 75%, #c81d4e 100%);
  --lk-carbon:
    linear-gradient(27deg, #0f0e12 5px, transparent 5px) 0 5px / 20px 20px,
    linear-gradient(207deg, #0f0e12 5px, transparent 5px) 10px 0 / 20px 20px,
    linear-gradient(27deg, #19171d 5px, transparent 5px) 0 10px / 20px 20px,
    linear-gradient(207deg, #19171d 5px, transparent 5px) 10px 5px / 20px 20px,
    linear-gradient(90deg, #141217 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#1a181e 25%, #161419 25%, #161419 50%, transparent 50%, transparent 75%, #1d1b21 75%, #1d1b21) 0 0 / 20px 20px,
    #131116;
  --lk-page-bg:
    radial-gradient(900px 520px at 100% -8%, rgba(155, 108, 255, 0.14), transparent 60%),
    radial-gradient(800px 420px at 0% 110%, rgba(255, 61, 46, 0.10), transparent 60%),
    #07060a;
  --lk-table-bg: rgba(13, 11, 16, 0.92);
  --tbl-line: rgba(255, 138, 31, 0.12);
  --tbl-line-strong: rgba(255, 138, 31, 0.32);
  --tbl-head: #1b1418;
  --tbl-stripe: rgba(255, 255, 255, 0.022);
  --tbl-hover: rgba(155, 108, 255, 0.07);
  --tbl-group: rgba(255, 61, 46, 0.12);
  --link: #ffab5e;
}

/* Sidebar */
.lk-trmnl .sidebar { background: linear-gradient(180deg, #110e15, #08070b); }
.lk-trmnl .sidebar .nav-group-title { font-family: var(--lk-head); font-weight: 800; font-size: 0.9rem; letter-spacing: 0.14em; text-transform: uppercase; font-style: italic; color: var(--lk-title); }
.lk-trmnl .sidebar .nav-group-title::before { color: var(--lk-accent); }
.lk-trmnl .sidebar .nav-link:hover,
.lk-trmnl .sidebar .nav-link.active { color: var(--lk-accent); background: rgba(255, 138, 31, 0.08); box-shadow: inset 3px 0 0 var(--lk-accent-2); }

/* Hero: smog sky, light trails, carbon floor */
.lk-trmnl .lk-hero {
  border: 1px solid rgba(255, 138, 31, 0.3);
  background:
    radial-gradient(55% 90% at 78% 0%, rgba(155, 108, 255, 0.45), transparent 70%),
    radial-gradient(40% 60% at 95% 30%, rgba(79, 140, 255, 0.25), transparent 70%),
    linear-gradient(180deg, #1a1226 0%, #120d18 55%, #0b090e 100%);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 138, 31, 0.4);
}
.lk-trmnl .lk-deco-a {
  /* light trails */
  left: -10%;
  right: -10%;
  top: 46%;
  height: 120px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.9) 30%, rgba(255, 61, 46, 0.7) 60%, transparent) 0 18px / 100% 2px no-repeat,
    linear-gradient(90deg, transparent 10%, rgba(255, 138, 31, 0.8) 40%, transparent 80%) 0 46px / 100% 3px no-repeat,
    linear-gradient(90deg, transparent 30%, rgba(255, 61, 46, 0.7) 60%, transparent) 0 70px / 100% 2px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 138, 31, 0.5) 50%, transparent) 0 96px / 100% 1px no-repeat;
  transform: rotate(-9deg);
  filter: blur(0.6px) drop-shadow(0 0 6px rgba(255, 120, 40, 0.8));
  opacity: 0.55;
}
.lk-trmnl .lk-deco-b {
  /* carbon fibre floor with a hot edge */
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: var(--lk-carbon);
  border-top: 1px solid rgba(255, 138, 31, 0.55);
  box-shadow: 0 -8px 30px rgba(255, 90, 30, 0.18);
  opacity: 0.92;
}
.lk-trmnl .lk-watermark {
  right: 250px;
  top: 6px;
  font-family: var(--lk-head);
  font-weight: 800;
  font-style: italic;
  font-size: 8rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.09);
}
.lk-trmnl .lk-kicker { color: var(--lk-violet); font-family: var(--lk-head); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.3em; }
.lk-trmnl .lk-cursor { width: 0; height: 0; border-left: 9px solid var(--lk-accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.lk-trmnl .lk-title {
  font-weight: 800;
  font-style: italic;
  font-size: clamp(2.5rem, 6.4vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transform: skewX(-6deg);
  transform-origin: left bottom;
}
.lk-trmnl .lk-title .lk-accent {
  background: var(--lk-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 90, 30, 0.45));
}
.lk-trmnl .lk-lede { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.lk-trmnl .lk-tags li {
  padding: 4px 14px;
  background: rgba(10, 8, 12, 0.85);
  border: 1px solid rgba(255, 138, 31, 0.4);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  font-family: var(--lk-head);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lk-trmnl .lk-tags strong { color: var(--lk-accent); }

/* Poster: VX2 citizen ID badge */
.lk-trmnl .lk-poster {
  width: 196px;
  padding: 0 0 12px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #1d1922, #0f0d12);
  border: 1px solid rgba(255, 138, 31, 0.5);
  transform: rotate(-2deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(0, 0, 0, 0.35);
}
.lk-trmnl .lk-poster::before {
  content: "VX2 · CITIZEN ID";
  display: block;
  padding: 6px 12px;
  font-family: var(--lk-head);
  font-weight: 800;
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--lk-ink);
  background: var(--lk-fire);
}
.lk-trmnl .lk-poster-frame { margin: 10px 12px 0; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px; }
.lk-trmnl .lk-poster img { height: 196px; filter: saturate(1.15) contrast(1.05); }
.lk-trmnl .lk-poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(255, 61, 46, 0.35));
  mix-blend-mode: screen;
}
.lk-trmnl .lk-poster figcaption { padding: 8px 12px 0; }
.lk-trmnl .lk-poster-cap { font-family: var(--lk-head); font-weight: 800; font-size: 1.1rem; text-transform: uppercase; color: var(--lk-title); }
.lk-trmnl .lk-poster-sub { color: var(--lk-accent); }
.lk-trmnl .lk-poster figcaption::after {
  /* barcode */
  content: "";
  display: block;
  height: 18px;
  margin-top: 6px;
  background: repeating-linear-gradient(90deg, #e9e2da 0 2px, transparent 2px 4px, #e9e2da 4px 5px, transparent 5px 8px, #e9e2da 8px 11px, transparent 11px 12px);
  opacity: 0.75;
}

/* Chapter banners: carbon plate, burning number */
.lk-trmnl .lk-chapter { background: var(--lk-carbon); border: 1px solid rgba(255, 138, 31, 0.25); border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(255, 61, 46, 0.4); }
.lk-trmnl .lk-chapter-num {
  min-width: 92px;
  padding-right: 26px;
  font-weight: 800;
  font-style: italic;
  font-size: 2.2rem;
  color: var(--lk-ink);
  background: var(--lk-fire);
  clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
}
.lk-trmnl .lk-chapter-name { font-weight: 800; font-style: italic; font-size: 1.6rem; letter-spacing: 0.08em; }
.lk-trmnl .lk-chapter-mark { color: var(--lk-accent-2); text-shadow: 0 0 10px rgba(255, 61, 46, 0.6); }

/* Sections */
.lk-trmnl .section > h2,
.lk-trmnl h2.section-title {
  font-weight: 800;
  font-style: italic;
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #ffd166, #ff8a1f 18%, #ff3d2e 40%, transparent 75%) 1;
}
.lk-trmnl .section h3 { font-family: var(--lk-head); font-weight: 700; font-size: 1rem; font-style: italic; letter-spacing: 0.12em; color: var(--lk-violet); }

/* Cards */
.lk-trmnl .card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid rgba(255, 138, 31, 0.7);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(155, 108, 255, 0.08), transparent 60%),
    linear-gradient(170deg, var(--lk-panel-a), var(--lk-panel-b));
}
.lk-trmnl .card:hover { border-color: rgba(255, 138, 31, 0.35); border-top-color: var(--lk-accent-2); }
.lk-trmnl .card-title { font-weight: 800; font-style: italic; font-size: 1.25rem; text-transform: uppercase; color: var(--lk-title); }
.lk-trmnl .badge { background: var(--lk-accent); color: var(--lk-ink); border: 0; }
.lk-trmnl .rule-key { border-left-color: var(--lk-violet); background: linear-gradient(90deg, rgba(155, 108, 255, 0.12), transparent); }

/* Tables */
.lk-trmnl table.data-table thead th { font-family: var(--lk-head); font-weight: 700; font-size: 0.88rem; letter-spacing: 0.12em; }
.lk-trmnl tr.tbl-group td { font-style: italic; color: var(--lk-accent); }

/* Chips & buttons */
.lk-trmnl .filter-chip.active,
.lk-trmnl .btn-primary { background: var(--lk-fire); border-color: var(--lk-accent); color: var(--lk-ink); }
.lk-trmnl .btn-primary { font-style: italic; font-weight: 800; }
.lk-trmnl .btn-primary:hover { filter: brightness(1.1); }

/* Roll boards */
.lk-trmnl .rt-section { border-top: 2px solid rgba(255, 138, 31, 0.6); }
.lk-trmnl .rt-die-chip { background: var(--lk-violet); color: #fff; }
.lk-trmnl .rt-result { border-color: var(--lk-accent); color: #ffe6cc; text-shadow: 0 0 8px rgba(255, 138, 31, 0.35); }

/* Quick strip */
.lk-trmnl .lk-quick-card { border: 1px solid rgba(255, 255, 255, 0.08); border-top: 2px solid var(--lk-accent); }
.lk-trmnl .lk-quick-card h3 { font-family: var(--lk-head); font-weight: 800; font-style: italic; font-size: 1rem; letter-spacing: 0.14em; color: var(--lk-title); }
.lk-trmnl .lk-ladder strong,
.lk-trmnl .lk-steps li::before { background: var(--lk-fire); color: var(--lk-ink); }
.lk-trmnl .lk-ladder li { grid-template-columns: 64px minmax(0, 1fr); }
.lk-trmnl .lk-formula { font-style: italic; }
.lk-trmnl .lk-formula em { color: var(--lk-accent); }
.lk-trmnl .lk-kv li strong { color: var(--lk-violet); }

/* Equipment index (stub page) */
.lk-trmnl .gear-index .card ul { columns: 2; column-gap: 18px; }

/* Motion (Full only): the trails drift */
html[data-motion="full"] .lk-trmnl .lk-deco-a { animation: lk-tr-trails 6s ease-in-out infinite alternate; }
@keyframes lk-tr-trails { from { transform: rotate(-9deg) translateX(-3%); opacity: 0.45; } to { transform: rotate(-9deg) translateX(3%); opacity: 0.65; } }
html[data-motion="full"] .lk-trmnl .lk-poster:hover { transform: rotate(0deg) scale(1.03); }

@media (max-width: 720px) {
  .lk-trmnl .lk-watermark { right: -10px; font-size: 5rem; }
  .lk-trmnl .lk-chapter-num { min-width: 64px; font-size: 1.6rem; }
  .lk-trmnl .lk-chapter-name { font-size: 1.1rem; }
  .lk-trmnl .gear-index .card ul { columns: 1; }
}

/* Play examples / long run-tables folded behind a "show example" toggle (closed by default). */
.lk-trmnl details.ts-fold { margin: 10px 0; border: 1px solid var(--lk-line); border-radius: var(--lk-radius); background: rgba(13, 11, 16, 0.55); }
.lk-trmnl details.ts-fold > summary { cursor: pointer; padding: 6px 10px; color: var(--lk-dim); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.lk-trmnl details.ts-fold > summary:hover { color: var(--lk-accent); }
.lk-trmnl details.ts-fold[open] > summary { border-bottom: 1px solid var(--lk-line); color: var(--lk-accent); }
.lk-trmnl details.ts-fold > :not(summary) { margin-left: 10px; margin-right: 10px; }
