/* =============================================
   Tooling One-Pager — Swiss Editorial (Reference-inspired)
   ============================================= */

:root {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-2: #fffdf8;
  --bg-3: #efe6d7;
  --bg-4: #e4d8c3;
  --border: rgba(53, 44, 29, 0.10);
  --border-md: rgba(53, 44, 29, 0.18);
  --text: #17130d;
  --text-muted: #4d4437;
  --text-dim: #817768;
  --red: #bc2b21;
  --red-dim: rgba(188, 43, 33, 0.08);
  --red-mid: rgba(188, 43, 33, 0.22);
  --blue: #2563eb;
  --green: #15803d;
  --code: #651580;
  --font-head: 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
  --sidebar-w: 250px;
  --transition: 190ms ease;
  --shadow: 0 18px 44px rgba(82, 60, 28, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.05), transparent 28%),
    radial-gradient(circle at left 20%, rgba(188,43,33,0.06), transparent 26%),
    linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 200;
  transition: width 0.35s ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: rgba(255, 252, 245, 0.9);
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 48px rgba(82, 60, 28, 0.05);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  padding-bottom: 16px;
}

.sidebar-brand {
  padding: 24px 20px 10px;
  border-bottom: 1px solid var(--border);
}

.brand-label {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--red);
  display: block;
}

.brand-sub {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 12px;
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--text-dim);
}

.mini-btn {
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--text-muted);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--font-head);
  font-size: 10px;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: var(--red-mid);
  color: var(--red);
}

.nav-list {
  list-style: none;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.nav-item:hover { background: var(--bg-3); }

.nav-item.active {
  border-left-color: var(--red);
  background: var(--red-dim);
}

.nav-num {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--text-dim);
  width: 18px;
  flex-shrink: 0;
}

.nav-item.active .nav-num { color: var(--red); }

.nav-text {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.nav-item.active .nav-text {
  color: var(--text);
  font-weight: 500;
}

.nav-time {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--text-dim);
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-head);
}

.sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-footer a:hover { color: var(--red); }

.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 150;
  background: rgba(255, 252, 245, 0.95);
  border: 1px solid var(--border-md);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  transition: all var(--transition);
}

/* Main */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.section {
  display: block;
  min-height: 100vh;
  padding: 72px 72px 88px;
  border-bottom: 1px solid var(--border);
}

.section.active {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.5), transparent 40%);
}

.section-inner {
  max-width: 980px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}

.section-tag,
.section-duration,
.card-label,
.checkline,
.btn,
.badge,
code {
  font-family: var(--font-head);
}

.section-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.section-duration {
  font-size: 11px;
  color: var(--text-dim);
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  line-height: 1.2;
  margin-bottom: 10px;
}

.section-lead {
  color: var(--text-muted);
  max-width: 860px;
  margin-bottom: 24px;
}

.card {
  border: 1px solid var(--border-md);
  border-radius: 12px;
  background: rgba(255, 252, 245, 0.8);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.card--accent {
  border-left: 4px solid var(--red);
  background: linear-gradient(135deg, rgba(188, 43, 33, 0.08), rgba(188, 43, 33, 0.02));
}

.card--interactive {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
}

.card--transparent {
  padding: 0 18px;
}

.card-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.check-list,
.bullet-list,
.checkbox-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list li,
.bullet-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
}

.check-list--yes li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 600;
}

.checkbox-list {
  margin: 1.5rem 18px;
}

.bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--red);
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin: 0px 0;
}

.checkline input { margin-top: 1px; }

.step-list {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-muted);
}

.step-list li strong {
  color: var(--text);
}

.click-path li {
  line-height: 1.45;
}

.click-path code {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.code-wrap {
  margin-bottom: 12px;
}

.code-wrap.critical {
  border: 2px solid var(--red-mid);
  border-left: 5px solid var(--red);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(188, 43, 33, 0.08), rgba(188, 43, 33, 0.02));
  padding: 10px;
}

.critical-note {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--red) 88%, black 12%);
  font-weight: 600;
  font-size: 13px;
}

.code-wrap.critical pre {
  margin-bottom: 8px;
  border-color: color-mix(in srgb, var(--red-mid) 70%, var(--border-md));
}

pre {
  border: 1px solid var(--border-md);
  background: #fffdfa;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  margin-bottom: 8px;
}

code {
  font-size: 14px;
  color: #3f3628;
  margin: 0 3px;
  color: var(--code);
}

.btn {
  border: 1px solid var(--border-md);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
}

.btn:hover {
  border-color: var(--red-mid);
  color: var(--red);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.github-shots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shot-card {
  border: 1px solid var(--border-md);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.shot-card::after {
  content: '🔎';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 13px;
  line-height: 1;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 5px;
  pointer-events: none;
}

.shot-card img {
  width: 100%;
  height: auto;
  display: block;
}

.shot-card figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.zoomable,
.shot-card {
  cursor: zoom-in;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 10, 0.88);
  display: grid;
  place-items: center;
  padding: 22px;
}

.image-modal[hidden] {
  display: none !important;
}

.image-modal img {
  max-width: min(1200px, 94vw);
  max-height: 88vh;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.image-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
}

.timeline-strip {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tl-item {
  min-width: 110px;
  text-align: center;
  padding: 6px;
}

.tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  margin: 0 auto 4px;
}

.tl-item--active .tl-dot { background: var(--red); }

.tl-label {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--text);
}

.tl-time {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--text-dim);
}

.tl-line {
  height: 1px;
  background: var(--border-md);
  min-width: 40px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover { color: var(--red); }

@media (max-width: 1200px) {
  .section { padding: 64px 44px 82px; }
}

@media (max-width: 980px) {
  .menu-toggle { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .section { padding: 76px 18px 68px; min-height: auto; }

  .split-grid,
  .shot-grid,
  .lane-grid {
    grid-template-columns: 1fr;
  }
}
