/* =========================================================
   matrix.css - V4.3 Matrix entry point
   Matrix-specific layout layer. HTML pages load the shared
   matrix subfiles directly before this file to avoid stale
   nested imports overriding route cache keys.
   ========================================================= */

/* ---- Cross-surface reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .matrix-shell *,
  .preview-card *,
  .file-package-screen * {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   V67 file desk polish
   Graphite shell, paper working file, compact private-rule
   panel. The form mechanics stay local; the room now reads as
   a serious private file instead of a generic wizard.
   ========================================================= */

.matrix-shell {
  padding-top: 0;
  background:
    linear-gradient(180deg, rgba(185, 136, 82, 0.05), transparent 260px),
    var(--graphite, #0b0d0c);
}

.matrix-shell .route-nav {
  width: min(1240px, 100%);
  margin-bottom: 34px;
}

.matrix-shell-head {
  margin-bottom: 16px;
  align-items: flex-end;
}

.matrix-shell-eyebrow,
.matrix-section-index-file,
.matrix-section-index-num,
.matrix-sublabel,
.matrix-label,
.matrix-range-display {
  font-size: 12px;
  letter-spacing: 0;
}

.matrix-shell-title {
  font-size: clamp(42px, 5.4vw, 66px);
  letter-spacing: 0;
  max-width: 12ch;
}

.matrix-personal-link-head .matrix-shell-title {
  font-size: clamp(38px, 4.8vw, 58px);
  max-width: 16ch;
}

.matrix-personal-link-head .matrix-shell-sub {
  max-width: 58ch;
}

.matrix-shell-sub {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  max-width: 66ch;
}

.matrix-file-rules {
  display: none;
}

.matrix-file-rules-kicker {
  margin: 0 0 10px;
  font-family: "JetBrains Mono", sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #7c5b38;
}

.matrix-file-rules strong {
  display: block;
  margin: 0 0 8px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--graphite, #0b0d0c);
}

.matrix-file-rules span {
  display: block;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #3e3a32;
}

.matrix-file-strip {
  width: min(1240px, 100%);
  margin: 0 auto 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 14px 0;
  border-top: 1px solid rgba(185, 136, 82, 0.28);
  border-bottom: 1px solid rgba(185, 136, 82, 0.28);
}

.matrix-file-strip span {
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border-right: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--stone, #b6a98c);
}

.matrix-file-strip span:last-child {
  border-right: 0;
}

.matrix-file-strip b {
  display: inline;
  margin: 0;
  font-family: "JetBrains Mono", sans-serif;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--paper, #f5f0e6);
  font-weight: 600;
}

.matrix-file-strip em {
  display: inline;
  max-width: none;
  font-style: normal;
  font-size: 14px;
  line-height: 1.3;
  color: rgba(245, 240, 230, 0.72);
}

.matrix-workbench-note {
  display: none;
}

.matrix-workbench-note strong {
  font-family: "JetBrains Mono", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--paper, #f5f0e6);
}

.matrix-workbench-note span {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(245, 240, 230, 0.7);
}

.matrix-section-index {
  padding: 16px;
  background: rgba(12, 18, 16, 0.72);
}

.matrix-section-index-status,
.matrix-section-index-item {
  font-size: 16px;
}

.matrix-step {
  padding: clamp(28px, 3vw, 42px);
  background:
    linear-gradient(180deg, rgba(18, 22, 20, 0.98), rgba(11, 13, 12, 0.98));
  color: var(--ivory, #eee6d6);
  border-color: rgba(185, 136, 82, 0.34);
  box-shadow: 0 42px 100px -72px rgba(0, 0, 0, 0.94);
}

.matrix-step-title {
  font-size: clamp(32px, 3.3vw, 42px);
  letter-spacing: 0;
  margin-bottom: 28px;
  color: var(--ivory, #eee6d6);
}

.matrix-helper {
  font-size: 17px;
  line-height: 1.55;
  color: #b6ad9c;
}

.matrix-step .matrix-sublabel,
.matrix-step .matrix-label,
.matrix-step .matrix-range-display,
.matrix-step .summary-label {
  color: var(--brass-bright, #d9a871);
}

.matrix-input,
.matrix-range {
  min-height: 46px;
  font-size: 17px;
  background: rgba(8, 10, 9, 0.6);
  color: var(--ivory, #eee6d6);
  border-color: rgba(185, 136, 82, 0.4);
}

.matrix-input::placeholder {
  color: #8b8578;
}

.matrix-step .chip {
  min-height: 42px;
  font-size: 14px;
  line-height: 1.2;
  border-color: rgba(185, 136, 82, 0.4);
  color: var(--ivory, #eee6d6);
  background: rgba(255, 255, 255, 0.02);
}

.matrix-step .chip:hover {
  border-color: var(--brass-bright, #d9a871);
  background: rgba(185, 136, 82, 0.12);
}

/* Cut the redundant 3-block intro over-text (audit DNA#2): the file-rules aside
   and the file-strip both restate what the wizard itself already says. Hide them
   so only the h1 + one-line sub lead into step 1. Owner + buyer share matrix.css. */
.matrix-file-rules,
.matrix-file-strip {
  display: none;
}

.matrix-step .chip[aria-pressed="true"] {
  background: var(--brass-bright, #d9a871);
  border-color: var(--brass-bright, #d9a871);
  color: #0b0d0c;
}

.matrix-step .summary-row {
  border-top-color: rgba(185, 136, 82, 0.24);
}

.matrix-step .summary-single,
.matrix-step .summary-chip,
.matrix-step .preference-tag,
.matrix-step .preference-lane-title {
  color: var(--ivory, #eee6d6);
}

.matrix-step .summary-chip,
.matrix-step .preference-deck,
.matrix-step .preference-lane,
.matrix-step .quality-gate {
  background: rgba(8, 10, 9, 0.5);
  border-color: rgba(185, 136, 82, 0.3);
}

.matrix-step .preference-target-btn,
.matrix-step .preference-deck-tag,
.matrix-step .summary-edit {
  color: var(--ivory, #eee6d6);
  border-color: rgba(185, 136, 82, 0.4);
}

.matrix-step .preference-target-btn[aria-pressed="true"],
.matrix-step .preference-deck-tag.is-in-must_have,
.matrix-step .preference-deck-tag.is-in-nice_to_have {
  background: rgba(185, 136, 82, 0.18);
  color: var(--ivory, #eee6d6);
}

.matrix-chip,
.matrix-nav .matrix-back,
.matrix-nav .matrix-next {
  letter-spacing: 0;
}

.matrix-nav {
  border-top-color: rgba(124, 91, 56, 0.24);
}

.preview-card {
  background:
    linear-gradient(180deg, rgba(18, 35, 30, 0.74), rgba(9, 13, 12, 0.96));
  box-shadow: 0 28px 80px -62px rgba(0, 0, 0, 0.9);
}

.preview-head {
  padding: 18px 20px 14px;
}

.preview-title {
  font-size: 22px;
  letter-spacing: 0;
}

.preview-eyebrow,
.preview-label,
.preview-row[data-kind="status"] .preview-value {
  font-size: 12px;
  letter-spacing: 0.03em;
}

.preview-body {
  padding: 18px 20px 22px;
  gap: 14px;
}

.preview-row {
  grid-template-columns: 1fr;
  gap: 5px;
}

.preview-label {
  font-size: 12px;
  letter-spacing: 0;
}

.preview-value {
  font-size: 16px;
}

.matrix-grid.has-preview {
  width: min(860px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "step";
}

.matrix-grid.has-preview .matrix-section-index,
.matrix-grid.has-preview .matrix-preview-region {
  display: none;
}

@media (min-width: 1080px) {
  .matrix-grid.has-preview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "step";
  }

  .matrix-step-region {
    max-width: none;
  }
}

@media (min-width: 1240px) {
  .matrix-grid.has-preview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "step";
    gap: 0;
  }
}

@media (max-width: 760px) {
  .matrix-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .matrix-shell .route-nav {
    width: 100%;
    margin-bottom: 18px;
  }

  .matrix-shell-head {
    display: grid;
    gap: 13px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .matrix-shell-title {
    font-size: clamp(36px, 12vw, 48px);
    margin-bottom: 8px;
  }

  .matrix-shell-sub {
    max-width: none;
    line-height: 1.42;
  }

  .matrix-personal-link-head .matrix-shell-title {
    font-size: clamp(34px, 10.5vw, 46px);
    max-width: 13ch;
  }

  .matrix-file-strip {
    display: none;
  }

  .matrix-workbench-note {
    display: none;
  }

  .matrix-shell-sub,
  .matrix-helper {
    font-size: 16px;
  }

  .matrix-step {
    padding: 26px 20px;
  }
}
