/* Basmu / CADA — v2 layout layer (full-width, mobile-first). Loaded after main.css. */
:root {
  --max: 1440px;
  --gutter: clamp(16px, 4vw, 80px);
}

.container,
.hero-content {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: border-box;
}

.section { padding-block: clamp(64px, 9vw, 128px); }
.section-lead { max-width: 62ch; }
.film-player { aspect-ratio: 16 / 9; max-width: 1040px; margin-top: 28px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--hairline-hi); border-radius: var(--radius-lg); background: radial-gradient(circle at 50% 50%, rgba(45,226,192,.15), #080d1a 70%); }
.film-player iframe { width: 100%; height: 100%; border: 0; }
.film-play { cursor: pointer; display: inline-flex; align-items: center; gap: 16px; padding: 18px 25px; border: 1px solid var(--lume-primary); border-radius: 999px; background: rgba(8,13,26,.92); color: var(--ink-hi); font: inherit; font-weight: 700; }
.film-play:hover, .film-play:focus-visible { background: rgba(45,226,192,.2); }

/* ---------- hero: split, full width ---------- */
.hero { min-height: min(100svh, 980px); display: flex; align-items: center; }
.hero-content {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  text-align: left;
}
.hero-content > * { grid-column: 1 / span 7; }
.hero-content h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; }
.hero-sub { font-size: clamp(1.05rem, 1.5vw, 1.3rem); max-width: 56ch; }
.hero-actions { justify-content: flex-start; }
.hero-side {
  grid-column: 9 / span 4 !important;
  grid-row: 1 / span 5;
  align-self: center;
  display: flex; flex-direction: column; gap: 18px;
}
.hero-proof {
  display: flex; flex-direction: column; gap: 10px;
  list-style: none; margin: 0; padding: 0;
}
.hero-proof li {
  border: 1px solid var(--hairline-hi); background: rgba(8, 13, 26, 0.88); backdrop-filter: blur(12px);
  border-radius: var(--radius-md); padding: 16px 18px; color: var(--ink-hi); font-size: 0.95rem; line-height: 1.45;
}
.hero-proof strong { display: block; color: var(--ink-hi); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- 12-column helpers ---------- */
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-4 { grid-column: span 4; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }

/* ---------- scroll story ---------- */
.story { position: relative; padding-block: clamp(64px, 8vw, 112px) 0; }
.story-intro { margin-bottom: clamp(24px, 4vw, 48px); }
.story-layout {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box;
}
.story-steps { grid-column: 1 / span 5; list-style: none; margin: 0; padding: 0; }
.story-step {
  min-height: 78vh; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  opacity: 0.32; transition: opacity 0.4s ease;
}
.story-step.is-active { opacity: 1; }
.story-step .num { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lume-primary); }
.story-step h3 { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
.story-step p { color: var(--ink-mid); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.6; margin: 0; max-width: 46ch; }
.story-stage {
  grid-column: 6 / span 7; position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); align-self: start;
  display: flex; flex-direction: column; gap: 10px;
}
.story-stage canvas { width: 100%; height: auto; flex: 1 1 auto; min-height: 0; display: block; }
.story-visual-caption { margin: 0; padding: 8px 12px; border-left: 2px solid var(--lume-primary); color: var(--ink-mid); background: rgba(8, 13, 26, 0.88); font-size: 0.82rem; line-height: 1.35; }
/* ---------- investigation console ---------- */
.story-step .console-card { display: none; }
.story-console {
  position: relative; align-self: flex-end; flex: 0 0 auto;
  width: min(440px, 100%); max-height: 68%; overflow-y: auto;
}
.console-card {
  box-sizing: border-box; border-radius: 16px; border: 1px solid var(--hairline-hi);
  background: rgba(8, 13, 26, 0.92); backdrop-filter: blur(14px); padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 12px;
  animation: cc-in 0.45s ease both;
}
@keyframes cc-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-low); }
.cc-tag { color: var(--lume-primary); }
.sev { font-family: var(--font-mono); font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; font-weight: 500; }
.sev.hi { color: var(--danger); background: rgba(255, 92, 122, 0.12); }
.sev.md { color: var(--amber); background: rgba(242, 193, 78, 0.12); }
.cc-queue, .cc-check, .cc-bars, .cc-cuts, .cc-explanations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cc-explanations li { padding: 9px 12px; border-left: 3px solid var(--lume-secondary); background: rgba(174, 185, 212, 0.06); border-radius: 4px 9px 9px 4px; }
.cc-explanations li.lawful { border-left-color: var(--proven); }
.cc-explanations strong { display: block; margin-bottom: 3px; color: var(--ink-hi); font-size: 0.88rem; }
.cc-explanations span { display: block; color: var(--ink-mid); font-size: 0.82rem; line-height: 1.35; }
.cc-queue li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(174, 185, 212, 0.06); color: var(--ink-hi); font-size: 0.95rem; }
.cc-queue .cc-more { background: none; color: var(--ink-low); justify-content: center; font-size: 0.85rem; }
.cc-kv { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cc-kv div { display: flex; flex-direction: column; gap: 2px; }
.cc-kv dt { font-size: 0.78rem; color: var(--ink-low); }
.cc-kv dd { margin: 0; color: var(--ink-hi); font-size: 0.95rem; }
.cc-kv .hl { color: var(--lume-primary); font-weight: 600; }
.cc-note { margin: 0; color: var(--ink-mid); font-size: 0.88rem; line-height: 1.45; }
.cc-check li { position: relative; padding-left: 28px; color: var(--ink-hi); font-size: 0.95rem; opacity: 0; animation: cc-in 0.4s ease forwards; }
.cc-check li:nth-child(1) { animation-delay: 0.1s; } .cc-check li:nth-child(2) { animation-delay: 0.35s; }
.cc-check li:nth-child(3) { animation-delay: 0.6s; } .cc-check li:nth-child(4) { animation-delay: 0.85s; }
.cc-check li:nth-child(5) { animation-delay: 1.15s; } .cc-check li:nth-child(6) { animation-delay: 1.45s; }
.cc-check li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; }
.cc-check li.ok::before { background: var(--lume-primary); box-shadow: 0 0 10px rgba(45, 226, 192, 0.5); }
.cc-check li.gap { color: var(--amber); }
.cc-check li.gap::before { border: 2px dashed var(--amber); }
.cc-bars li { display: grid; grid-template-columns: 1fr 34%; grid-template-rows: auto 6px; column-gap: 12px; row-gap: 5px; font-size: 0.92rem; color: var(--ink-hi); }
.cc-bars li span { grid-column: 1; }
.cc-bars li b { grid-column: 2; justify-self: end; font-family: var(--font-mono); font-weight: 500; color: var(--ink-mid); }
.cc-bars li i { grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--lume-secondary), #c7b3ff);
  width: 0; animation: cc-bar 1.1s cubic-bezier(.2,.7,.2,1) 0.2s forwards; }
.cc-bars li.lawful span { color: var(--proven); }
.cc-bars li.lawful i { background: var(--proven); }
@keyframes cc-bar { to { width: var(--w); } }
.cc-cuts li { display: flex; gap: 14px; align-items: baseline; font-size: 0.92rem; color: var(--ink-mid); opacity: 0; animation: cc-in 0.45s ease forwards; }
.cc-cuts li:nth-child(2) { animation-delay: 0.6s; } .cc-cuts li:nth-child(3) { animation-delay: 1.2s; }
.cc-cuts b { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 500; color: var(--lume-secondary); min-width: 3.2ch; }
.cc-cuts li.cut b { color: var(--amber); } .cc-cuts li:last-child b { color: var(--lume-primary); }
.console-card.paper { background: #f4f8ff; color: #14181f; border-color: transparent; }
.console-card.paper .cc-head { color: #5b6673; } .console-card.paper .cc-tag { color: #1d4b73; }
.console-card.paper .cc-kv dt { color: #5b6673; } .console-card.paper .cc-kv dd { color: #14181f; }
.console-card.paper .cc-kv .hl { color: #1c6b45; }
.console-card.paper .cc-type { color: #1b2838; }
.cc-type { margin: 0; font-size: 0.98rem; line-height: 1.6; min-height: 6.4em; }
.cc-type.typing::after { content: "▍"; color: #1d4b73; animation: cc-blink 0.9s steps(1) infinite; }
@keyframes cc-blink { 50% { opacity: 0; } }
.cc-refs { margin: 0; display: flex; gap: 6px; }
.cc-refs span { font-family: var(--font-mono); font-size: 0.72rem; color: #1d4b73; background: #e3edf7; border-radius: 4px; padding: 2px 6px; }
.cc-decide { display: flex; flex-direction: column; gap: 8px; }
.cc-decide button { min-height: 46px; border-radius: 10px; border: 1px solid var(--hairline); background: rgba(174, 185, 212, 0.06);
  color: var(--ink-hi); font: 600 0.95rem var(--font-body); cursor: pointer; text-align: left; padding: 0 16px; }
.cc-decide button:nth-child(1) { border-color: rgba(255, 92, 122, 0.5); }
.cc-decide button:nth-child(2) { border-color: rgba(242, 193, 78, 0.5); }
.cc-decide button:nth-child(3) { border-color: rgba(94, 200, 232, 0.5); }
.cc-decide button:hover, .cc-decide button[aria-pressed="true"] { background: rgba(45, 226, 192, 0.12); border-color: var(--lume-primary); }
.cc-cta { align-self: flex-start; }

/* ---------- why now ---------- */
.why-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.why-grid > .why-copy { grid-column: 1 / span 6; }
.why-grid > .stack-list { grid-column: 8 / span 5; }
.stack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stack-list li {
  display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px;
  border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--glass-panel); color: var(--ink-mid);
}
.stack-list li strong { color: var(--ink-hi); }
.stack-list li.is-cada { border-color: var(--hairline-hi); box-shadow: var(--glow-primary); }
.stack-list li.is-cada strong { color: var(--lume-primary); }

/* ---------- modules ---------- */
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.module {
  display: flex; flex-direction: column; gap: 12px; padding: 24px;
  border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--glass-panel);
}
.module h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }
.module p { margin: 0; color: var(--ink-mid); line-height: 1.55; }
.module.is-core { grid-column: span 3; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: center; border-color: var(--hairline-hi); }
.module.is-core > div { grid-column: span 8; display: flex; flex-direction: column; gap: 10px; }
.module.is-core > .module-actions { grid-column: span 4; justify-self: end; }
.badge {
  align-self: flex-start; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.badge-now { color: var(--proven); background: rgba(63, 224, 160, 0.1); border: 1px solid rgba(63, 224, 160, 0.4); }
.badge-oct { color: var(--lume-ice); background: rgba(94, 200, 232, 0.1); border: 1px solid rgba(94, 200, 232, 0.4); }
.modules-note { margin-top: 24px; color: var(--ink-low); }

/* ---------- two-up feature panels ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.panel {
  padding: clamp(24px, 3vw, 40px); border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--glass-panel);
  display: flex; flex-direction: column; gap: 14px;
}
.panel h3 { margin: 0; font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.7rem); }
.panel p, .panel li { color: var(--ink-mid); line-height: 1.6; }
.panel ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 8px; }
.panel .big-line { font-family: var(--font-display); color: var(--ink-hi); font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.3; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.card-grid article { padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--glass-panel); }
.card-grid h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.15rem; }
.card-grid p { margin: 0; color: var(--ink-mid); line-height: 1.55; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.about-grid .about-story { grid-column: 1 / span 7; }
.about-grid .about-side { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 16px; }
.timeline-mini { list-style: none; margin: 24px 0 0; padding: 0; display: flex; gap: 16px; }
.timeline-mini li { flex: 1; padding: 18px; border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--glass-panel); }
.timeline-mini strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--lume-primary); }
.fact-list { list-style: none; margin: 0; padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--glass-panel); display: flex; flex-direction: column; gap: 10px; color: var(--ink-mid); }
.fact-list strong { color: var(--ink-hi); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-content > * { grid-column: 1 / -1; }
  .hero-side { grid-column: 1 / -1 !important; grid-row: auto; margin-top: 24px; }
  .hero-proof { flex-direction: row; flex-wrap: wrap; }
  .hero-proof li { flex: 1 1 220px; }
  .module-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module.is-core { grid-column: span 2; }
}

@media (max-width: 1199px) {
  .story-layout { display: block; }
  .story-stage { display: none; }
  .story-step { min-height: 0; opacity: 1; padding: 24px 0; border-top: 1px solid var(--hairline); }
  .story-step .console-card { display: flex; order: 3; }
  .story-step { display: flex; flex-direction: column; }
  .why-grid > .why-copy, .why-grid > .stack-list,
  .about-grid .about-story, .about-grid .about-side { grid-column: 1 / -1; }
  .duo { grid-template-columns: 1fr; }
  .module.is-core { grid-template-columns: 1fr; }
  .module.is-core > div, .module.is-core > .module-actions { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 640px) {
  .module-grid, .card-grid { grid-template-columns: 1fr; }
  .module.is-core { grid-column: auto; }
  .timeline-mini { flex-direction: column; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
  .stack-list li { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-step { opacity: 1; transition: none; }
  .console-card, .cc-check li, .cc-cuts li { animation: none; opacity: 1; }
  .cc-bars li i { animation: none; width: var(--w); }
}

/* ---------- hero HUD over the case graph ---------- */
.hero-hud { display: flex; flex-direction: column; gap: 8px; }
.hud-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--hairline);
  background: rgba(5, 7, 14, 0.88); backdrop-filter: blur(10px); opacity: 1; transition: border-color .5s ease; }
.hud-row b { font-family: var(--font-mono); font-size: clamp(1rem, 1.6vw, 1.5rem); font-weight: 500; min-width: 2.4ch; white-space: nowrap; }
.hud-row span { color: var(--ink-mid); font-size: 0.9rem; }
.hud-flag b { color: #ef4444; } .hud-found b { color: var(--lume-primary); } .hud-parties b { color: #10b981; }
.hero-hud .hud-flag { opacity: 1; border-color: rgba(239, 68, 68, 0.5); }
.hero-hud[data-phase="1"] .hud-found, .hero-hud[data-phase="2"] .hud-found { opacity: 1; border-color: var(--hairline-hi); }
.hero-hud[data-phase="2"] .hud-parties { opacity: 1; }
@media (max-width: 1100px) { .hero-hud { flex-direction: row; flex-wrap: wrap; } .hud-row { flex: 1 1 200px; } }
