/*
 * Flight Atlas — graphite gallery theme
 * Keeps the 3D models and information architecture intact while replacing
 * the former blue-tinted UI with neutral black, warm white and champagne.
 */

:root,
.dark {
  color-scheme: dark;
  --background: #050505;
  --foreground: #f1eee7;
  --card: #11110f;
  --card-foreground: #f1eee7;
  --popover: #11110f;
  --popover-foreground: #f1eee7;
  --primary: #d4b777;
  --primary-foreground: #12100c;
  --secondary: #191917;
  --secondary-foreground: #f1eee7;
  --muted: #171715;
  --muted-foreground: #9d9a92;
  --accent: #24221d;
  --accent-foreground: #f6f1e7;
  --border: rgba(255, 255, 255, 0.13);
  --input: rgba(255, 255, 255, 0.17);
  --ring: #d4b777;
}

html {
  background: #050505;
}

body,
.gallery,
.fleet-gallery {
  background: #050505;
  color: #f1eee7;
}

::selection {
  color: #0a0907;
  background: #d4b777;
}

button:focus-visible,
a:focus-visible {
  outline-color: #d4b777;
}

/* Navigation */
.fleet-gallery .topbar,
.topbar {
  background: rgba(5, 5, 5, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.38);
}

.brand {
  color: #f6f1e7;
  text-shadow: 0 0 28px rgba(212, 183, 119, 0.13);
}

.brand-rule {
  background: #6f6653;
}

.overline,
.edition,
.fleet-gallery .top-actions > a {
  color: #98958e;
}

.fleet-gallery .top-actions > a:hover,
.quiet-button:hover,
.icon-button:hover,
.jump-compare:hover {
  color: #e1c98f;
}

.quiet-button,
.icon-button,
.jump-compare,
.theme-toggle {
  color: #c4c0b7;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: #11110f;
  font-size: 12px;
}

.theme-toggle:hover {
  color: #17130b;
  border-color: #d4b777;
  background: #d4b777;
}

.stage-sort,
.picker-toggle {
  color: #c4c0b7;
  border-color: rgba(255, 255, 255, 0.17);
  background: #11110f;
}

.stage-sort:hover,
.stage-sort[aria-pressed='true'],
.picker-toggle:hover {
  color: #17130b;
  border-color: #d4b777;
  background: #d4b777;
}

.picker-toggle small {
  color: #8f8b83;
}

.picker-toggle:hover small {
  color: #4b402a;
}

/* Company gallery */
.company-nav {
  background: #090909;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.company-tabs,
.mode-tabs,
.spec-tabs,
.reuse-tabs {
  background: #11110f !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.company-tabs [data-slot='tabs-trigger'],
.mode-tabs [data-slot='tabs-trigger'],
.spec-tabs [data-slot='tabs-trigger'],
.reuse-tabs [data-slot='tabs-trigger'] {
  color: #a5a198;
}

.company-tabs [data-active],
.company-tabs [data-state='active'],
.mode-tabs [data-active],
.mode-tabs [data-state='active'],
.spec-tabs [data-active],
.spec-tabs [data-state='active'],
.reuse-tabs [data-active],
.reuse-tabs [data-state='active'] {
  color: #17130b !important;
  background: #d4b777 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 220, 0.35);
}

.company-description {
  color: #98958e;
  background: #0b0b0a;
  border-color: rgba(255, 255, 255, 0.1);
}

.family-note {
  background: #10100e;
  border-color: rgba(255, 255, 255, 0.11);
}

.family-note h2,
.family-note strong {
  color: #efeae0;
}

.family-note p {
  color: #aaa69e;
}

.family-note a,
.metric-source:hover,
.source-mini a:hover,
.timeline-detail > a,
.payload-detail > a {
  color: #d9bd7e;
}

/* 3D viewing room */
.stage-toolbar {
  color: #cbc6bc;
  background: #090909;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.stage {
  background: #090909;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.58);
}

.scene-host {
  background: #090909;
}

.scale-badge,
.stage-foot,
.model-note,
.stage-heading p {
  color: #88857e;
}

.scale-badge i {
  background: #d4b777;
  box-shadow: 0 0 0 3px rgba(212, 183, 119, 0.1);
}

.eyebrow,
.detail-identity span,
.payload-detail > span {
  color: #bba66f;
}

.camera-controls {
  background: rgba(13, 13, 12, 0.9);
  border-color: rgba(255, 255, 255, 0.17);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.camera-controls button {
  color: #c9c5bc;
}

.camera-controls button:hover {
  color: #fffaf0;
  background: #292721;
}

.camera-controls > span {
  background: rgba(255, 255, 255, 0.16);
}

.scene-tip,
.toast {
  color: #17130b;
  background: #e7d3a3;
}

.vehicle-strip {
  background: #0d0d0c;
  border-color: rgba(255, 255, 255, 0.12);
}

.vehicle-item {
  border-color: rgba(255, 255, 255, 0.09);
}

.vehicle-item:hover {
  background: #171715;
}

.vehicle-item.selected {
  background: #1d1b17;
}

.vehicle-item.selected::before {
  background: #d4b777;
}

.item-title small,
.item-height small,
.item-index {
  color: #817e77;
}

.item-height {
  color: #ded9cf;
}

.model-note button {
  color: #c2ad78;
}

/* Product dossier */
.detail-panel {
  color: #f1eee7;
  background: #10100f;
  border-left-color: rgba(255, 255, 255, 0.12);
  box-shadow: -22px 0 54px rgba(0, 0, 0, 0.22);
}

.status {
  color: #d7c18c;
  border-color: rgba(212, 183, 119, 0.45);
  background: rgba(212, 183, 119, 0.05);
}

.version,
.role,
.mass-row p,
.insight p,
.part-detail p,
.material p,
.source-mini,
.source-scroll p {
  color: #9d9991;
}

.spec-grid,
.technical-summary,
.part-list button,
.source-scroll section {
  border-color: rgba(255, 255, 255, 0.12);
}

.spec-grid > div + div {
  border-left-color: rgba(255, 255, 255, 0.12);
}

.spec-grid span,
.mass-row > span,
.technical-summary dt,
.technical-summary small,
.section-label small,
.part-number,
.material > span,
.source-mini > span {
  color: #88847c;
}

.spec-grid strong,
.mass-row > strong,
.technical-summary dd,
.part-list button,
.source-scroll a {
  color: #ded9cf;
}

.part-list button:hover,
.part-list button.active {
  color: #f6edda;
  background: #26231d;
}

.part-list button svg {
  color: #9e8a5c;
}

.material {
  border-left-color: #a9905a;
}

.dimension-note {
  color: #c4aa70;
}

.focus-button,
.reset-comparison,
.table-sort-reset {
  color: #d9d3c7;
  border-color: rgba(255, 255, 255, 0.22);
  background: #121211;
}

.focus-button:hover,
.reset-comparison:hover,
.table-sort-reset:hover:not(:disabled) {
  color: #f6edda;
  background: #29261f;
  border-color: rgba(212, 183, 119, 0.48);
}

.source-dialog {
  color: #eee9df !important;
  background: #11110f !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7) !important;
}

/* Cross-company comparison */
.comparison-section {
  background: #080808;
  border-top-color: rgba(212, 183, 119, 0.45);
}

.comparison-intro p,
.comparison-table > p,
.table-title span {
  color: #96928a;
}

.comparison-picker {
  background: #0d0d0c;
  border-color: rgba(255, 255, 255, 0.14);
}

.comparison-picker legend {
  color: #ded9cf;
}

.comparison-picker legend span,
.picker-company-title,
.picker-item small,
.picker-height {
  color: #8f8b83;
}

.picker-item {
  background: #121211;
  border-color: rgba(255, 255, 255, 0.12);
}

.picker-item:hover {
  background: #1d1c19;
}

.picker-item.checked {
  background: #27231b;
  border-color: rgba(212, 183, 119, 0.62);
}

.comparison-table {
  background: #0f0f0e;
  border-top-color: rgba(255, 255, 255, 0.12);
}

.comparison-table th {
  color: #b5afa4;
  background: #191816;
}

.comparison-table td {
  color: #ccc7be;
  border-color: rgba(255, 255, 255, 0.1);
}

.comparison-table td small,
.comparison-table .product-company {
  color: #8c8880;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  background: #171612;
  box-shadow: 1px 0 rgba(255, 255, 255, 0.13);
}

.sort-buttons button {
  color: #aaa69d;
  border-color: rgba(255, 255, 255, 0.16);
}

.sort-buttons button:hover,
.sort-buttons button[aria-pressed='true'] {
  color: #15120b;
  background: #d4b777;
}

.sort-buttons button:focus-visible,
.table-sort-reset:focus-visible {
  outline-color: #d4b777;
}

/* Reusability research */
.reuse-section {
  background: #060606;
  border-top-color: rgba(212, 183, 119, 0.45);
}

.reuse-heading > div:first-child > p,
.reuse-kpis span,
.panel-toolbar small,
.timeline-legend > span,
.panel-note {
  color: #96928a;
}

.reuse-kpis,
.reuse-panel {
  background: #0e0e0d;
  border-color: rgba(255, 255, 255, 0.14);
}

.reuse-kpis p {
  border-color: rgba(255, 255, 255, 0.11);
}

.reuse-kpis strong {
  color: #e2c98f;
}

.panel-toolbar {
  background: #141412;
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-toolbar > div:first-child > span {
  color: #eee9df;
}

.timeline-detail {
  background: #151412;
  border-color: rgba(255, 255, 255, 0.11);
}

.detail-identity h3,
.timeline-detail dd,
.payload-name strong,
.payload-value,
.payload-detail > strong {
  color: #e2ddd4;
}

.detail-identity p,
.timeline-detail dt,
.timeline-company span,
.payload-name small,
.payload-value small,
.payload-axis-track span,
.payload-detail p,
.payload-detail .payload-explanation {
  color: #918d85;
}

.timeline-legend {
  background: #0c0c0b;
  border-color: rgba(255, 255, 255, 0.11);
}

.founding-marker {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #d4b777;
  border-radius: 50%;
  background: #0b0b0a;
  box-shadow: 0 0 0 3px rgba(212, 183, 119, 0.1);
}

.founding-node {
  position: absolute;
  z-index: 4;
  top: 56px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
}

.founding-node.edge-start { transform: none; }
.founding-node > span {
  position: absolute;
  bottom: 19px;
  left: 50%;
  color: #b9aa7e;
  font: 11px var(--font-geist-mono), monospace;
  letter-spacing: .04em;
  white-space: nowrap;
  transform: translateX(-50%);
}
.founding-node.edge-start > span { left: 0; transform: none; }
.founding-node:hover .founding-marker,
.founding-node:focus-visible .founding-marker { background: #d4b777; }

.capability-marker.is-hollow,
.track-break {
  background: #11110f;
}

.timeline-axis-row {
  background: #0a0a09;
}

.timeline-axis-label,
.timeline-axis,
.timeline-company {
  border-color: rgba(255, 255, 255, 0.17);
}

.timeline-axis-label,
.timeline-axis > span,
.axis-break {
  color: #8e8a82;
}

.timeline-row {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.timeline-row.tone-a {
  background: #131312;
}

.timeline-row.tone-b {
  background: #0b0b0a;
}

.timeline-company,
.timeline-row.tone-b .timeline-company {
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 4px 0 0 #9f8c62;
}

.timeline-row.tone-b .timeline-company {
  box-shadow: inset 4px 0 0 #5f5d58;
}

.timeline-company strong {
  color: #e1ddd4;
}

.timeline-track::before {
  background: rgba(255, 255, 255, 0.18);
}

.year-guide {
  background: rgba(255, 255, 255, 0.1);
}

.timeline-node {
  color: #a8a49c;
}

.timeline-node:hover,
.timeline-node:focus-visible,
.timeline-node.is-selected {
  color: #fffaf0;
  background: #302a20;
  outline-color: #a9915e;
}

.payload-row {
  border-color: rgba(255, 255, 255, 0.1);
}

.payload-row:hover,
.payload-row:focus-visible,
.payload-row.is-selected {
  background: #211e18;
}

.payload-bars {
  border-color: rgba(255, 255, 255, 0.16);
}

.payload-guide {
  background: rgba(255, 255, 255, 0.1);
}

.payload-max {
  background: #77736b;
}

.payload-reuse {
  background: #d4b777;
}

.payload-row.is-design .payload-max {
  color: #77736b;
}

.payload-row.is-design .payload-reuse {
  color: #d4b777;
}

.payload-detail {
  background: #14130f;
  border-color: rgba(255, 255, 255, 0.12);
}

.payload-detail .payload-explanation {
  border-color: rgba(255, 255, 255, 0.12);
}

.bottom-bar {
  color: #77736c;
  background: #050505;
  border-color: rgba(255, 255, 255, 0.12);
}

.bottom-bar a:hover {
  color: #d9bd7e;
}

@media (prefers-reduced-motion: no-preference) {
  .company-tabs [data-slot='tabs-trigger'],
  .mode-tabs [data-slot='tabs-trigger'],
  .spec-tabs [data-slot='tabs-trigger'],
  .reuse-tabs [data-slot='tabs-trigger'],
  .picker-item,
  .timeline-node,
  .vehicle-item {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
  }
}

@media (max-width: 760px) {
  .theme-toggle { padding-inline: 8px; }
  .theme-toggle span { display: none; }
}
