/* ============================================================
   aboutAI — Editorial Science
   Aesthetic: 빈티지 과학 저널 × Distill.pub × Nautilus
   Typography-first, warm cream, terracotta accents, grain texture
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Warm editorial palette */
  --paper:       #f5ecd8;
  --paper-soft:  #ede2c9;
  --paper-shade: #e2d4b5;
  --ink:         #1f160d;
  --ink-soft:    #3a2d20;
  --ink-mute:    #6b5a46;
  --ink-faint:   #9a8a72;

  --terracotta:  #b8441c;
  --terracotta-dim: #8b3315;
  --rust:        #c86b3a;
  --ochre:       #c89b3a;
  --ink-blue:    #1e3a5f;
  --electric:    #2c5ea8;
  --moss:        #4a6b3a;
  --wine:        #701c28;

  --rule:        #c9b890;
  --rule-soft:   #d9c9a5;

  --font-display: 'Fraunces', 'Apple SD Gothic Neo', 'Noto Serif KR', Georgia, serif;
  --font-body:    'IBM Plex Sans KR', 'Pretendard Variable', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'D2Coding', 'Consolas', monospace;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.09  0 0 0 0 0.05  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image: var(--grain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}

/* ================= Layout ================= */
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

aside {
  background: transparent;
  border-right: 1px solid var(--rule);
  padding: 54px 28px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-size: 0.9em;
}
aside::before {
  content: 'aboutAI';
  display: block;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'wght' 700, 'SOFT' 0, 'WONK' 1;
  font-size: 2em;
  color: var(--terracotta);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 6px;
}
aside::after {
  content: none;
}
aside h3 {
  font-family: var(--font-mono);
  font-size: 0.7em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin: 28px 0 14px 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
aside ol { list-style: none; padding: 0; margin: 0; counter-reset: chap; }
aside ol ol { padding-left: 16px; font-size: 0.94em; }
aside li {
  margin: 3px 0;
  counter-increment: chap;
}
aside > h3 + ol > li { position: relative; padding-left: 26px; }
aside > h3 + ol > li::before {
  content: counter(chap, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  font-family: var(--font-mono);
  font-size: 0.75em;
  color: var(--ink-faint);
  font-weight: 500;
}
aside a {
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding: 6px 8px;
  border-radius: 3px;
  transition: all 0.18s ease;
  font-weight: 400;
}
aside a:hover {
  color: var(--terracotta);
  background: var(--paper-shade);
  transform: translateX(2px);
}

/* ================= Main ================= */
main {
  padding: 80px clamp(32px, 6vw, 110px);
  max-width: 1320px;
  width: 100%;
  position: relative;
}

/* ================= Paper header ================= */
header.paper-header {
  text-align: left;
  padding: 20px 0 50px 0;
  margin-bottom: 50px;
  border-bottom: none;
  position: relative;
}
header.paper-header::before {
  content: '※ VOL. 01  ·  2026';
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72em;
  letter-spacing: 0.3em;
  color: var(--terracotta);
  font-weight: 500;
  margin-bottom: 28px;
  text-transform: uppercase;
}
header.paper-header::after {
  content: '';
  display: block;
  width: 80px;
  height: 2px;
  background: var(--ink);
  margin-top: 32px;
}
header.paper-header h1 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'wght' 500, 'SOFT' 30, 'WONK' 0;
  font-size: clamp(2.4em, 5.5vw, 4.2em);
  line-height: 0.98;
  margin: 0 0 24px 0;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--ink);
  max-width: 18ch;
}
header.paper-header h1 em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 100, 'WONK' 1;
  color: var(--terracotta);
}
.authors {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 14, 'wght' 400;
  font-style: italic;
  font-size: 1.05em;
  color: var(--ink-soft);
  margin: 0 0 8px 0;
  max-width: 55ch;
}
.affiliation {
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

/* ================= Abstract ================= */
.abstract {
  background: transparent;
  border: none;
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--rule);
  border-left: none;
  border-radius: 0;
  padding: 36px 0 40px 0;
  margin: 44px 0 60px 0;
  font-size: 1.05em;
  line-height: 1.82;
  columns: 2;
  column-gap: 44px;
  column-rule: 1px solid var(--rule-soft);
}
@media (max-width: 980px) { .abstract { columns: 1; } }
.abstract h2 {
  columns: 1;
  column-span: all;
  margin: 0 0 20px 0;
  font-family: var(--font-mono);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--terracotta);
  border: none;
  font-weight: 500;
  padding: 0;
}
.abstract > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'wght' 600, 'SOFT' 0, 'WONK' 1;
  font-size: 5.4em;
  line-height: 0.85;
  float: left;
  padding: 4px 14px 0 0;
  color: var(--terracotta);
  font-weight: 600;
}
.keywords {
  column-span: all;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.keywords strong {
  color: var(--terracotta);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ================= Headings ================= */
h2 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60, 'wght' 600, 'SOFT' 0, 'WONK' 1;
  font-size: clamp(1.9em, 3.2vw, 2.6em);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 96px 0 26px 0;
  padding: 0;
  border: none;
  color: var(--ink);
  position: relative;
  max-width: 22ch;
}
h2::before {
  content: '§';
  display: inline-block;
  color: var(--terracotta);
  font-variation-settings: 'opsz' 60, 'wght' 400;
  margin-right: 14px;
  font-style: italic;
}

h3 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'wght' 600, 'SOFT' 20;
  font-size: 1.45em;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 50px 0 14px 0;
  color: var(--ink);
  max-width: 28ch;
}
h3::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--terracotta);
  margin-bottom: 14px;
}

h4 {
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--terracotta-dim);
  margin: 32px 0 12px 0;
  font-style: normal;
}

/* ================= Text ================= */
p {
  margin: 14px 0;
  text-align: left;
  hyphens: auto;
  max-width: 68ch;
}
p, li { word-break: keep-all; line-break: strict; }

/* Drop cap on first paragraph of each section (paper mode) */
.paper-version > p:first-of-type::first-letter,
section > .paper-version > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'wght' 600, 'SOFT' 30, 'WONK' 1;
  font-size: 4em;
  line-height: 0.88;
  float: left;
  padding: 6px 12px 0 0;
  color: var(--terracotta);
  font-weight: 600;
}

a {
  color: var(--electric);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: all 0.15s ease;
}
a:hover {
  color: var(--terracotta);
  background: var(--paper-shade);
}

strong { font-weight: 700; color: var(--ink); }
em {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 14, 'wght' 500;
  font-style: italic;
  color: var(--ink-soft);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-shade);
  padding: 2px 7px;
  border-radius: 2px;
  color: var(--wine);
  font-weight: 500;
}
pre {
  background: var(--ink);
  color: var(--paper);
  padding: 22px 26px;
  border-radius: 4px;
  border-left: 4px solid var(--terracotta);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86em;
  line-height: 1.62;
  margin: 26px 0;
  box-shadow: 6px 6px 0 var(--rule);
}
pre code { background: none; padding: 0; color: inherit; font-weight: 400; }

blockquote {
  border: none;
  border-left: 3px solid var(--terracotta);
  padding: 8px 0 8px 24px;
  margin: 26px 0;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'wght' 400;
  font-style: italic;
  font-size: 1.15em;
  color: var(--ink-soft);
  background: transparent;
  max-width: 60ch;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 28px 0;
  font-size: 0.94em;
  font-family: var(--font-body);
}
th, td {
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 12px 14px;
  text-align: left;
}
thead tr { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
th {
  background: transparent;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--terracotta);
}
tbody tr:hover td { background: var(--paper-soft); }
caption {
  caption-side: bottom;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 14, 'wght' 400;
  font-style: italic;
  font-size: 0.9em;
  color: var(--ink-mute);
  padding-top: 12px;
  text-align: left;
}

ul, ol {
  padding-left: 26px;
  max-width: 68ch;
}
li { margin: 7px 0; }
ul li::marker { color: var(--terracotta); }
ol li::marker {
  color: var(--terracotta);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ================= Figures & captions ================= */
.fig-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 14, 'wght' 400;
  font-style: italic;
  text-align: center;
  font-size: 0.94em;
  color: var(--ink-soft);
  margin: 12px auto 30px;
  max-width: 62ch;
  line-height: 1.55;
}
.fig-title::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--terracotta);
  vertical-align: middle;
  margin-right: 10px;
  opacity: 0.6;
}

.svg-figure {
  display: block;
  margin: 32px auto;
  max-width: 100%;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 22px;
  box-shadow: 8px 8px 0 var(--rule-soft);
}

/* ================= Theorem / Definition boxes ================= */
.theorem {
  background: transparent;
  border: none;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-left: none;
  border-radius: 0;
  padding: 18px 0;
  margin: 28px 0;
  font-size: 1em;
  max-width: 68ch;
  position: relative;
  box-shadow: none;
}
.theorem::before {
  content: 'THEOREM';
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7em;
  letter-spacing: 0.3em;
  color: var(--terracotta);
  font-weight: 500;
  margin-bottom: 6px;
}
.theorem strong { color: var(--ink); }

.footnote {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  margin-top: 64px;
  padding-top: 20px;
  max-width: 68ch;
}

.ref-list { font-size: 0.92em; font-family: var(--font-body); }
.ref-list li {
  margin: 12px 0;
  text-indent: -22px;
  padding-left: 22px;
  max-width: 78ch;
}
.ref-list em {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 14, 'wght' 500;
  font-style: italic;
  color: var(--terracotta-dim);
}

section { margin-bottom: 40px; }

/* ================= Timeline ================= */
.timeline {
  position: relative;
  padding: 30px 0;
  margin: 40px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 128px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink);
}
.tl-event {
  display: flex;
  align-items: flex-start;
  margin-bottom: 22px;
  position: relative;
  transition: transform 0.2s ease;
}
.tl-event:hover { transform: translateX(4px); }
.tl-year {
  width: 112px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--terracotta);
  text-align: right;
  padding-right: 14px;
  font-size: 0.92em;
  letter-spacing: 0.02em;
  padding-top: 2px;
}
.tl-dot {
  position: absolute;
  left: 120px;
  top: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  z-index: 1;
  transition: all 0.2s ease;
}
.tl-event:hover .tl-dot {
  background: var(--terracotta);
  border-color: var(--terracotta);
  transform: scale(1.2);
}
.tl-content {
  margin-left: 42px;
  flex: 1;
  font-size: 0.98em;
}
.tl-content strong { color: var(--ink); font-weight: 600; }

/* ================= 3D Cube / Scenes ================= */
.scene-3d {
  perspective: 1400px;
  width: 100%;
  height: 440px;
  margin: 40px 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(184,68,28,0.10), transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(30,58,95,0.10), transparent 60%),
    var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 10px 10px 0 var(--rule-soft);
  position: relative;
}
.scene-3d::before {
  content: 'FIG. 3D';
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: var(--font-mono);
  font-size: 0.65em;
  letter-spacing: 0.3em;
  color: var(--terracotta);
  font-weight: 500;
}
.cube {
  width: 200px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate-cube 24s infinite linear;
}
.cube-face {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid var(--ink);
  background: rgba(245, 236, 216, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  backdrop-filter: blur(2px);
  border-radius: 2px;
  font-weight: 500;
}
.cube-face.front  { transform: translateZ(100px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(100px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(100px); color: var(--terracotta); border-color: var(--terracotta); background: rgba(245,236,216,0.88); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(100px); color: var(--terracotta); border-color: var(--terracotta); background: rgba(245,236,216,0.88); }
.cube-face.top    { transform: rotateX(90deg) translateZ(100px); color: var(--ink-blue); border-color: var(--ink-blue); background: rgba(245,236,216,0.88); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(100px); color: var(--ink-blue); border-color: var(--ink-blue); background: rgba(245,236,216,0.88); }
@keyframes rotate-cube {
  0%   { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}

/* ================= NN stack ================= */
.nn-stack {
  perspective: 1500px;
  width: 100%;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(184,68,28,0.08), transparent 70%),
    var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 32px 0;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--rule-soft);
}
.nn-layers {
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(-30deg);
  animation: sway 9s ease-in-out infinite alternate;
}
@keyframes sway {
  0%   { transform: rotateX(-15deg) rotateY(-35deg); }
  100% { transform: rotateX(-15deg) rotateY(-20deg); }
}
.nn-layer {
  position: absolute;
  width: 160px;
  height: 200px;
  border: 2px solid;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.82em;
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: center;
  box-shadow: 4px 6px 14px rgba(31,22,13,0.15);
  left: -80px;
  top: -100px;
  background: var(--paper);
}
.nn-layer.l1 { transform: translateZ(0px);   border-color: var(--ink-blue);    color: var(--ink-blue); }
.nn-layer.l2 { transform: translateZ(80px);  border-color: var(--moss);        color: var(--moss); }
.nn-layer.l3 { transform: translateZ(160px); border-color: var(--wine);        color: var(--wine); }
.nn-layer.l4 { transform: translateZ(240px); border-color: var(--terracotta);  color: var(--terracotta); }
.nn-layer.l5 { transform: translateZ(320px); border-color: var(--ochre);       color: var(--ochre); }

/* ================= Diffusion strip ================= */
.diffusion-strip {
  display: flex;
  gap: 12px;
  margin: 32px 0;
  align-items: center;
}
.diff-step {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid var(--rule);
  box-shadow: 3px 3px 0 var(--rule-soft);
}
.diff-label {
  text-align: center;
  font-size: 0.75em;
  color: var(--ink-mute);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}
.diff-container { display: flex; flex-direction: column; flex: 1; }

/* ================= Attention heatmap ================= */
.attn-grid {
  display: grid;
  gap: 3px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 3px;
  margin: 26px auto;
  max-width: 460px;
  box-shadow: 6px 6px 0 var(--rule-soft);
}
.attn-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72em;
  color: #fff;
  font-family: var(--font-mono);
  border-radius: 2px;
  transition: transform 0.12s ease;
  font-weight: 500;
}
.attn-cell:hover { transform: scale(1.18); z-index: 2; }

/* ================= Concept card (used on landing) ================= */
.concept-box {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 22px 24px;
  margin: 24px 0;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 5px 5px 0 var(--ink);
}
.concept-box:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--terracotta);
  border-color: var(--terracotta);
}
.concept-box strong { color: var(--terracotta); }

/* ================= Loss landscape ================= */
.landscape {
  height: 340px;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(184,68,28,0.35) 0%, transparent 40%),
    radial-gradient(ellipse at 70% 30%, rgba(30,58,95,0.35) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(200,155,58,0.25) 0%, transparent 30%),
    linear-gradient(135deg, #2a1f15 0%, #1a1208 100%);
  border-radius: 4px;
  position: relative;
  margin: 32px 0;
  overflow: hidden;
  perspective: 800px;
  box-shadow: 8px 8px 0 var(--rule-soft);
}
.landscape::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg,  transparent 0%, transparent 95%, rgba(245,236,216,0.12) 95%, rgba(245,236,216,0.12) 100%),
    linear-gradient(90deg, transparent 0%, transparent 95%, rgba(245,236,216,0.12) 95%, rgba(245,236,216,0.12) 100%);
  background-size: 46px 46px;
  transform: rotateX(60deg) scale(1.5);
  transform-origin: center;
}
.landscape-label {
  position: absolute;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 7px 14px;
  background: rgba(31,22,13,0.75);
  border: 1px solid rgba(245,236,216,0.3);
  border-radius: 2px;
  z-index: 2;
  letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
}

/* ================= Mode toggle ================= */
.mode-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 1000;
  display: inline-flex;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 3px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.mode-toggle button {
  border: none;
  background: transparent;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--ink-mute);
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mode-toggle button:hover { color: var(--ink); }
body.mode-easy  .mode-toggle button[data-mode="easy"],
body.mode-paper .mode-toggle button[data-mode="paper"] {
  background: var(--ink);
  color: var(--paper);
}

body.mode-easy  .paper-version { display: none; }
body.mode-paper .easy-version  { display: none; }

/* ================= Easy-mode box ================= */
.easy-box {
  background: var(--paper-soft);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 26px 30px;
  margin: 26px 0 36px 0;
  font-size: 1.02em;
  line-height: 1.82;
  position: relative;
  box-shadow: 6px 6px 0 var(--terracotta);
  max-width: 72ch;
}
.easy-box::before {
  content: 'EXPLAINED PLAINLY ·  쉬운 설명';
  position: absolute;
  top: -11px;
  left: 20px;
  background: var(--paper);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68em;
  letter-spacing: 0.25em;
  color: var(--terracotta);
  font-weight: 500;
}
.easy-box h4 {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'wght' 600, 'SOFT' 20;
  font-style: normal;
  font-size: 1.25em;
  text-transform: none;
  letter-spacing: -0.01em;
}
.easy-box strong { color: var(--terracotta-dim); }
.easy-box .analogy,
.easy-box .example {
  background: var(--paper);
  border-left: 3px solid var(--terracotta);
  padding: 12px 18px;
  margin: 14px 0;
  font-size: 0.96em;
  border-radius: 0;
}
.easy-box .analogy::before {
  content: '◆ 비유 ·  ';
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  color: var(--terracotta);
  text-transform: uppercase;
}
.easy-box .example {
  border-left-color: var(--electric);
}
.easy-box .example::before {
  content: '▷ 예시 ·  ';
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  color: var(--electric);
  text-transform: uppercase;
}

/* ================= Chapter nav (prev/next) ================= */
main > div[style*="border-top"] {
  font-family: var(--font-mono) !important;
  font-size: 0.82em !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 100px !important;
  padding: 28px 0 !important;
  border-top: 2px solid var(--ink) !important;
  border-bottom: 1px solid var(--rule);
}
main > div[style*="border-top"] a {
  color: var(--ink) !important;
  border: none;
  font-weight: 500;
}
main > div[style*="border-top"] a:hover {
  color: var(--terracotta) !important;
  background: transparent;
}

/* ================= Section-number decorator ================= */
section[id^="sec"] {
  position: relative;
}
section[id^="sec"] > h2 {
  position: relative;
  z-index: 2;
}

/* Smooth fade-in */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
main > *, section > * { animation: rise 0.5s ease both; }
main > *:nth-child(n+5) { animation-delay: 0.08s; }

/* ================= Responsive ================= */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  aside {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 30px 20px;
  }
  main { padding: 40px 22px; }
  .timeline::before { left: 82px; }
  .tl-year { width: 74px; font-size: 0.82em; }
  .tl-dot { left: 76px; }
  .mode-toggle { top: 12px; right: 12px; font-size: 0.7em; }
  header.paper-header h1 { font-size: 2.4em; }
  .abstract { columns: 1; }
}

@media (min-width: 1600px) {
  .layout { grid-template-columns: 340px minmax(0, 1fr); }
  main { padding: 100px clamp(60px, 7vw, 150px); max-width: 1520px; }
}

@media (min-width: 2100px) {
  main { max-width: 1700px; }
}

/* Hidden utility */
.equation-num { float: right; color: var(--ink-mute); font-family: var(--font-mono); font-size: 0.88em; }

/* Fix for MathJax rendering on cream background */
mjx-container { color: var(--ink) !important; }

/* Selection */
::selection { background: var(--terracotta); color: var(--paper); }
