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

body {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #2a2a2a;
  background: #c8c3bd;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 960px;
  margin: 40px auto;
  background: #faf9f6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 60px 70px 80px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 50px;
}

.header h1 {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.5px;
  color: #2a2a2a;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2a2a2a;
  text-decoration: none;
}

/* Intro / meta */
.intro {
  max-width: 520px;
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 60px;
}

/* Links */
a {
  color: #888;
  text-decoration: none;
}

a:hover {
  color: #2a2a2a;
}

.section-body li > a:only-child::after {
  content: " →";
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* Section headings */
h2 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.3px;
  margin-top: 60px;
  margin-bottom: 30px;
}

h2:first-of-type {
  margin-top: 0;
}

h3 {
  font-size: 17px;
  font-weight: 300;
  letter-spacing: -0.3px;
  color: #000;
  margin-top: 30px;
  margin-bottom: 20px;
}

h4 {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: #000;
  margin-top: 24px;
  margin-bottom: 14px;
}

/* Table of contents */
.toc {
  margin-bottom: 40px;
}

.toc ul {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 30px;
}

.toc li {
  font-size: 13px;
  line-height: 1.8;
  break-inside: avoid;
}

.toc a {
  color: #555;
  text-decoration: none;
  transition: color 0.15s;
}

.toc a:hover {
  color: #2a2a2a;
}

/* Code */
pre {
  background: #f5f5f3;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 16px 20px;
  margin: 12px 0;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
}

code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
}

p code, li code {
  background: #f5f5f3;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}

/* Content blocks */
.section {
  border-top: 1px solid #ddd;
  padding: 30px 0;
}

.section-head {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #2a2a2a;
  margin-bottom: 10px;
}

.section-body {
  font-size: 13px;
  color: #555;
  line-height: 1.75;
}

.section-body p {
  margin-bottom: 12px;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.section-body ul, .section-body ol {
  margin: 8px 0;
  padding-left: 18px;
}

.section-body li {
  margin-bottom: 5px;
}

.section-body li ul {
  margin-top: 4px;
  margin-bottom: 4px;
}

.section-body strong {
  color: #2a2a2a;
}

/* Tables */
.section-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 13px;
}

.section-body th, .section-body td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
}

.section-body th {
  font-weight: 600;
  color: #2a2a2a;
  border-bottom: 2px solid #ccc;
}

.section-body td {
  color: #555;
}

/* Sub-sections within a section */
.sub {
  margin-top: 22px;
}

.sub:first-child {
  margin-top: 0;
}

.sub-label {
  font-size: 13px;
  font-weight: 600;
  color: #2a2a2a;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.sub-note {
  font-size: 12px;
  font-style: italic;
  color: #888;
  margin-bottom: 6px;
}

/* Workflow diagram */
.workflow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 12px 0 16px;
}

.workflow-step {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #444;
  min-width: 200px;
  text-align: center;
}

.workflow-arrow {
  color: #bbb;
  font-size: 16px;
  padding-left: 88px;
}

/* Checkmark */
.check { color: #5a9a5a; }

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #999;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}

.back-link:hover { color: #2a2a2a; }

/* Two-column layout variant */
.section-two-col {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 40px;
  border-top: 1px solid #ddd;
  padding: 30px 0;
}

.section-two-col .section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2a2a2a;
  padding-top: 2px;
}

.section-two-col .section-body {
  font-size: 13px;
  color: #555;
  line-height: 1.75;
}

.section-two-col .section-body p {
  margin-bottom: 12px;
}

.section-two-col .section-body p:last-child {
  margin-bottom: 0;
}

.section-two-col .section-body ul,
.section-two-col .section-body ol {
  margin: 8px 0;
  padding-left: 18px;
}

.section-two-col .section-body li {
  margin-bottom: 5px;
}

.section-two-col .section-body strong {
  color: #2a2a2a;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.card-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.card {
  padding: 32px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

/* Vertical dividers: 2-col */
.card-grid.cols-2 > .card:nth-child(odd) {
  border-right: 1px solid #ddd;
  padding-right: 30px;
}

.card-grid.cols-2 > .card:nth-child(even) {
  padding-left: 30px;
}

/* Vertical dividers: 3-col */
.card-grid:not(.cols-2) > .card:not(:nth-child(3n)) {
  border-right: 1px solid #ddd;
  padding-right: 30px;
}

.card-grid:not(.cols-2) > .card:nth-child(3n+2),
.card-grid:not(.cols-2) > .card:nth-child(3n) {
  padding-left: 30px;
}

/* Horizontal dividers between rows in 2-col grids */
.card-grid.cols-2 > .card:nth-child(n+3) {
  border-top: 1px solid #ddd;
}

/* Horizontal dividers between rows in 3-col grids */
.card-grid:not(.cols-2) > .card:nth-child(n+4) {
  border-top: 1px solid #ddd;
}

/* Last card spanning remaining columns in partial row */
.card-span-2 {
  grid-column: span 2;
  border-right: none !important;
}

.card-span-3 {
  grid-column: span 3;
  border-right: none !important;
}

.card:hover { background: #fafaf8; }

.card h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #2a2a2a;
  margin-bottom: 12px;
}

.card p {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}

.card .arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: #999;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}

.card:hover .arrow { color: #2a2a2a; }

.card .card-date {
  font-size: 12px;
  color: #999;
  margin-top: -8px;
  margin-bottom: 10px;
}

/* ── Timeline page layout ── */
.page-timeline {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.page-timeline .header {
  padding: 40px 70px 0;
  flex-shrink: 0;
  margin-bottom: 0;
}

.page-timeline .intro {
  max-width: none;
  padding: 0 70px 30px;
  margin-bottom: 0;
  flex-shrink: 0;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
}

/* Timeline toolbar */
.timeline-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 70px;
  background: #f9f8f6;
  flex-shrink: 0;
}

.timeline-toolbar button {
  font-size: 12px;
  color: #999;
  background: none;
  border: 1px solid #ddd;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: 0.3px;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.timeline-toolbar button:hover {
  color: #2a2a2a;
  border-color: #999;
}

.zoom-btn {
  font-size: 14px !important;
  padding: 4px 10px !important;
  margin-right: 4px;
}

.details-toggle {
  margin-left: 8px;
}

.hide-details .event-desc { display: none; }

/* Timeline container */
.timeline-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f9f8f6;
}

.timeline-track {
  display: flex;
  align-items: stretch;
  position: relative;
  height: 100%;
  min-width: max-content;
  padding: 40px 0;
}

/* Horizontal axis line */
.timeline-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 2px;
  background: #2a2a2a;
  transform: translateY(-1px);
  pointer-events: none;
  z-index: 0;
}

/* Axis year labels */
.axis-year {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #2a2a2a;
  z-index: 2;
  background: #f9f8f6;
  padding: 0 6px;
}

.axis-year-start { left: 14px; }
.axis-year-end { right: 14px; }

/* Column per time point */
.tl-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 220px;
  position: relative;
  z-index: 1;
}

.tl-above {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
}

.tl-below {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
}

/* Vertical stem connecting events to axis */
.tl-stem {
  width: 2px;
  height: 60px;
  background: #2a2a2a;
  flex-shrink: 0;
}

/* Event card */
.event {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.event-date {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #2a2a2a;
  margin-bottom: 8px;
}

.event-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #2a2a2a;
  margin-bottom: 8px;
  line-height: 1.4;
}

.event-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.7;
  max-width: 200px;
}

/* Timeline footer */
.timeline-footer {
  background: #faf9f6;
  padding: 0 70px 40px;
  flex-shrink: 0;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
  position: relative;
  z-index: 10;
}

.timeline-footer-rule {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0 -70px 24px;
}

.timeline-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.scroll-hint {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 700px) {
  .page { margin: 0; padding: 32px 28px 48px; box-shadow: none; }
  .header { flex-direction: column; gap: 8px; margin-bottom: 32px; }
  .section-two-col { grid-template-columns: 1fr; gap: 12px 0; }
  .card-grid, .card-grid.cols-2 { grid-template-columns: 1fr; }
  .card-span-2, .card-span-3 { grid-column: span 1; }
  .card { border-right: none !important; border-top: none !important; padding-left: 0 !important; padding-right: 0 !important; }
  .card:not(:last-child) { border-bottom: 1px solid #ddd; }
  .page-timeline .header,
  .page-timeline .intro,
  .timeline-toolbar,
  .timeline-footer { padding-left: 28px; padding-right: 28px; }
  .timeline-footer-rule { margin-left: -28px; margin-right: -28px; }
  .tl-col { width: 180px; }
}

/* Print */
@media print {
  body { background: none; }
  .page {
    margin: 0;
    padding: 40px 50px;
    box-shadow: none;
    max-width: none;
    background: #fff;
  }
  h2 { break-after: avoid; page-break-after: avoid; }
  h2 + .section, h2 + .section-two-col { break-before: avoid; page-break-before: avoid; }
  .section, .section-two-col { break-inside: avoid; }
  .card-grid { break-inside: avoid; }
  .back-link { display: none; }
}
