@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --void: #0c0f14;
  --panel: #141922;
  --panel-raised: #1a212d;
  --edge: #252d3a;
  --edge-strong: #344052;
  --text: #e6eaf0;
  --text-dim: #8a94a6;
  --text-faint: #566073;

  --tungsten: #ffb454;
  --tungsten-glow: rgba(255, 180, 84, 0.28);

  --ok: #4fd18b;
  --warn: #ffb454;
  --fault: #ff5d5d;
  --maint: #5aa9ff;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --rail-w: 232px;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.15rem;
}

p {
  margin: 0;
  max-width: 62ch;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: -0.01em;
}

.dim {
  color: var(--text-dim);
}

:focus-visible {
  outline: 2px solid var(--tungsten);
  outline-offset: 2px;
}

/* ---------- App shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 14px;
  background: var(--panel);
  border-right: 1px solid var(--edge);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  object-fit: contain;
  margin-top: 1px;
  filter: drop-shadow(0 0 6px var(--tungsten-glow));
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.08;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--edge-strong);
  transition: background 0.15s, box-shadow 0.15s;
}

.nav a:hover {
  background: var(--panel-raised);
  color: var(--text);
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--panel-raised);
}

.nav a[aria-current="page"]::before {
  background: var(--tungsten);
  box-shadow: 0 0 10px var(--tungsten-glow);
}

.nav svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-foot {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.rail-foot strong {
  display: block;
  font-weight: 600;
}

.main {
  min-width: 0;
  padding: 30px clamp(18px, 3.4vw, 44px) 60px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.page-head p {
  margin-top: 8px;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
  }

  .rail {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    height: auto;
    z-index: 20;
    flex-direction: row;
    padding: 6px 8px;
    border-right: 0;
    border-top: 1px solid var(--edge);
  }

  .brand,
  .rail-foot {
    display: none;
  }

  .nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  .nav a {
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    font-size: 0.72rem;
  }

  .nav a::before {
    left: 20%;
    right: 20%;
    top: 0;
    bottom: auto;
    width: auto;
    height: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
