/* =========================================================
   Project browser (projects.html) — rail + case-study viewer
   ========================================================= */
.console { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; padding-top: var(--nav-h); }

/* ---------- rail ---------- */
.rail { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-width: 0; }
.rail-head { padding: 24px 22px 16px; border-bottom: 1px solid var(--line); }
.rail-head .eyebrow { display: flex; justify-content: space-between; font-size: 11px; }
.rail-head .eyebrow b { color: var(--hot); font-weight: 500; }
.rail-list { flex: 1; overflow-y: auto; padding: 10px 0 20px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail-item { position: relative; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 2px 4px; width: 100%; text-align: left; padding: 12px 22px; color: var(--muted); transition: color .2s, background .2s; }
.rail-item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--hot); transform: scaleY(0); transition: transform .35s var(--ease); }
.rail-item:hover { color: var(--text); background: rgba(255,255,255,.02); }
.rail-item.active { color: var(--text); background: linear-gradient(90deg, rgba(255,106,43,.09), transparent 80%); }
.rail-item.active::before { transform: scaleY(1); }
.rail-item .c { font-family: var(--font-mono); font-size: 11px; color: var(--dim); grid-row: span 2; }
.rail-item.active .c { color: var(--hot); }
.rail-item .t { font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.rail-item .r { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; }
.rail-foot { padding: 14px 22px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--dim); }
.rail-foot kbd { font-family: inherit; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; color: var(--muted); }

/* ---------- viewer ---------- */
.viewer { min-width: 0; }
.cs { animation: swapIn .6s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cs-pad { padding: 0 clamp(20px, 4.5vw, 72px); max-width: 1180px; margin: 0 auto; }

/* header: title left, framed cover right, blurred cover as atmosphere */
.cs-hero { position: relative; overflow: hidden; padding: 44px 0 10px; }
.cs-hero-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(50px) brightness(.32) saturate(1.3); }
.cs-hero-bg.art-bg { background: radial-gradient(60% 80% at 75% 40%, rgba(90,209,255,.14), transparent 70%), radial-gradient(40% 60% at 60% 90%, rgba(255,106,43,.12), transparent 70%); filter: none; }
.cs-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, transparent 40%); pointer-events: none; }
.cs-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 4vw, 56px); align-items: end; }
.cs-hero-text { padding-bottom: 6px; }
.cs-hero-fig { position: relative; margin: 0; height: min(64vh, 600px); min-height: 340px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #0a0e14; cursor: zoom-in; box-shadow: 0 40px 100px rgba(0,0,0,.55); }
.cs-hero-fig.art { cursor: default; height: auto; min-height: 0; aspect-ratio: 16 / 9; align-self: center; background: #070b12; }
.cs-hero-fig img, .cs-hero-fig .cover-art { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.cs-hero-fig:hover img { transform: scale(1.03); }
.cs-hero-fig img.contain { object-fit: contain; background: #e9ecf0; padding: 18px; }
.corner { position: absolute; width: 16px; height: 16px; border: 0 solid var(--hot); z-index: 2; pointer-events: none; }
.corner.tl { top: 12px; left: 12px; border-top-width: 1.5px; border-left-width: 1.5px; }
.corner.tr { top: 12px; right: 12px; border-top-width: 1.5px; border-right-width: 1.5px; }
.corner.bl { bottom: 12px; left: 12px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner.br { bottom: 12px; right: 12px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.cs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 16px; }
.cs-meta .code { color: var(--hot); }
.cs-meta .sep { width: 18px; height: 1px; background: var(--line-2); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(5,7,11,.55); backdrop-filter: blur(6px); letter-spacing: .08em; }
.pill.regime { border-color: rgba(255,106,43,.5); color: var(--hot-2); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status-dot.active { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.done { background: var(--cold); }
.cs-title { font-size: clamp(34px, 3.6vw, 66px); }

/* brief + data sheet */
.cs-top { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(30px, 5vw, 70px); padding-top: 34px; padding-bottom: 20px; }
.cs-brief { font-size: clamp(20px, 2vw, 27px); line-height: 1.45; color: var(--text); font-weight: 450; letter-spacing: -.005em; margin: 0 0 22px; }
.cs-role { font-size: 14.5px; color: var(--muted); margin: 0; }
.cs-role b { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; margin-right: 8px; }
.sheet { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; align-self: start; }
.sheet-h { display: flex; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; color: var(--dim); }
.sheet dl { margin: 0; }
.sheet div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.sheet div:last-child { border-bottom: 0; }
.sheet dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; padding-top: 2px; }
.sheet dd { margin: 0; font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }

.cs-link { margin-top: 22px; }
.note { display: flex; gap: 14px; padding: 16px 18px; border: 1px dashed rgba(255,106,43,.45); border-radius: 10px; background: rgba(255,106,43,.05); color: #d6c3b8; font-size: 14.5px; margin: 26px 0 0; }
.note::before { content: "ITAR"; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; color: var(--hot); padding-top: 3px; }

/* chapters */
.chapters { padding-top: 40px; }
.ch { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); gap: 0 44px; padding: 46px 0; border-top: 1px solid var(--line); align-items: start; }
.ch.noimg { grid-template-columns: 80px minmax(0, 1fr); }
.ch.noimg .ch-body { max-width: 760px; }
.ch.wide { grid-template-columns: 80px minmax(0, 1fr); }
.ch.wide .ch-fig { grid-column: 2; margin-top: 26px; }
.ch-n { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 40px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--line-2); }
.ch h3 { margin: 0 0 16px; font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.ch p { margin: 0; color: var(--soft); font-size: 16.5px; }
.ch ul { list-style: none; margin: 0; padding: 0; }
.ch li { position: relative; padding: 0 0 12px 22px; color: var(--soft); font-size: 15.5px; }
.ch li::before { content: ""; position: absolute; left: 0; top: 11px; width: 10px; height: 1px; background: var(--hot); }
.ch strong { color: var(--text); font-weight: 600; }
.ch a { color: var(--hot-2); border-bottom: 1px solid rgba(255,106,43,.4); }
.ch-fig { margin: 0; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0a0e14; cursor: zoom-in; }
.ch-fig img { width: 100%; height: auto; max-height: 520px; object-fit: cover; transition: transform .8s var(--ease); }
.ch-fig:hover img { transform: scale(1.02); }
.ch-fig.contain { background: #e9ecf0; }
.ch-fig.contain img { object-fit: contain; padding: 14px; max-height: 460px; }
.ch-fig.dark { background: #44484d; }
.ch-fig.dark img { padding: 0; }
.ch-fig figcaption, .ex-grid figcaption { padding: 10px 14px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .03em; background: var(--panel); border-top: 1px solid var(--line); }
.ch:nth-child(even):not(.wide):not(.noimg) .ch-fig { order: -1; }
.ch:nth-child(even):not(.wide):not(.noimg) { grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); }
.ch:nth-child(even):not(.wide):not(.noimg) .ch-n { order: -2; }

/* Neptune timeline */
.mtl-wrap { padding: 46px 0 10px; border-top: 1px solid var(--line); }
.mtl-wrap h3 { margin: 0 0 30px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .18em; font-weight: 500; text-transform: uppercase; color: var(--hot); }
.mtl { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-bottom: 30px; }
.mtl::before { content: ""; position: absolute; left: 0; right: 0; top: 47px; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.mtl-i { position: relative; padding-right: 12px; }
.mtl-i .dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; height: 34px; }
.mtl-i .node { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--hot); background: var(--bg); margin: 7px 0 16px; position: relative; z-index: 1; }
.mtl-i.done .node { background: var(--hot); box-shadow: 0 0 14px rgba(255,106,43,.6); }
.mtl-i.done::after { content: ""; position: absolute; left: 0; right: 0; top: 47px; height: 1px; background: var(--hot); }
.mtl-i h5 { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.mtl-i p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* exhibits (CAD models, jobs) */
.exhibit { padding: 46px 0; border-top: 1px solid var(--line); }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ex-head h3 { margin: 0; font-family: var(--font-display); font-stretch: 112%; font-size: clamp(21px, 2vw, 27px); font-weight: 700; line-height: 1.2; }
.ex-head .d { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.ex-head .d a { color: var(--hot-2); border-bottom: 1px solid rgba(255,106,43,.4); }
.exhibit > p { color: var(--soft); margin: 0 0 14px; max-width: 820px; }
.exhibit ul { list-style: none; margin: 0 0 6px; padding: 0; max-width: 860px; }
.exhibit li { position: relative; padding: 0 0 10px 22px; color: var(--soft); font-size: 15.5px; }
.exhibit li::before { content: ""; position: absolute; left: 0; top: 11px; width: 10px; height: 1px; background: var(--hot); }
.exhibit strong { color: var(--text); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 22px; }
.ex-grid.solo { grid-template-columns: minmax(0, 680px); }
.ex-grid figure { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #0a0e14; cursor: zoom-in; display: flex; flex-direction: column; }
.ex-grid figure.wide { grid-column: span 2; }
.ex-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; flex: 1; }
.ex-grid figure.wide img { aspect-ratio: 16 / 7; }
.ex-grid figure.contain { background: #e9ecf0; }
.ex-grid figure.contain img { object-fit: contain; padding: 10px; }

/* photo strip */
.strip-wrap { padding: 46px 0 0; border-top: 1px solid var(--line); }
.strip-wrap h3, .tools h3 { margin: 0 0 18px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .18em; font-weight: 500; text-transform: uppercase; color: var(--hot); }
.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.strip figure { margin: 0; flex: 0 0 auto; height: 260px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); position: relative; scroll-snap-align: start; cursor: zoom-in; background: #0a0e14; }
.strip figure.contain { background: #e9ecf0; }
.strip img { height: 100%; width: auto; max-width: 520px; object-fit: cover; }
.strip figure.contain img { object-fit: contain; padding: 10px; width: 340px; }
.strip figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-family: var(--font-mono); font-size: 10.5px; color: #dfe5ee; background: linear-gradient(0deg, rgba(5,7,11,.9), transparent); }

.tools { padding: 46px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip { font-family: var(--font-mono); font-size: 11.5px; color: #b6c0cf; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }

/* prev / next */
.cs-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 70px 0 90px; }
.cs-nav button { position: relative; text-align: left; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s; min-height: 130px; display: flex; flex-direction: column; justify-content: flex-end; }
.cs-nav button img, .cs-nav button .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; transition: opacity .4s, transform .8s var(--ease); }
.cs-nav button:hover img, .cs-nav button:hover .cover-art { opacity: .45; transform: scale(1.04); }
.cs-nav button:hover { border-color: var(--line-2); }
.cs-nav button:last-child { text-align: right; align-items: flex-end; }
.cs-nav .k, .cs-nav .t { position: relative; }
.cs-nav .k { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.cs-nav .t { font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-size: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .cs-top { grid-template-columns: 1fr; }
  .ch, .ch:nth-child(even):not(.wide):not(.noimg) { grid-template-columns: 60px minmax(0, 1fr); }
  .ch .ch-fig { grid-column: 2; margin-top: 24px; order: 0 !important; }
  .ch-n { font-size: 32px; }
}
@media (max-width: 960px) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: var(--nav-h); height: auto; z-index: 50; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(8,11,17,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .rail-head, .rail-foot { display: none; }
  .rail-list { display: flex; overflow-x: auto; overflow-y: hidden; padding: 10px 12px; gap: 6px; scrollbar-width: none; }
  .rail-list::-webkit-scrollbar { display: none; }
  .rail-item { display: flex; gap: 8px; width: auto; flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; }
  .rail-item::before, .rail-item .r { display: none; }
  .rail-item.active { border-color: var(--hot); background: rgba(255,106,43,.1); }
  .rail-item .t { font-size: 13px; white-space: nowrap; }
  .cs-hero { padding-top: 28px; }
  .cs-hero-grid { grid-template-columns: 1fr; }
  .cs-hero-fig { height: 52vh; min-height: 280px; }
  .mtl { grid-template-columns: 1fr; padding-left: 26px; }
  .mtl::before { left: 6px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 12px); }
  .mtl-i { padding: 0 0 22px; }
  .mtl-i.done::after { display: none; }
  .mtl-i .dt { height: auto; }
  .mtl-i .node { position: absolute; left: -26px; top: -2px; margin: 0; }
}
@media (max-width: 640px) {
  .ch, .ch:nth-child(even):not(.wide):not(.noimg), .ch.noimg, .ch.wide { grid-template-columns: 1fr; padding: 36px 0; }
  .ch .ch-fig, .ch.wide .ch-fig { grid-column: 1; }
  .ch-n { font-size: 26px; margin-bottom: 10px; }
  .ex-grid { grid-template-columns: 1fr 1fr; }
  .ex-grid figure.wide { grid-column: 1 / -1; }
  .strip figure { height: 200px; }
  .cs-nav { grid-template-columns: 1fr; }
  .cs-nav button:last-child { text-align: left; align-items: flex-start; }
  .sheet div { grid-template-columns: 100px 1fr; }
}
