/* ─────────────────────────────────────────────────────────────────────
   KONZTRUCT — Specimen Documentation Site
   KZ-002 // K. obscurus // CLASSIFIED
   ───────────────────────────────────────────────────────────────────── */

:root {
  --bg:       #030303;
  --panel:    #060303;
  --red:      #cc1111;
  --red-dim:  rgba(180, 15, 15, 0.45);
  --red-glow: #e01818;
  --border:   rgba(160, 12, 12, 0.55);
  --border-hi:rgba(200, 16, 16, 0.75);
  --blue:     #1a7fff;
  --blue-dim: rgba(26, 127, 255, 0.3);
  --fg:       #ece8de;
  --muted:    #777;
  --mono:     'Space Mono', monospace;
  --sans:     'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── PANEL BASE ─────────────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 14px;
  position: relative;
}
.panel-label {
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.panel-sub { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.sus { color: var(--muted); font-style: italic; font-size: 0.85em; }

/* ── NAVIGATION ─────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: #020101;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}
.nav-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-division { font-size: 9px; letter-spacing: .14em; color: var(--fg); text-transform: uppercase; }
.nav-sep { color: var(--red); font-size: 10px; }
.nav-class { font-size: 9px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-link { font-size: 10px; letter-spacing: .1em; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-link:hover { color: var(--fg); }
.nav-link-cta { color: var(--red); border: 1px solid var(--red-dim); padding: 4px 10px; }
.nav-link-cta:hover { color: var(--red-glow); border-color: var(--red); }

/* ── SPECIMEN HEADER ─────────────────────────────────────────────────── */
.spec-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.spec-title { padding: 24px 28px; border-right: 1px solid var(--border); min-width: 280px; }
.spec-eyebrow { font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.spec-name {
  font-family: var(--mono);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.spec-id { font-size: 14px; letter-spacing: .08em; color: var(--fg); margin-bottom: 8px; }
.id-slashes { color: var(--red); }
.spec-subtitle { font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }

.spec-header-panels { display: grid; grid-template-columns: 1fr auto; }
.data-table { border-collapse: collapse; width: 100%; }
.data-table tr { border-bottom: 1px solid rgba(160,12,12,.2); }
.data-table tr:last-child { border-bottom: none; }
.dk { font-size: 10px; letter-spacing: .08em; color: var(--muted); padding: 5px 12px 5px 0; white-space: nowrap; text-transform: uppercase; }
.dv { font-size: 12px; color: var(--fg); padding: 5px 0; }

.phys-data { border-left: 1px solid var(--border); min-width: 160px; display: flex; flex-direction: column; }
.phys-item { padding: 16px; flex: 1; }
.phys-divider { border-top: 1px solid var(--border); }
.phys-label { font-size: 9px; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.phys-val { font-size: 28px; font-weight: 700; color: var(--fg); line-height: 1; margin-bottom: 4px; }
.phys-sub { font-size: 11px; color: var(--muted); }
.phys-note { font-size: 9px; color: #555; margin-top: 3px; font-style: italic; }

/* ── HERO SECTION ────────────────────────────────────────────────────── */
.spec-hero {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  border-bottom: 1px solid var(--border);
  min-height: 520px;
}

.hero-left {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.features-panel {
  border: none;
  background: #050101;
  padding: 18px 18px;
  flex: 1;
}
.feature-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(160,12,12,.18);
}
.feature-row:last-child { border-bottom: none; }
.feat-num { font-size: 11px; color: var(--red); font-weight: 700; letter-spacing: .05em; min-width: 22px; padding-top: 1px; }
.feat-name { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--fg); margin-bottom: 3px; text-transform: uppercase; }
.feat-desc { font-size: 10px; color: var(--muted); line-height: 1.5; }

.hero-creature-wrap {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 12px;
  background: #020101;
  position: relative;
}
.hero-canvas { display: block; }

.measure-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--red);
  letter-spacing: .06em;
  text-align: center;
}
.measure-h { margin-bottom: 8px; }
.measure-w { margin-top: 8px; border-top: 1px solid var(--red-dim); padding-top: 6px; width: 100%; text-align: center; }

.hero-right {
  display: flex;
  flex-direction: column;
}
.detail-panels-v {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.detail-panel-v {
  border: none;
  border-bottom: 1px solid var(--border);
  background: #040101;
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.detail-panel-v:last-child { border-bottom: none; }
.detail-diagram {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  max-height: 90px;
}
.detail-diagram svg { width: 100%; height: 100%; }
.keyboard-wrap { min-height: 50px; max-height: 70px; }
.keyboard-wrap svg { width: 100%; }
.detail-measure { font-size: 8.5px; color: var(--red); letter-spacing: .05em; margin-top: 5px; text-align: center; }

/* ── VIEWS ROW ───────────────────────────────────────────────────────── */
.spec-views-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.view-panel {
  border: none;
  border-right: 1px solid var(--border);
  background: #040101;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 220px;
}
.view-panel:last-child { border-right: none; }
.view-panel .panel-label { align-self: flex-start; }

.view-canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.view-canvas-wrap canvas { display: block; }
.view-h { font-size: 9px; color: var(--red); letter-spacing: .05em; margin-top: 4px; }

.view-placeholder {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(160,12,12,.3);
  margin: 6px 0;
  padding: 10px;
  gap: 5px;
}
.obs-text { font-size: 8px; letter-spacing: .15em; color: var(--red); text-transform: uppercase; }
.silhouette-svg { width: 56px; height: 70px; opacity: .7; }
.view-h-label { font-size: 9px; color: var(--muted); }
.obs-note { font-size: 8px; letter-spacing: .1em; color: #444; text-transform: uppercase; }
.view-measure { font-size: 9px; color: var(--red); letter-spacing: .06em; margin-top: 6px; }

.proportions-diagram {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.proportions-diagram svg { width: 100%; height: 100%; max-height: 180px; }

/* ── ANATOMY ROW ─────────────────────────────────────────────────────── */
.spec-anatomy-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}
.anatomy-panel {
  border: none;
  border-right: 1px solid var(--border);
  background: #030101;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.anatomy-panel:last-child { border-right: none; }
.anatomy-panel .panel-label { margin-bottom: 8px; }
.anatomy-diagram { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 100px; max-height: 140px; }
.anatomy-diagram svg { width: 100%; height: 100%; }

/* ── DATA ROWS ───────────────────────────────────────────────────────── */
.spec-data-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.data-panel-lg {
  border: none;
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 18px 20px;
}
.data-panel-lg:last-child { border-right: none; }

.dl-list { display: flex; flex-direction: column; gap: 6px; }
.dl-row { display: flex; gap: 10px; font-size: 12px; }
.dl-k { font-size: 10px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; white-space: nowrap; min-width: 110px; padding-top: 1px; }
.dl-v { color: var(--fg); }

.bullet-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.bullet-list li { font-size: 12px; color: var(--fg); padding-left: 12px; position: relative; }
.bullet-list li::before { content: '•'; color: var(--red); position: absolute; left: 0; font-size: 10px; }

.diet-header { font-size: 12px; color: var(--fg); margin-bottom: 8px; }
.habitat-desc { font-size: 11px; color: var(--muted); font-style: italic; margin-bottom: 12px; line-height: 1.5; }
.habitat-confirmed { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.confirmed-tag { color: var(--red); margin-right: 6px; }

/* ── HABITAT CTA ─────────────────────────────────────────────────────── */
.spec-habitat-cta {
  border-bottom: 1px solid var(--border);
  background: #050101;
  padding: 40px 28px;
}
.habitat-cta-inner { max-width: 1200px; margin: 0 auto; }
.spec-habitat-cta .panel-label { font-size: 9px; letter-spacing: .18em; color: var(--red); text-transform: uppercase; margin-bottom: 24px; display: block; }
.habitat-cta-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.habitat-cta-title { font-family: var(--mono); font-size: clamp(18px, 3vw, 28px); font-weight: 700; letter-spacing: .04em; color: var(--fg); margin-bottom: 14px; }
.habitat-cta-body { font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 560px; margin-bottom: 22px; }
.habitat-cta-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  padding: 12px 24px;
  text-decoration: none;
  border: 1px solid var(--red);
  transition: background .2s, border-color .2s;
}
.habitat-cta-btn i { color: #ff7777; font-style: normal; }
.habitat-cta-btn:hover { background: var(--red-glow); }

.habitat-cta-data { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--border); background: var(--border); min-width: 280px; }
.habitat-stat { background: var(--panel); padding: 14px 16px; }
.hstat-label { font-size: 8.5px; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.hstat-val { font-size: 12px; color: var(--fg); font-weight: 700; }
.hstat-live { color: #22cc44; }

/* ── FOOTER ──────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: #020101;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-div, .footer-conf, .footer-id { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.footer-div  { color: var(--fg); }
.footer-conf { color: var(--muted); }
.footer-id   { color: var(--red); }
.footer-sep  { color: var(--red); font-size: 10px; }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-link { font-size: 9px; letter-spacing: .1em; color: var(--muted); text-decoration: none; transition: color .2s; }
.footer-link:hover { color: var(--fg); }

.websiites-badge {
  display: inline-block;
  font-family: 'Space Grotesk', var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .2s;
}
.websiites-badge i { color: var(--blue); font-style: normal; }
.websiites-badge:hover { color: rgba(255,255,255,.75); }

/* ── CHAT WIDGET ─────────────────────────────────────────────────────── */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  cursor: pointer;
  filter: drop-shadow(0 4px 20px rgba(26,127,255,.35));
  transition: filter .2s, transform .2s;
}
.chat-widget:hover {
  filter: drop-shadow(0 6px 28px rgba(26,127,255,.55));
  transform: translateY(-2px);
}
.chat-canvas { display: block; }

.chat-panel {
  position: fixed;
  bottom: 130px;
  right: 20px;
  width: 320px;
  background: #060202;
  border: 1px solid var(--border-hi);
  z-index: 901;
  display: flex;
  flex-direction: column;
  max-height: 460px;
}
.chat-panel.hidden { display: none; }
.chat-panel-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: #040101; flex-shrink: 0; }
.chat-mini-canvas { display: block; flex-shrink: 0; }
.chat-panel-title { flex: 1; }
.chat-name { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--fg); }
.chat-status { display: block; font-size: 9px; color: var(--blue); letter-spacing: .08em; }
.chat-close { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 4px; transition: color .2s; }
.chat-close:hover { color: var(--fg); }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: var(--red-dim) transparent; }
.chat-msg { display: flex; }
.konztruct-msg { justify-content: flex-start; }
.user-msg { justify-content: flex-end; }
.msg-bubble { display: inline-block; padding: 8px 12px; font-size: 12px; line-height: 1.5; max-width: 80%; }
.konztruct-msg .msg-bubble { background: #0a0a14; border: 1px solid rgba(26,127,255,.25); color: var(--fg); }
.user-msg .msg-bubble { background: #0e0818; border: 1px solid rgba(100,30,200,.4); color: var(--fg); }
.typing-bubble { display: inline-flex; align-items: center; gap: 4px; padding: 10px 14px; background: #0a0a14; border: 1px solid rgba(26,127,255,.2); }
.typing-dot { width: 5px; height: 5px; background: var(--blue); border-radius: 50%; animation: typingPulse 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingPulse { 0%, 80%, 100% { opacity: .3; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: #040101; flex-shrink: 0; }
.chat-input { flex: 1; background: #080810; border: 1px solid var(--border); color: var(--fg); font-family: var(--mono); font-size: 12px; padding: 8px 10px; outline: none; transition: border-color .2s; }
.chat-input:focus { border-color: var(--blue); }
.chat-input::placeholder { color: #444; }
.chat-send { background: var(--blue); border: none; color: #fff; font-size: 14px; width: 36px; height: 36px; cursor: pointer; transition: background .2s; display: flex; align-items: center; justify-content: center; }
.chat-send:hover { background: #2288ff; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .spec-hero { grid-template-columns: 220px 1fr 240px; }
}
@media (max-width: 900px) {
  .spec-header { grid-template-columns: 1fr; }
  .spec-title { border-right: none; border-bottom: 1px solid var(--border); }
  .spec-header-panels { grid-template-columns: 1fr auto; }
  .spec-hero { grid-template-columns: 1fr; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--border); }
  .hero-creature-wrap { border-right: none; border-bottom: 1px solid var(--border); }
  .detail-panels-v { flex-direction: row; flex-wrap: wrap; }
  .detail-panel-v { flex: 1; min-width: 140px; border-bottom: 1px solid var(--border); }
  .spec-views-row { grid-template-columns: 1fr 1fr; }
  .view-panel:nth-child(2n) { border-right: none; }
  .view-panel:nth-child(n+3) { border-top: 1px solid var(--border); }
  .spec-anatomy-row { grid-template-columns: repeat(3, 1fr); }
  .anatomy-panel:nth-child(3) { border-right: none; }
  .anatomy-panel:nth-child(n+4) { border-top: 1px solid var(--border); }
  .spec-data-row { grid-template-columns: 1fr 1fr; }
  .data-panel-lg:nth-child(2n) { border-right: none; }
  .data-panel-lg:nth-child(n+3) { border-top: 1px solid var(--border); }
  .habitat-cta-grid { grid-template-columns: 1fr; }
  .habitat-cta-data { min-width: auto; }
}
@media (max-width: 600px) {
  .nav { padding: 10px 14px; }
  .nav-class { display: none; }
  .spec-name { font-size: 44px; }
  .spec-title { padding: 18px 16px; min-width: auto; }
  .spec-header-panels { grid-template-columns: 1fr; }
  .phys-data { border-left: none; border-top: 1px solid var(--border); flex-direction: row; }
  .phys-item { flex: 1; }
  .phys-divider { display: none; }
  .spec-anatomy-row { grid-template-columns: 1fr 1fr; }
  .anatomy-panel:nth-child(2n) { border-right: none; }
  .anatomy-panel:last-child { grid-column: span 2; }
  .spec-data-row { grid-template-columns: 1fr; }
  .data-panel-lg { border-right: none; border-bottom: 1px solid var(--border); }
  .chat-panel { width: calc(100vw - 24px); right: 12px; }
  .chat-widget { bottom: 12px; right: 12px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-conf, .footer-sep { display: none; }
}
