:root {
  --bg: #0e1012;
  --panel: #15181c;
  --panel-alt: #1b1f24;
  --ink: #eceff4;
  --ink-soft: #a7aeb8;
  --muted: #707885;
  --signal: #f06428;
  --ok: #3fbf7f;
  --line: #282d35;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Fixed Left Sidebar + Main Fluid Canvas */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rail-brand {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.rail-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(63, 191, 127, 0.7);
}
.rail-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}
.rail-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.rail-nav {
  display: grid;
  gap: 4px;
  margin: 28px 0 auto;
}
.rail-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.rail-nav a:hover {
  background: var(--panel-alt);
  color: var(--ink);
}
.rail-nav a.active {
  background: var(--panel-alt);
  border-color: var(--line);
  border-left: 2px solid var(--signal);
  color: var(--ink);
}

.rail-meta {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.7;
}

.mobile-bar {
  display: none;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  justify-content: space-between;
  align-items: center;
}
.menu-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 0.76rem;
  cursor: pointer;
}

.main-canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Full-Bleed Overlay Hero */
.studio-hero {
  position: relative;
  border-bottom: 1px solid var(--line);
}
.studio-hero-img {
  width: 100%;
  height: 430px;
  object-fit: cover;
  filter: brightness(0.68) contrast(1.06);
}
.studio-hero-overlay {
  position: absolute;
  inset: 0;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(14,16,18,0.15) 0%, rgba(14,16,18,0.9) 100%);
}
.mono-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 10px;
}
.studio-hero-overlay h1 {
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  max-width: 720px;
}
.studio-hero-overlay p {
  margin: 0;
  max-width: 640px;
  color: var(--ink-soft);
}

/* 1px Hairline Telemetry Strip */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.tele-cell {
  padding: 20px 28px;
  border-right: 1px solid var(--line);
}
.tele-cell:last-child { border-right: none; }
.tele-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tele-val {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 4px;
}

/* Hairline Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.bento-cell {
  padding: 32px 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.bento-cell:nth-child(2n) { border-right: none; }
.bento-cell img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
.bento-cell h2, .bento-cell h3 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}
.bento-cell p {
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.action-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
}
.action-link:hover { text-decoration: underline; }

/* Subpage Header & Sections */
.sub-banner {
  padding: 44px 40px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sub-banner h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 10px;
}
.sub-banner p { margin: 0; color: var(--ink-soft); max-width: 680px; }

.pad-block { padding: 36px 40px; border-bottom: 1px solid var(--line); }

/* Rack-Style Estimator */
.rack-box {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
}
.rack-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92rem;
}
.rack-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--bg);
}
.readout-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.readout-cell:last-child { border-right: none; }
.readout-cell span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.readout-cell strong { display: block; font-family: var(--mono); font-size: 1.25rem; color: var(--signal); margin-top: 4px; }

.dark-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.dark-table th, .dark-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.dark-table th {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-footer {
  margin-top: auto;
  padding: 20px 40px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    display: none;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar.is-open { display: flex; }
  .mobile-bar { display: flex; }
  .telemetry-bar, .bento-grid, .rack-controls, .rack-readout { grid-template-columns: 1fr; }
  .tele-cell, .bento-cell, .readout-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .sub-banner, .pad-block, .status-footer { padding-left: 20px; padding-right: 20px; }
  .studio-hero-overlay { padding: 24px 20px; }
}
