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

:root {
  --bg: #ffffff;
  --surface: #f2f0eb;
  --border: #e0ddd8;
  --muted: #666;
  --text: #000;
  --red: #c0392b;
  --nav-width: 220px;
}

html { scroll-behavior: smooth; }
body { font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; }


/* landing */

#landing {
  background: #000;
  width: 100%;
  position: relative;
  z-index: 10;
  margin-bottom: -100vh;
}

#landing-caption {
  padding: 48px 40px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #444;
  text-align: right;
}

#columns {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.col {
  flex: 1;
  border-right: 1px solid #222;
  padding: 28px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.col:last-child { border-right: none; }

.col-count {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 20px;
}

.word-item {
  font-weight: 900;
  font-size: clamp(7px, 0.95vw, 14px);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  text-align: center;
  display: block;
  width: 100%;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}


/* counter */

#counter {
  position: fixed;
  bottom: 36px;
  right: 40px;
  z-index: 200;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#counter.visible { opacity: 1; }

#counter-num {
  display: block;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}

#counter-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
  margin-top: 4px;
}


/* thesis */

#thesis {
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  padding-top: 100vh;
}


/* nav */

nav {
  position: sticky;
  top: 0;
  width: var(--nav-width);
  height: 100vh;
  flex-shrink: 0;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  align-self: flex-start;
}

.nav-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.9;
}

nav a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 0;
  transition: color 0.15s;
}

nav a .n {
  font-size: 7px;
  color: var(--border);
  min-width: 14px;
  flex-shrink: 0;
  transition: color 0.15s;
}

nav a:hover { color: var(--text); }
nav a:hover .n { color: var(--muted); }
nav a.active { color: var(--text); }
nav a.active .n { color: var(--red); }

nav hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.nav-footer {
  margin-top: auto;
  font-size: 7px;
  color: var(--border);
  letter-spacing: 0.12em;
  line-height: 2.2;
  text-transform: uppercase;
}


/* main */

main {
  flex: 1;
  max-width: 740px;
  padding: 0 56px 140px 56px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

header {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 80px;
}

.h-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

header h1 {
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
  margin-right: -40%;
}

.h-meta {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.8;
}

.h-meta span { color: var(--red); margin: 0 6px; }


/* sections */

section {
  margin-bottom: 88px;
  scroll-margin-top: 36px;
}

section h2 {
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  line-height: 1.2;
}

.sn {
  font-size: clamp(10px, 1.2vw, 14px);
  color: var(--red);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

section p {
  margin-bottom: 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
  text-align: justify;
  text-indent: 2em;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 8 4 3;
  word-spacing: -0.02em;
  text-wrap: pretty;
}

section p:first-of-type { text-indent: 0; }
section p:last-child { margin-bottom: 0; }

.pull-quote {
  margin: 44px 0;
  padding: 22px 0 22px 22px;
  border-left: 3px solid var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 560px;
}


/* images */

figure { margin: 52px 0; }
figure img { width: 100%; display: block; }
figure.half { max-width: 380px; }

figcaption {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  line-height: 1.4;
  max-width: 560px;
}

figcaption strong { font-weight: 700; color: var(--text); }
figcaption em { font-style: italic; }

.img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 44px 0;
  align-items: start;
}

.img-pair img { width: 100%; height: auto; display: block; }
.img-pair figcaption { grid-column: 1 / -1; }

.fig1-pair { grid-template-columns: 69fr 31fr; }
.fig3-pair { grid-template-columns: 60fr 40fr; }
.fig4-pair { grid-template-columns: 33fr 67fr; }
.fig6-pair { grid-template-columns: 73fr 27fr; }

.img-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  margin: 44px 0;
  align-items: start;
}

.img-trio img { width: 100%; height: auto; display: block; }
.img-trio figcaption { grid-column: 1 / -1; }

hr { border: none; border-top: 1px solid var(--border); margin: 64px 0; }


/* works cited */

.works-cited {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 36px;
}

.works-cited h3,
.acknowledgements h3 {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.works-cited p {
  font-size: 13px;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 12px;
  line-height: 1.65;
}

.works-cited p em { color: var(--text); }

.acknowledgements {
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.acknowledgements p {
  font-size: 13px;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 14px;
  line-height: 1.65;
}


/* colophon */

.colophon {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2.4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.colophon strong { color: var(--text); display: block; margin-bottom: 2px; }

.originality {
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.originality h3 {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.originality p {
  font-size: 13px;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 14px;
  line-height: 1.65;
}

.signed-label {
  margin-top: 28px;
  font-weight: 700;
  color: var(--text);
}

.signature {
  display: block;
  max-width: 200px;
  margin-top: 8px;
}


/* fade */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible { opacity: 1; transform: none; }


/* footnotes */

#margin-note {
  position: fixed;
  width: 320px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 200;
}

#margin-note.visible { opacity: 1; }

#margin-note p {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
  max-width: 100%;
  margin: 0;
}

#margin-note .note-num {
  font-size: 8px;
  font-weight: 700;
  color: var(--red);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
}

sup {
  font-size: 8px;
  color: var(--red);
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  font-weight: 700;
  cursor: default;
}


/* mobile */

@media (max-width: 800px) {
  html, body { overflow-x: hidden; }
  nav { display: none; }

  main {
    padding: 0 28px 80px;
    overflow-x: hidden;
  }

  header { padding: 40px 0 36px; }
  header h1 { font-size: clamp(22px, 6.5vw, 36px); margin-right: 0; }

  section p, section p:last-child { max-width: 100%; }
  .pull-quote { font-size: 17px; max-width: 100%; }

  .img-pair, .fig1-pair, .fig3-pair,
  .fig4-pair, .fig6-pair { grid-template-columns: 1fr; max-width: 100%; }
  .img-pair img { height: auto; max-width: 100%; }
  .img-trio { grid-template-columns: 1fr; max-width: 100%; }
  .img-trio img { height: auto; max-width: 100%; }
  .colophon { grid-template-columns: 1fr; }

  figure { max-width: 100%; overflow: hidden; }
  figure img { max-width: 100%; }

  #landing {
    margin-bottom: 0;
    display: block;
    max-width: 100vw;
  }

  #thesis {
    display: block;
    padding-top: 0;
    overflow-x: hidden;
    max-width: 100vw;
  }

  #columns {
    display: flex;
    flex-direction: column;
    padding: 28px 10px;
  }

  .col {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: none;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .col:last-child { border-right: none; }

  .col-count {
    font-size: clamp(8px, 2.5vw, 14px);
    color: #555;
    margin-bottom: 0;
    order: 2;
    font-weight: 700;
  }

  .word-item {
    display: none;
  }

  .col > .word-item:nth-child(2) {
    display: block;
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    font-size: clamp(34px, 11.5vw, 56px);
    font-weight: 900;
    color: #fff;
    line-height: 0.95;
    padding: 0;
    white-space: nowrap;
    text-align: left;
    text-transform: uppercase;
    width: auto;
  }

  #counter { display: none; }

  #landing-caption {
    padding: 12px 10px 16px;
    font-size: 7px;
    text-align: left;
  }

  #margin-note {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    background: #000;
    border: none;
    padding: 24px 28px 32px;
    border-radius: 0;
    z-index: 300;
    pointer-events: auto;
  }

  #margin-note p { color: #fff; font-size: 12px; line-height: 1.5; }
  #margin-note .note-num { color: var(--red); }
  sup { cursor: pointer; }

  .works-cited p, .acknowledgements p { max-width: 100%; }
  figcaption { max-width: 100%; }
}
