@import url('/materials/notebook-theme.css');

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  line-height: 1.55;
}

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

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
}

.brand {
  flex: 0 0 auto;
  font-weight: 800;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.rail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 12px;
  padding: 16px;
}

.rail h1 {
  font-size: 1.6rem;
}

.rail-content p {
  font-size: 0.92rem;
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.tab-list a {
  text-align: left;
  line-height: 1.2;
}

.content-stage {
  min-width: 0;
}

.study-grid {
  display: grid;
  gap: 16px;
}

.study-card {
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.42);
  padding: 18px;
}

.study-card h2 {
  margin: 4px 0 10px;
}

.study-card h3 {
  margin: 16px 0 8px;
}

.source-line {
  display: inline-block;
  color: #a1a1aa;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #a1a1aa;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  text-transform: uppercase;
}

.note-box {
  border: 1px solid rgba(225, 29, 72, 0.28);
  border-radius: 8px;
  background: rgba(225, 29, 72, 0.08);
  color: #f4f4f5;
  margin-top: 14px;
  padding: 12px 14px;
}

.visual-stage {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.visual-canvas {
  min-height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(127, 29, 29, 0.14), transparent 34%),
    radial-gradient(circle at 82% 74%, rgba(225, 29, 72, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    #0a0a0a;
  overflow: hidden;
}

.visual-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

.visual-canvas .svg-label {
  fill: #fafafa;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(10, 10, 10, 0.82);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.visual-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visual-controls button {
  min-height: 38px;
}

.step-text {
  border-left: 3px solid #e11d48;
  color: #d4d4d8;
  padding-left: 12px;
}

.compare-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 14px;
}

.compare-table th,
.compare-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  background: rgba(225, 29, 72, 0.12);
  color: #ffffff;
}

.code-line {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .rail {
    position: relative;
    top: auto;
    max-height: none;
  }

  .study-card {
    padding: 15px;
  }
}
