/* yongjoon.xyz — brutalist personal archive, horizontal scroll, 12-column grid */

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

:root {
  --midnight: #0a1628;
  --midnight-alt: #0d1e38;
  --text: #e8eaf0;
  --muted: #6a7a8e;
  --grid: #1a2a40;
  --warm: #c8a878;
  --rule: rgba(255, 255, 255, 0.1);
}

html, body {
  background: var(--midnight);
  color: var(--text);
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  height: 100vh;
  overflow: hidden;
}

.track {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--grid) var(--midnight);
}
.track::-webkit-scrollbar { height: 6px; }
.track::-webkit-scrollbar-track { background: var(--midnight); }
.track::-webkit-scrollbar-thumb { background: var(--grid); }

.panel {
  flex: 0 0 100vw;
  height: 100vh;
  position: relative;
  scroll-snap-align: start;
  padding: 60px 8vw 80px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}
.panel-alt { background: var(--midnight-alt); }

/* 12-column grid lines */
.grid12 {
  position: absolute;
  inset: 60px 8vw 80px;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to right,
      transparent 0,
      transparent calc((100% - 11px) / 12),
      var(--grid) calc((100% - 11px) / 12),
      var(--grid) calc((100% - 11px) / 12 + 1px));
}

/* Title panel */
.panel-title {
  justify-content: center;
}
.title-block { position: relative; z-index: 2; }
.kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 28px;
}
.big-name {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: clamp(80px, 12vw, 200px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 32px;
}
.sub {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--muted);
  margin-bottom: 60px;
}
.meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.18em;
}

/* Chapter headers */
.panel-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 28px;
  margin-bottom: 40px;
}
.ch-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--warm);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.ch-h {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Cells / mixed-media collage */
.cells {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(80px, auto);
  gap: 20px;
  flex: 1;
}

.cell { font-size: 15px; }
.cell-text { grid-column: span 5; }
.cell-text.wide { grid-column: span 7; }
.cell-img { grid-column: span 4; align-self: start; }
.cell-img svg { width: 100%; display: block; border: 1px solid var(--rule); }
.cell-code {
  grid-column: span 3;
  background: var(--grid);
  padding: 16px 18px;
  align-self: start;
}
.cell-code pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.cell-quote { grid-column: span 4; align-self: start; }
.cell-quote blockquote {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.5;
  border-left: 2px solid var(--warm);
  padding-left: 18px;
  margin-bottom: 8px;
}
.cell-quote cite {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-style: normal;
}
.cell-diagram { grid-column: span 5; }
.cell-diagram svg { width: 100%; display: block; }

.lead { font-size: 17px; }
.small { font-size: 14px; color: var(--muted); }

.list {
  list-style: none;
  margin-top: 14px;
}
.list li {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--grid);
  color: var(--text);
}

/* Footnotes */
.footnotes {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--muted);
}
.footnotes sup { color: var(--warm); }

.fn { color: var(--warm); font-size: 0.65em; }

/* Index strip */
.index {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: rgba(10, 22, 40, 0.92);
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 50;
  padding: 0 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.i-item {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.i-item:hover { color: var(--text); }
.i-item.active { color: var(--text); border-bottom-color: var(--text); }

/* Card-flip illusion via opacity + perspective on snap-change */
@keyframes flip-in {
  0% { opacity: 0; transform: perspective(800px) rotateY(-30deg); }
  100% { opacity: 1; transform: perspective(800px) rotateY(0deg); }
}
.panel.entering { animation: flip-in 600ms cubic-bezier(0.4, 0, 0.2, 1); }

/* Responsive: stack vertically below 720 */
@media (max-width: 720px) {
  html, body { height: auto; overflow: auto; }
  .track { flex-direction: column; height: auto; overflow: visible; }
  .panel { flex: none; height: auto; min-height: 100vh; padding-bottom: 100px; }
  .cells { grid-template-columns: repeat(6, 1fr); }
  .cell-text, .cell-text.wide, .cell-img, .cell-code, .cell-quote, .cell-diagram { grid-column: span 6; }
}
