@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #FAFAF7;
  --bg-warm: #F5F3EE;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A18;
  --text-secondary: #5C5B56;
  --text-muted: #8E8D88;
  --accent: #C4501A;
  --accent-light: #E8703A;
  --accent-bg: #FEF4EE;
  --green: #2D6A4F;
  --green-bg: #EDF5F0;
  --amber: #B45309;
  --amber-bg: #FEF7E6;
  --red: #B42318;
  --red-bg: #FEF3F2;
  --border: #E8E6E1;
  --border-strong: #D4D2CC;
  --shadow-sm: 0 1px 2px rgba(26,26,24,0.04);
  --shadow-md: 0 4px 16px rgba(26,26,24,0.06);
  --radius: 10px;
  --sidebar-width: 300px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-warm);
  border-right: 1px solid var(--border);
  padding: 28px 24px 40px;
}

.sidebar-brand {
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.sidebar-brand h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.7rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-weight: 400;
}

.sidebar-brand h1 em {
  font-style: italic;
  color: var(--accent);
}

.sidebar-brand .updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 8px;
}

.nav-block {
  margin-bottom: 28px;
}

.nav-block-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-block-label .count {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.nav-block.priority .nav-block-label {
  color: var(--red);
}

.nav-list {
  list-style: none;
  padding: 0;
}

.nav-list li {
  margin-bottom: 1px;
}

.nav-list a {
  display: block;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.nav-list a:hover {
  background: rgba(196,80,26,0.06);
  color: var(--text-primary);
}

.nav-list a.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}

.nav-list .gap-item a {
  font-size: 13px;
  padding: 6px 10px 6px 22px;
  position: relative;
  color: var(--text-secondary);
}

.nav-list .gap-item a::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.nav-list .gap-item a:hover::before {
  background: var(--red);
}

.nav-list .gap-item.urgent a::before {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(180,35,24,0.12);
}

/* ── MAIN ── */
.main {
  padding: 40px 56px 80px;
  max-width: 920px;
}

.section {
  margin-bottom: 72px;
  scroll-margin-top: 24px;
}

.section-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.section-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-weight: 400;
  margin-bottom: 12px;
}

.section h2 em {
  font-style: italic;
  color: var(--accent);
}

.section-summary {
  font-size: 16.5px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.7;
}

.section.priority {
  border-left: 3px solid var(--red);
  padding-left: 28px;
  margin-left: -28px;
  background: linear-gradient(90deg, rgba(180,35,24,0.02) 0%, transparent 60%);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.section.priority .section-mark {
  color: var(--red);
}

/* ── HERO / OVERVIEW ── */
.hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 2.8rem;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  font-weight: 400;
  margin-bottom: 16px;
}

.hero h2 em {
  font-style: italic;
  color: var(--accent);
}

.hero-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-meta span {
  display: inline-block;
}

.hero-summary {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 700px;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.hero-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.hero-stat .num {
  font-family: 'Instrument Serif', serif;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hero-stat.locked .num { color: var(--green); }
.hero-stat.live .num { color: var(--amber); }
.hero-stat.open .num { color: var(--red); }

.hero-stat .label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── ITEM CARDS ── */
.items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.item-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tag.locked {
  background: var(--green-bg);
  color: var(--green);
}

.tag.live {
  background: var(--amber-bg);
  color: var(--amber);
}

.tag.open {
  background: var(--red-bg);
  color: var(--red);
}

.item-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.item-stand {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.item-stand-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 6px;
}

.item-stand.open .item-stand-label {
  color: var(--red);
}

.item-stand.live .item-stand-label {
  color: var(--amber);
}

.item.priority {
  border-left: 3px solid var(--red);
}

.item.priority.medium {
  border-left-color: var(--amber);
}

.item.priority.low {
  border-left-color: var(--text-muted);
}

.item-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.item-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tag.urgent-tag {
  background: var(--red-bg);
  color: var(--red);
}

.tag.medium-tag {
  background: var(--amber-bg);
  color: var(--amber);
}

.tag.low-tag {
  background: var(--bg-warm);
  color: var(--text-muted);
}

.urgency-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.urgency-header:first-of-type { margin-top: 8px; }

.urgency-header.urgent { color: var(--red); border-bottom-color: rgba(180,35,24,0.15); }
.urgency-header.medium { color: var(--amber); border-bottom-color: rgba(180,83,9,0.15); }
.urgency-header.low { color: var(--text-muted); }

.urgency-count {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.urgency-header.urgent .urgency-count {
  background: var(--red-bg);
  border-color: rgba(180,35,24,0.2);
  color: var(--red);
}

.urgency-header.medium .urgency-count {
  background: var(--amber-bg);
  border-color: rgba(180,83,9,0.2);
  color: var(--amber);
}

.system-divider {
  margin: 90px 0 56px;
  padding: 36px 0 0;
  border-top: 2px solid var(--border-strong);
  text-align: left;
}

.divider-mark {
  font-family: 'Instrument Serif', serif;
  font-size: 2.2rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 400;
}

.divider-text {
  font-size: 15.5px;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
}

/* ── COLLAPSIBLE GAP CATEGORIES ── */
.gap-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  scroll-margin-top: 24px;
}

.gap-category[open] {
  box-shadow: var(--shadow-sm);
}

.gap-category > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
  transition: background 0.15s ease;
}

.gap-category > summary::-webkit-details-marker { display: none; }
.gap-category > summary::marker { display: none; }

.gap-category > summary:hover {
  background: var(--bg-warm);
}

.gap-category[open] > summary {
  border-bottom: 1px solid var(--border);
}

.cat-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  font-weight: 400;
}

.cat-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 100px;
}

.cat-count.urgent {
  background: var(--red-bg);
  border-color: rgba(180,35,24,0.2);
  color: var(--red);
}

.cat-arrow {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.gap-category[open] .cat-arrow {
  transform: rotate(45deg);
  color: var(--accent);
}

.gap-category > .items {
  padding: 14px 18px 18px;
  background: var(--bg-warm);
}

.gap-category .item {
  background: var(--bg-card);
}

/* ── NAV BADGE (sidebar) ── */
.nav-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--red-bg);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 100px;
  margin-left: 8px;
  border: 1px solid rgba(180,35,24,0.15);
}

.nav-list a:hover .nav-badge {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ── GAP LIST (TOP SECTION) ── */
.gap-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gap-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.2s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}

.gap-row:hover {
  border-color: var(--red);
  transform: translateX(2px);
}

.gap-row .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  min-width: 22px;
}

.gap-row .body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gap-row .body .title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.gap-row .body .where {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gap-row .urgency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--red-bg);
  color: var(--red);
}

.gap-row .urgency.med { background: var(--amber-bg); color: var(--amber); }
.gap-row .urgency.low { background: var(--bg-warm); color: var(--text-muted); }

/* ── FOOTER ── */
.footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── MOBILE ── */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 60px 24px 60px; }
  .menu-toggle { display: block; }
  .hero h2 { font-size: 2rem; }
  .section h2 { font-size: 1.7rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .gap-row { grid-template-columns: auto 1fr; }
  .gap-row .urgency { grid-column: 2; justify-self: start; }
}
