/* Kourashi Systems Hangar. Loads after blueprint.css and shares its tokens:
   charcoal chrome, paper reading surfaces, square corners, bracket labels. */

.hg-hero .ks-hero-media { object-position: 62% 50%; }
.hg-hero .ks-hero-copy h1 { max-width: 12ch; }

.hg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; margin-bottom: 36px; }
.hg-head p { max-width: 52ch; color: var(--muted); }
.dark .hg-head p { color: var(--muted-dark); }

/* A bay holds one aircraft. */
.bay { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--raised); border: 1px solid var(--line); }
.bay + .bay { margin-top: 24px; }
.bay-media { position: relative; display: block; background: var(--charcoal); overflow: hidden; min-height: 320px; }
.bay-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 600ms var(--ease); }
.bay-body { padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.bay-body h3 { font-size: clamp(1.9rem, 3vw, 2.6rem); letter-spacing: -0.03em; line-height: 1; }
.bay-body h3 a { text-decoration: none; }
.bay-body > p { color: var(--muted); max-width: 46ch; }
.bay-tags { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.bay-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 6px; }
.bay-facts div { background: var(--raised); padding: 12px 14px; }
.bay-facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bay-facts dd { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.bay-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 12px; }
@media (hover: hover) and (pointer: fine) { .bay:hover .bay-media img { transform: scale(1.03); } }
.bay-empty { display: block; padding: 36px; border: 1px dashed var(--line-strong); background: transparent; }
.bay-empty p { color: var(--muted); max-width: 60ch; margin-top: 8px; }

/* What is in a download */
.kit { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.kit li { list-style: none; background: var(--charcoal); padding: 24px 20px 28px; }
.kit .label { display: block; margin-bottom: 28px; }
.kit h3 { font-size: 1.1rem; margin-bottom: 8px; }
.kit p { font-size: 14px; line-height: 1.6; color: var(--muted-dark); }
.kit.light { background: var(--line); border-color: var(--line); }
.kit.light li { background: var(--raised); }
.kit.light p { color: var(--muted); }
.hg-note { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 16px; }
.dark .hg-note { color: var(--muted-dark); }

.hg-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Licence comparison */
.lic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.lic .tile h3 { margin: 10px 0 12px; }
.lic ul { list-style: none; border-top: 1px solid var(--line); }
.lic li { padding: 11px 0 11px 30px; border-bottom: 1px solid var(--line); position: relative; font-size: 15px; }
.lic li::before { position: absolute; left: 0; top: 11px; font-family: var(--mono); font-size: 13px; }
.lic .yes li::before { content: "[+]"; color: var(--ok); }
.lic .no li::before { content: "[x]"; color: var(--danger); }
.lic .tile > p { color: var(--muted); font-size: 15px; margin-top: 14px; }

/* Product page */
.crumb { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); padding: 20px 0 0; }
.crumb a { text-decoration: none; } .crumb a:hover { color: var(--ink); }
.prod { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: start; padding: 20px 0 72px; }
.gal-stage { background: var(--charcoal); border: 1px solid var(--charcoal); aspect-ratio: 16 / 10; overflow: hidden; }
.gal-stage img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--t-ui) var(--ease); }
.gal-stage img.swap { opacity: 0.25; }
.gal-cap { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 1.6em; }
.gal-thumbs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.gal-thumbs button { padding: 0; border: 1px solid var(--line); background: var(--charcoal); cursor: pointer; aspect-ratio: 16 / 10; overflow: hidden; opacity: 0.6; transition: opacity var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease); }
.gal-thumbs button:hover { opacity: 1; }
.gal-thumbs button[aria-pressed="true"] { opacity: 1; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy { position: sticky; top: calc(var(--navh) + 24px); }
.buy h1 { font-size: clamp(2.6rem, 5vw, 4rem); margin: 10px 0 12px; }
.buy .lede { font-size: 1.05rem; color: #3B3D41; }
.buy .ks-specs { margin-top: 24px; }
.buy .ks-specs > div { grid-template-columns: 130px minmax(0, 1fr); padding: 11px 0; }
.buy .ks-specs dd { font-size: 15px; }
.buy-box { margin-top: 24px; border: 1px solid var(--line); background: var(--raised); padding: 20px; }
.buy-price { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; color: var(--muted); }
.buy-price.is-set { font-size: 2.2rem; color: var(--ink); line-height: 1; }
.buy-box .btn { width: 100%; justify-content: center; margin-top: 14px; }
.buy-box p { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: 12px; }
.buy-box p a { color: inherit; }

.parts details { border-top: 1px solid var(--line); }
.parts details:last-of-type { border-bottom: 1px solid var(--line); }
.parts summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; font-family: var(--display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
.parts summary::-webkit-details-marker { display: none; }
.parts summary span { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.04em; color: var(--muted); }
.parts summary::after { content: "+"; font-family: var(--mono); font-weight: 400; color: var(--muted); margin-left: auto; }
.parts details[open] summary::after { content: "\2212"; }
.parts summary span { margin-left: 4px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 20px; }
.ptable th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-strong); }
.ptable td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ptable td:nth-child(2) { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.ptable td:nth-child(3) { white-space: nowrap; }
.ptable td:last-child { color: var(--muted); font-size: 14px; }
.table-scroll { overflow-x: auto; }

.mat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.mat .tile h3 { margin: 8px 0 10px; }
.mat .tile p { font-size: 15px; color: #3B3D41; }
.mat .tile p + p { margin-top: 10px; color: var(--muted); font-size: 14px; }

.status-band { border-left: 3px solid var(--warn-dark); padding: 4px 0 4px 20px; max-width: 70ch; }
.status-band p { color: #D6D7DA; margin-top: 8px; }

.footer .cols { display: flex; flex-wrap: wrap; gap: 8px 28px; }
[hidden] { display: none !important; }

@media (max-width: 1000px) {
  .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hg-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod { grid-template-columns: 1fr; gap: 32px; }
  .buy { position: static; }
}
@media (max-width: 820px) {
  .bay { grid-template-columns: 1fr; }
  .bay-media { min-height: 0; aspect-ratio: 16 / 10; }
  .bay-body { padding: 24px; }
  .lic, .mat { grid-template-columns: 1fr; }
  .pub-two { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .kit, .hg-steps { grid-template-columns: 1fr; }
  .kit .label { margin-bottom: 12px; }
  .gal-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pub-links { display: none; }
  .ptable td:nth-child(3) { white-space: normal; }
}

/* 3D viewer */
.v3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line-dark); background: #0E0F11; }
.v3.live { grid-template-columns: minmax(0, 1fr) 320px; }
.v3-stage { position: relative; aspect-ratio: 16 / 10; min-height: 420px; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #1E1F23 0%, #0E0F11 70%); }
.v3.live .v3-stage { aspect-ratio: auto; min-height: 600px; }
.v3-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline-offset: -2px; }
.v3-stage canvas:active { cursor: grabbing; }
.v3-poster { position: absolute; inset: 0; z-index: 3; }
.v3-poster img { width: 100%; height: 100%; object-fit: contain; opacity: 0.55; }
.v3-poster-ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.v3-msg { font-size: 14px; color: var(--muted-dark); max-width: 40ch; text-align: center; min-height: 1.5em; }
.v3-dots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.v3-dot { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.85); background: rgba(18,19,21,.72); color: #fff; font-family: var(--mono); font-size: 10px; line-height: 1; display: grid; place-items: center; cursor: pointer; pointer-events: auto; will-change: transform; transition: background var(--t-ui) var(--ease), color var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease); }
.v3-dot:hover { background: #fff; color: var(--charcoal); }
.v3-dot.on { background: var(--warn-dark); border-color: var(--warn-dark); color: var(--charcoal); box-shadow: 0 0 0 5px rgba(242,179,61,.22); }
.v3-tip { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; background: #fff; color: var(--charcoal); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 5px 8px; white-space: nowrap; }
.v3-bar { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.v3-seg { display: flex; border: 1px solid #4A4C52; background: rgba(18,19,21,.8); }
.v3-seg button, .v3-reset { font: 500 13px var(--sans); color: var(--muted-dark); background: transparent; border: 0; padding: 10px 14px; min-height: 40px; cursor: pointer; transition: color var(--t-ui) var(--ease), background var(--t-ui) var(--ease); }
.v3-seg button + button { border-left: 1px solid #4A4C52; }
.v3-seg button:hover, .v3-reset:hover { color: #fff; }
.v3-seg button[aria-pressed="true"] { background: #fff; color: var(--charcoal); }
.v3-slide { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--muted-dark); background: rgba(18,19,21,.8); border: 1px solid #4A4C52; padding: 0 14px; min-height: 42px; }
.v3-slide input { width: 140px; accent-color: #fff; }
.v3-reset { border: 1px solid #4A4C52; background: rgba(18,19,21,.8); margin-left: auto; }
.v3-legend { position: absolute; left: 16px; top: 16px; z-index: 4; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 11px; color: var(--muted-dark); background: rgba(18,19,21,.8); border: 1px solid #4A4C52; padding: 8px 12px; max-width: calc(100% - 32px); }
.v3-legend li { display: flex; align-items: center; gap: 6px; }
.v3-legend i { width: 10px; height: 10px; display: block; }
.v3-side { border-left: 1px solid var(--line-dark); display: flex; flex-direction: column; max-height: 600px; }
.v3-card { padding: 20px; border-bottom: 1px solid var(--line-dark); min-height: 208px; }
.v3-card h3 { font-size: 1.2rem; margin: 8px 0 8px; }
.v3-card p { font-size: 14px; line-height: 1.6; color: #C9CACE; }
.v3-facts { margin-top: 12px; border-top: 1px solid var(--line-dark); }
.v3-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-dark); font-size: 13px; }
.v3-facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-dark); padding-top: 2px; }
.v3-list { list-style: none; overflow-y: auto; flex: 1; }
.v3-list button { width: 100%; text-align: left; display: flex; gap: 12px; align-items: baseline; padding: 11px 20px; background: transparent; border: 0; border-bottom: 1px solid var(--line-dark); color: #E4E5E7; font: 500 14px var(--sans); cursor: pointer; transition: background var(--t-ui) var(--ease); }
.v3-list button:hover { background: #1B1C1F; }
.v3-list button[aria-current="true"] { background: #1B1C1F; box-shadow: inset 3px 0 0 var(--warn-dark); }
.v3-list button[aria-current="true"] .label { color: var(--warn-dark); }
@media (max-width: 900px) {
  .v3.live { grid-template-columns: 1fr; }
  .v3.live .v3-stage { min-height: 0; aspect-ratio: 4 / 4.2; }
  .v3-stage { min-height: 0; aspect-ratio: 4 / 3.4; }
  .v3-side { border-left: 0; border-top: 1px solid var(--line-dark); max-height: none; }
  .v3-card { min-height: 0; }
  .v3-list { display: grid; grid-template-columns: 1fr 1fr; }
  .v3-list button { padding: 11px 14px; }
  .v3-slide input { width: 90px; }
  .v3-reset { margin-left: 0; }
}
.v3-list .label, .v3-card .label { white-space: nowrap; }

/* Build log */
.bl-h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; margin: 10px 0 14px; max-width: 18ch; }
.bl-list { list-style: none; margin: 40px 0 0; padding: 0; max-width: 760px; }
.bl-item { padding: 28px 0; border-top: 1px solid var(--line-strong); }
.bl-head { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.bl-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bl-title { font-size: 24px; line-height: 1.2; margin: 10px 0 8px; color: var(--ink, #121315); }
.bl-text { font-family: var(--sans, Inter, sans-serif); font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 62ch; margin-top: 8px; }
.bl-fig { margin: 18px 0 0; }
.bl-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--line-strong); }
#logEmpty { margin-top: 40px; }
#logEmpty[hidden] { display: none; }
