/* Your Brain on Slots and the Pull of the Next Spin — editorial article */

.essay-page {
  --paper: #fcfaf5;
  --ink: #26241f;
  --ink-soft: #4d4840;
  --rule: #e3ddd1;
  --panel: #f4efe4;
  --accent: #a0473a;
  --accent-soft: #f6e9e4;
  --measure: 720px;
  --gutter: 20px;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-head: "Newsreader", Georgia, "Times New Roman", serif;
}

.essay-page *,
.essay-page *::before,
.essay-page *::after { box-sizing: border-box; }


.essay-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.essay-page img { max-width: 100%; }

.essay-page { padding: 56px var(--gutter) 120px; }

.essay {
  max-width: var(--measure);
  margin: 0 auto;
}

/* Headings */

.essay__header {
  margin-bottom: 56px;
  text-align: center;
}

.essay__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.essay__cherry {
  display: block;
  width: 48px;
  height: 48px;
  margin: 24px auto 0;
}

.essay__section + .essay__section { margin-top: 72px; }

.essay h2 {
  margin: 0 0 20px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.95rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.essay p { margin: 0 0 1.25em; }
.essay p:last-child { margin-bottom: 0; }

.essay__section--last { padding-bottom: 40px; }

/* Figures */

.figure { margin: 40px 0; }

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
}

.figure--small { max-width: 420px; }

/* Brain diagram: labels sit beside the numbered markers on wider screens,
   and become a numbered key beneath the drawing on narrow screens.
   Label positions follow the marker coordinates in brain-medial.svg (900 x 520). */

.brain__drawing { position: relative; }

.brain__label {
  position: absolute;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.brain__label--1 { left: 87.2%; top: 44.2%; transform: translateY(-50%); max-width: 12.8%; }
.brain__label--2 { left: 87.2%; top: 23.1%; transform: translateY(-50%); max-width: 12.8%; }
.brain__label--3 { left: 1%; bottom: 84.6%; color: var(--accent); }

.brain__key {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.brain__key li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brain__key li:last-child { color: var(--accent); }

.brain__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
}

@media (max-width: 639px) {
  .brain__label { display: none; }
}

@media (min-width: 640px) {
  .brain__key { display: none; }
}

/* Imaging comparison */

.imaging {
  display: grid;
  gap: 16px;
}

.imaging__item {
  padding: 18px 20px 22px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.imaging__item img {
  max-width: 220px;
  margin: 0 auto 12px;
}

.essay .imaging__title {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
}

.essay .imaging__text {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

@media (min-width: 600px) {
  .imaging { grid-template-columns: 1fr 1fr; }
}

/* Pull quote */

.pullquote {
  margin: 36px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
}

.essay .pullquote p {
  margin: 0;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3em;
  line-height: 1.45;
}

/* Three-stage illustration */

.stages__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.stages__item img { border-radius: 4px; }

.stages__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.stages__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
  font-size: 0.75rem;
}

.stages__item--focus .stages__label { color: var(--accent); }
.stages__item--focus .stages__step { border-color: var(--accent); background: var(--accent); color: #fff; }

@media (min-width: 620px) {
  .stages__list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 619px) {
  .stages__item { max-width: 340px; margin: 0 auto; width: 100%; }
}

/* Outcome / response / decision inset */

.inset {
  margin: 36px 0;
  padding: 22px 24px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

.inset dl {
  margin: 0;
  display: grid;
  gap: 16px;
}

.inset__term dt {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

.inset__term dd {
  margin: 2px 0 0;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (min-width: 560px) {
  .inset dl { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* Reference table */

.ref { margin: 36px 0; }

.ref__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.ref__table th,
.ref__table td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.ref__table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
}

.ref__table tbody th {
  font-weight: 600;
  width: 44%;
}

.essay .ref__note {
  margin: 12px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
}

/* Desktop type scale */

@media (min-width: 768px) {
  .essay-page { font-size: 18px; }
  .essay-page { padding-top: 88px; }
  .essay__header { margin-bottom: 64px; }
  .essay__section + .essay__section { margin-top: 88px; }
  .figure { margin: 48px 0; }
}
