.defense-page {
  color: #262b2a;
  background: #fbf8f0;
}
.defense-wrap {
  width: min(100% - 2.5rem, 43rem);
  margin-inline: auto;
}
.defense-cover {
  padding-block: clamp(4rem, 12vw, 9rem);
  background: #203631;
  color: #fff7e8;
}
.defense-cover h1 {
  margin: 0 0 1.35rem;
  font: 500 clamp(1.55rem, 8vw, 4.5rem)/1.04 var(--serif);
  letter-spacing: -.045em;
}
.defense-cover h1 em { color: #efd4a5; }
.defense-cover p { max-width: 35rem; font-size: clamp(1.05rem, 2.4vw, 1.35rem); }
.defense-cover .defense-byline { margin-top: 2rem; font-size: .94rem; }
.defense-story { padding-block: clamp(2.5rem, 7vw, 5rem); }
.defense-story p { font: 400 clamp(1.2rem, 2.5vw, 1.4rem)/1.57 var(--serif); margin: 0 0 1.15em; }
.defense-story .defense-opening { font-weight: 600; }
.defense-story section { margin-top: clamp(2.75rem, 7vw, 5rem); }
.defense-story h2 {
  font: 500 clamp(1.25rem, 4.9vw, 2.55rem)/1.13 var(--serif);
  letter-spacing: -.028em;
  margin: 0 0 .6em;
}
.defense-end { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid #b7bfb3; }

.defense-figure {
  margin: 2rem 0;
  padding: clamp(1rem, 4vw, 1.7rem);
  background: #eaece0;
  border: 1px solid #c6cec2;
}
.defense-figure figcaption { margin-top: 1rem; font-size: .88rem; line-height: 1.5; }

.meeting-notes, .research-notebook {
  margin: 2.2rem 0;
  padding: clamp(1rem, 4vw, 1.7rem);
  border: 1px solid #c5cabc;
  color: #253c34;
}
.meeting-notes {
  border-inline-start: 4px solid #597568;
  background: #e9ede4;
}
.meeting-notes figcaption, .research-notebook figcaption {
  font-size: .9rem;
  color: #45584f;
}
.meeting-notes dl { margin: 1rem 0 0; }
.meeting-notes dt { margin-top: .85rem; font-weight: 700; }
.meeting-notes dd { margin: .12rem 0 0; font: 400 1.32rem/1.4 var(--serif); }

.research-notebook {
  background: repeating-linear-gradient(#f5f0df 0 27px, #e7e0cb 27px 28px);
}
.research-notebook h2 { font-size: clamp(1.2rem, 4.6vw, 2.2rem); }
.research-merge, .research-arrows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.research-merge > div, .research-merge-result {
  padding: .8rem;
  border: 1px solid #758779;
  border-radius: .35rem .7rem .45rem .25rem;
  background: #fbf8ec;
}
.research-merge span, .research-merge-result span { display: block; font-size: .85rem; color: #52665b; }
.defense-story .research-merge p, .defense-story .equation-notes p { margin: .35rem 0 0; font-size: 1.12rem; line-height: 1.35; }
.research-arrows { text-align: center; font-size: 1.55rem; line-height: 1.45; color: #597568; }
.research-merge-result { max-width: 28rem; margin: 0 auto 1rem; text-align: center; background: #e7ebdf; }
.equation-notes ol { padding-inline-start: 1.4rem; }
.equation-notes li + li { margin-top: 1rem; }
.notebook-equation { margin: .25rem 0; padding: .3rem .6rem; background: #fffaf0; font: italic 1.25rem/1.35 var(--serif); overflow-wrap: anywhere; }
.notebook-equation small { display: block; font: normal .82rem/1.4 var(--sans); }

.defense-page { background: #fffbf3; }
.defense-cover {
  background:
    radial-gradient(ellipse at 95% 8%, #45687a 0%, transparent 56%),
    linear-gradient(125deg, #21372e, #294d4b);
  border-bottom: .45rem solid #e9ab6e;
}
.defense-cover h1 em { color: #ffd696; }
.defense-cover .defense-degree {
  margin: 0 0 1rem;
  color: #ffe3b7;
  font-weight: 700;
}
.defense-story h2 { color: #285850; }
.defense-story a { color: #24636b; text-decoration-color: #d28f61; }
.meeting-notes { background: #e7f1ed; border-inline-start-color: #3e8374; }
.meeting-notes dt:nth-of-type(2) { color: #215d79; }
.meeting-notes dt:nth-of-type(odd) { color: #994331; }
.research-notebook {
  background: repeating-linear-gradient(#fff5dc 0 27px, #eedfbc 27px 28px);
  border-color: #dfc79b;
}
.research-merge > div:first-child { background: #fae4cf; border-color: #c68b6d; }
.research-merge > div:nth-child(2) { background: #e0eef0; border-color: #79a0aa; }
.research-merge-result { background: #e0ecdb; border-color: #7c9a80; }
.equation-notes ol { display: grid; gap: .85rem; list-style-position: inside; padding: 0; }
.equation-notes li {
  margin: 0;
  padding: .9rem;
  background: #fffdf7;
  border: 1px solid #e2c8a0;
  border-inline-start: .3rem solid #c47553;
  border-radius: .4rem;
}
.equation-notes li + li { margin-top: 0; }
.equation-notes li:nth-child(2) { border-inline-start-color: #467e91; }
.equation-notes li:nth-child(3) { border-inline-start-color: #59896f; }
.notebook-equation {
  overflow-x: auto;
  padding: .6rem .25rem;
  margin-block: .65rem;
  background: #faf1dd;
  color: #263a42;
  font: normal clamp(1rem, 3.4vw, 1.42rem)/1.3 serif;
}
.notebook-equation math { margin: auto; }
.defense-figure { background: #e7f0ed; border-color: #b6d2c7; }
.defense-figure h3 { margin: 0; color: #254d50; font: 600 clamp(1.15rem, 4.5vw, 2rem)/1.12 var(--serif); }
.confidence-curve { display: block; width: 100%; height: auto; margin-block: .75rem; }
.confidence-curve text { fill: #24444c; font: 600 14px var(--sans); }
.confidence-grid { stroke: #adcac5; fill: none; stroke-dasharray: 4 5; }
.confidence-axis { stroke: #486a6b; fill: none; stroke-width: 1.5; }
.confidence-line { stroke: #ad4c36; stroke-width: 4; stroke-linecap: round; fill: none; }
.confidence-fill { fill: #f4d6bb; fill-opacity: .65; }
.confidence-points { fill: #fff5da; stroke: #ad4c36; stroke-width: 2; }

.journey-sketch, .voice-sketch {
  margin: 2.2rem 0;
  padding: clamp(1rem, 4vw, 1.6rem);
  border: 1px solid #ddc7a8;
  border-radius: .65rem;
  background: #fff1d8;
}
.journey-places {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.journey-places li {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: .5rem;
}
.journey-line {
  position: relative;
  margin-block: .34rem;
  border-top: 2px dashed #ab6754;
}
.journey-line::before {
  content: "";
  position: absolute;
  top: -.39rem;
  left: .06rem;
  width: .65rem;
  height: .65rem;
  border: 2px solid #fff1d8;
  border-radius: 50%;
  background: #a34e39;
}
.journey-places strong, .journey-places span { display: block; line-height: 1.3; }
.journey-places strong { color: #633b2e; }
.journey-places span { margin-top: .25rem; font-size: .88rem; }
.journey-places .journey-award { color: #783d2c; font-size: .8rem; }
.journey-places .journey-note { margin-top: 0; color: #45584f; font-style: italic; }
.journey-sketch figcaption, .voice-sketch figcaption { margin-top: 1rem; font-size: .88rem; color: #45584f; }
.voice-sketch { background: #e7f1ed; border-color: #b9d1c7; }
.voice-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .4rem .75rem;
  width: min(100%, 22rem);
  padding: .7rem .85rem;
  background: #fffaf0;
  border: 1px solid #7da99b;
  border-radius: 1rem 1rem 1rem .25rem;
}
.voice-note strong { grid-column: 2; font-size: .85rem; }
.voice-icon { grid-row: span 2; color: #fff; background: #30645b; border-radius: 50%; padding: .45rem .53rem; font-size: .75rem; }
.voice-wave {
  height: 2.2rem;
  background: repeating-linear-gradient(90deg, #427c70 0 3px, transparent 3px 7px);
  clip-path: polygon(0 45%, 5% 33%, 11% 44%, 17% 18%, 24% 34%, 30% 11%, 38% 36%, 45% 24%, 51% 42%, 56% 5%, 63% 29%, 69% 16%, 75% 40%, 82% 24%, 87% 41%, 93% 28%, 100% 45%, 100% 55%, 93% 72%, 87% 59%, 82% 76%, 75% 60%, 69% 84%, 63% 71%, 56% 95%, 51% 58%, 45% 76%, 38% 64%, 30% 89%, 24% 66%, 17% 82%, 11% 56%, 5% 67%, 0 55%);
}
.voice-arrow { display: block; margin-left: .45rem; color: #92583e; font-size: 1.55rem; }
.voice-question { color: #284d45; font: 600 clamp(1.35rem, 4vw, 2rem)/1.16 var(--serif); max-width: 25rem; }
@media (max-width: 510px) {
  .journey-places { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.25rem; }
}

/* Layered contours behind the banner copy. */
.defense-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.defense-cover .defense-wrap { position: relative; z-index: 1; }
.defense-cover::before, .defense-cover::after {
  content: "";
  position: absolute;
  inset-inline-start: -25%;
  top: 53%;
  width: 150%;
  height: 90%;
  border-radius: 47% 53% 0 0 / 20% 35% 0 0;
  pointer-events: none;
  transform-origin: center;
}
.defense-cover::before {
  background: linear-gradient(100deg, #3b7365, #47778a 56%, #a88063);
  opacity: .32;
  animation: defense-wave 13s ease-in-out infinite alternate;
}
.defense-cover::after {
  top: 71%;
  background: linear-gradient(105deg, #446f60, #527e76 55%, #8a7055);
  opacity: .28;
  animation: defense-wave 17s ease-in-out infinite alternate-reverse;
}
@keyframes defense-wave {
  from { transform: translate3d(-5%, 2%, 0) rotate(-4deg); }
  to { transform: translate3d(5%, -5%, 0) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .defense-cover::before, .defense-cover::after { animation: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .defense-cover .defense-wrap {
    animation: defense-arrive .8s ease-out both;
  }

  .journey-sketch.motion-entered li,
  .voice-sketch.motion-entered .voice-question,
  .research-notebook.motion-entered .research-merge > div,
  .research-notebook.motion-entered .research-merge-result,
  .equation-notes.motion-entered li,
  .meeting-notes.motion-entered dd {
    animation: defense-arrive .55s ease-out both;
  }

  .journey-sketch.motion-entered li:nth-child(2),
  .research-notebook.motion-entered .research-merge > div:nth-child(2),
  .equation-notes.motion-entered li:nth-child(2),
  .meeting-notes.motion-entered dd:nth-of-type(2) { animation-delay: .12s; }

  .journey-sketch.motion-entered li:nth-child(3),
  .voice-sketch.motion-entered .voice-question,
  .equation-notes.motion-entered li:nth-child(3),
  .meeting-notes.motion-entered dd:nth-of-type(3) { animation-delay: .24s; }

  .journey-sketch.motion-entered li:nth-child(4),
  .research-notebook.motion-entered .research-merge-result { animation-delay: .36s; }

  .voice-sketch.motion-entered .voice-wave {
    animation: defense-signal .58s ease-in-out 3;
  }

  .defense-figure.motion-entered .confidence-line {
    stroke-dasharray: 1;
    animation: defense-draw 1.3s ease-in-out both;
  }

  @keyframes defense-arrive {
    from { opacity: .25; transform: translateY(.45rem); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes defense-signal {
    0%, 100% { transform: scaleY(1); }
    45% { transform: scaleY(.42); }
    72% { transform: scaleY(1.15); }
  }

  @keyframes defense-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
  }
}

/* Soft, slow waves beneath the essay's paper-white body. */
.defense-page main article {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: #fffefa;
}

.defense-page main article::before,
.defense-page main article::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-size: 72rem 38rem;
  background-repeat: repeat;
}

.defense-page main article::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 768 384' preserveAspectRatio='none'%3E%3Cpath fill='%23d9ebe5' fill-opacity='.48' d='M0 112 C128 112 256 14 384 14 S640 112 768 112 V240 C640 240 512 154 384 154 S128 240 0 240Z'/%3E%3C/svg%3E");
}

.defense-page main article::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 768 384' preserveAspectRatio='none'%3E%3Cpath fill='%23f3dfc5' fill-opacity='.46' d='M0 73 C128 73 256 158 384 158 S640 73 768 73 V153 C640 153 512 238 384 238 S128 153 0 153Z'/%3E%3C/svg%3E");
  background-position: 10rem 14rem;
}

.defense-story {
  width: min(100% - clamp(2rem, 7vw, 6rem), 64rem);
  padding-inline: clamp(.25rem, 1vw, .75rem);
}

@media (min-width: 768px) {
  .defense-story > p, .defense-story > section > p {
    text-align: justify;
    hyphens: auto;
  }
}

.defense-figure {
  max-width: 44rem;
  margin-inline: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .defense-page main article::before {
    animation: defense-paper-wave 32s ease-in-out infinite alternate;
  }
  .defense-page main article::after {
    animation: defense-paper-wave 40s ease-in-out infinite alternate-reverse;
  }
}

@keyframes defense-paper-wave {
  from { background-position: -8rem 3rem; }
  to { background-position: 12rem 12rem; }
}

/* Two sparse fields of tiny stars drift over the waves. */
.defense-body { position: relative; }
.defense-body .defense-story { position: relative; }
.defense-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.defense-stars::before,
.defense-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.defense-stars::before {
  --star: #5f9c86;
  opacity: .46;
  background:
    radial-gradient(circle at 13% 14%, var(--star) 1.5px, transparent 2.4px),
    radial-gradient(circle at 68% 23%, var(--star) 1px, transparent 1.9px),
    radial-gradient(circle at 34% 62%, var(--star) 2px, transparent 2.8px),
    radial-gradient(circle at 91% 79%, var(--star) 1.5px, transparent 2.4px);
  background-size: 21rem 16rem;
}

.defense-stars::after {
  --star: #ce8250;
  opacity: .48;
  background:
    radial-gradient(circle at 19% 33%, var(--star) 1px, transparent 1.9px),
    radial-gradient(circle at 49% 8%, var(--star) 1.5px, transparent 2.4px),
    radial-gradient(circle at 78% 56%, var(--star) 2px, transparent 2.8px),
    radial-gradient(circle at 36% 91%, var(--star) 1.5px, transparent 2.4px);
  background-size: 25rem 19rem;
}

@media (prefers-reduced-motion: no-preference) {
  .defense-stars::before {
    animation: defense-starfall 38s linear infinite;
    --fall-distance: 16rem;
  }

  .defense-stars::after {
    animation: defense-starfall 49s linear infinite;
    --fall-distance: 19rem;
  }
}

@keyframes defense-starfall {
  from { background-position-y: 0; }
  to { background-position-y: var(--fall-distance); }
}
