/* ============================================================
   EDDINGTON — O Arquivo da Massa
   Estudo 04/V · Ezon Partners × Fable 5
   Sistema editorial de impressão: papel osso, tinta espresso,
   oxblood como única cor de ênfase, filetes em ouro batido.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bone:       #F1EAE0;  /* papel                       */
  --plate:      #E7DECF;  /* fundo de pranchas / faixas  */
  --ink:        #221D18;  /* tinta espresso              */
  --ink-soft:   #4A423A;  /* texto secundário            */
  --ink-muted:  #5C5348;  /* legendas, fólios            */
  --oxblood:    #6E1F26;  /* ênfase — máx. 2-3/viewport  */
  --gold:       #B98A2F;  /* filetes SOMENTE             */
  --logo-black: #000;     /* variante oficial do lockup  */

  --serif-display: 'Bodoni Moda', 'Didot', serif;
  --serif-text:    'Newsreader', 'Georgia', serif;

  --fs-hero:  clamp(3.2rem, 9vw, 7.2rem);
  --fs-h2:    clamp(1.9rem, 4.2vw, 3.1rem);
  --fs-body:  1.125rem;
  --fs-small: .8125rem;
  --fs-micro: .6875rem;

  --measure: 62ch;
  --gutter:  clamp(2rem, 5vw, 4.5rem);
  --margin:  clamp(1.25rem, 6vw, 5rem);

  --shadow-plate: 0 18px 40px -18px rgba(62, 44, 27, .35),
                  0 4px 12px -6px rgba(62, 44, 27, .22);

  --ease-out: cubic-bezier(.22, .61, .21, 1);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif-text);
  font-optical-sizing: auto;
  font-size: var(--fs-body);
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* grão de papel — fixo, sem custo de repaint em scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .18 0 0 0 0 .12 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: rgba(110, 31, 38, .5); text-underline-offset: .18em; }
a:hover { color: var(--oxblood); }

:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: rgba(185, 138, 47, .32); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--bone);
  padding: .6rem 1.2rem;
  font-size: var(--fs-small);
}
.skip-link:focus { left: 0; }

/* ---------- utilitário: versaletes tipográficos ---------- */
.kicker, .sec-folio, .mast-cell, .mast-motto, .fig-label,
.aside-title, .footnotes-title, .toc-num, .folio-strip {
  font-family: var(--serif-text);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: var(--fs-small);
  font-weight: 500;
}

/* ============================================================
   masthead
   ============================================================ */
.masthead {
  padding: clamp(1.2rem, 3vw, 2.2rem) var(--margin) 0;
  max-width: 1240px;
  margin-inline: auto;
}

.mast-rule {
  height: 1px;
  background: var(--gold);
}
.mast-rule--double {
  height: 5px;
  background:
    linear-gradient(var(--gold), var(--gold)) top / 100% 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom / 100% 1px no-repeat;
}

.mast-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: clamp(.9rem, 2vw, 1.4rem) 0;
}
.mast-cell { color: var(--ink-muted); }
.mast-cell--right { text-align: right; }

.mast-logo { color: var(--logo-black); display: inline-flex; }
.mast-logo svg { height: clamp(34px, 5vw, 52px); width: auto; }

.mast-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
  border-top: 1px solid var(--gold);
  padding: .7rem 0;
}
.mast-motto { color: var(--ink-muted); letter-spacing: .22em; font-size: var(--fs-micro); }

.mast-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-size: var(--fs-small);
}
.mast-nav a { text-decoration: none; color: var(--ink-soft); }
.mast-nav a:hover { color: var(--oxblood); }
.mast-nav-guide {
  color: var(--oxblood) !important;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ============================================================
   spreads — a grade da revista
   ============================================================ */
.spread {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gutter);
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 6.5rem) var(--margin);
}

.sec-head { grid-column: 1 / -1; }

.sec-folio { color: var(--ink-muted); margin-bottom: .5rem; }
.sec-folio::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 3.4rem;
  height: 1px;
  background: var(--gold);
  margin-left: .9rem;
}

.sec-title {
  font-family: var(--serif-display);
  font-weight: 640;
  font-size: var(--fs-h2);
  line-height: 1.04;
  letter-spacing: -.005em;
  max-width: 18ch;
}
.sec-num {
  font-style: italic;
  font-weight: 470;
  color: var(--oxblood);
  margin-right: .35em;
}

.sec-body { max-width: var(--measure); }
.sec-body p + p { margin-top: 1.15em; text-indent: 1.8em; }

.sec-body--twocol {
  grid-column: 1 / -1;
  max-width: none;
  column-count: 2;
  column-gap: var(--gutter);
  column-rule: 1px solid rgba(185, 138, 47, .5);
}
.sec-body--twocol p { break-inside: avoid; }

/* ---------- capitular ---------- */
.dropcap::first-letter {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 4.35em;
  line-height: .76;
  float: left;
  padding: .06em .09em 0 0;
  color: var(--oxblood);
}

/* ---------- marginália ---------- */
.marginalia {
  margin-top: 1.4em;
  padding: .9em 0 .9em 1.2em;
  border-left: 2px solid var(--gold);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  text-indent: 0 !important;
}

/* ---------- notas de rodapé ---------- */
.fn-ref { line-height: 0; }
.fn-ref a {
  font-family: var(--serif-text);
  font-size: .68em;
  font-weight: 600;
  color: var(--oxblood);
  text-decoration: none;
  padding-inline: .15em;
}

.footnotes {
  grid-column: 1 / -1;
  max-width: var(--measure);
  margin-top: clamp(2rem, 5vw, 3.5rem);
  font-size: .9375rem;
  color: var(--ink-soft);
}
.footnotes-rule {
  width: 8rem;
  height: 1px;
  background: var(--gold);
  margin-bottom: 1.1rem;
}
.footnotes-title { color: var(--ink-muted); margin-bottom: .9rem; }
.footnotes ol {
  list-style: none;
  counter-reset: fn;
  display: grid;
  gap: .55rem;
}
.footnotes li {
  counter-increment: fn;
  padding-left: 1.7em;
  position: relative;
  line-height: 1.5;
}
.footnotes li::before {
  content: counter(fn) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: var(--oxblood);
}
.footnotes a { text-decoration: none; color: var(--ink-muted); }
.footnotes a:hover { color: var(--oxblood); }

/* ============================================================
   capa
   ============================================================ */
.spread--cover { padding-top: clamp(3.5rem, 9vw, 7rem); align-items: end; }

.kicker { color: var(--ink-muted); margin-bottom: clamp(1.2rem, 3vw, 2rem); }
.kicker .num { color: var(--oxblood); font-weight: 700; }

.cover-title {
  font-family: var(--serif-display);
  font-weight: 620;
  font-size: var(--fs-hero);
  line-height: .94;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.cover-title em {
  font-style: italic;
  font-weight: 460;
  color: var(--oxblood);
}

.cover-lede {
  margin-top: clamp(1.6rem, 4vw, 2.6rem);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  line-height: 1.55;
  max-width: 52ch;
  color: var(--ink-soft);
}
.cover-lede strong { color: var(--ink); font-weight: 600; }
.cover-lede em { color: var(--ink); }

.cover-aside {
  border-top: 5px double var(--gold);
  padding-top: 1.4rem;
  align-self: end;
}
.ornament { color: var(--gold); margin-bottom: 1.2rem; }
.aside-title { color: var(--ink-muted); margin-bottom: 1rem; }

.toc { list-style: none; display: grid; gap: .1rem; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  padding: .55rem 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(185, 138, 47, .45);
  font-family: var(--serif-display);
  font-size: 1.1rem;
  font-weight: 500;
}
.toc a:hover { color: var(--oxblood); }
.toc-num { color: var(--oxblood); font-size: var(--fs-micro); min-width: 2.5em; }

.aside-note {
  margin-top: 1.3rem;
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.6;
}
.swatch {
  display: inline-block;
  width: .75em;
  height: .75em;
  background: var(--bone);
  border: 1px solid var(--ink-muted);
  vertical-align: baseline;
}

/* ---------- faixa de fólio ---------- */
.folio-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1240px;
  margin-inline: auto;
  padding: .65rem var(--margin);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  color: var(--ink-muted);
  font-size: var(--fs-micro) !important;
  letter-spacing: .2em;
  background: var(--plate);
}

/* ============================================================
   pranchas (figuras)
   ============================================================ */
.plate-frame {
  background: var(--plate);
  padding: clamp(.6rem, 1.4vw, 1rem);
  border: 1px solid rgba(34, 29, 24, .55);
  box-shadow: var(--shadow-plate);
  position: relative;
  overflow: hidden;
}
.plate-frame img {
  mix-blend-mode: multiply;
  filter: sepia(.14) contrast(1.03);
}
/* retícula de meio-tom sobre a prancha */
.plate-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(34, 29, 24, .16) 1px, transparent 1.1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.plate figcaption {
  margin-top: .8rem;
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.55;
  letter-spacing: .01em;
}
.fig-label {
  font-style: normal;
  color: var(--oxblood);
  margin-right: .4em;
}

.plate--side { align-self: start; transform: rotate(.4deg); }
.spread--flip .plate--side { transform: rotate(-.35deg); }

.plate--center {
  grid-column: 1 / -1;
  max-width: 880px;
  margin-inline: auto;
  width: 100%;
}
.plate-frame--parallax { overflow: hidden; }
.plate-frame--parallax img {
  transform: scale(1.1) translateY(var(--plx, 0px));
  will-change: transform;
}

/* ordem visual: prancha à esquerda no spread invertido */
.spread--flip .plate--side { order: 1; }
.spread--flip .sec-body { order: 2; }

/* ---------- divisor ornamental ---------- */
.sec-divider {
  display: flex;
  justify-content: center;
  color: var(--gold);
  padding: .5rem var(--margin);
}

/* ============================================================
   doutrina
   ============================================================ */
.pullquote {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.pullquote p {
  font-family: var(--serif-display);
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  font-weight: 520;
  line-height: 1.22;
  text-wrap: balance;
  max-width: 26ch;
  margin-inline: auto;
}
.pullquote em { font-style: italic; color: var(--oxblood); }

/* ============================================================
   colofão
   ============================================================ */
.colophon {
  max-width: 1240px;
  margin-inline: auto;
  padding: 0 var(--margin) clamp(3rem, 7vw, 5rem);
}
.colophon .mast-rule--double { margin-bottom: clamp(2rem, 5vw, 3rem); }

.colophon-brand { text-align: center; }
.colophon-brand svg {
  height: 56px;
  width: auto;
  color: var(--logo-black);
  margin-inline: auto;
  margin-bottom: 1.2rem;
}
.colophon-brand p {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.colophon-note { margin-top: .4rem; font-style: italic; color: var(--ink-muted); }
.colophon-note a { color: var(--oxblood); text-decoration: none; }
.colophon-note a:hover { text-decoration: underline; }

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem 2rem;
  margin-top: clamp(1.6rem, 4vw, 2.4rem);
  padding-top: 1.2rem;
  border-top: 1px solid rgba(185, 138, 47, .5);
  font-size: var(--fs-small);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.colophon-links a { text-decoration: none; color: var(--ink-muted); }
.colophon-links a:hover { color: var(--oxblood); }
.colophon-links a[aria-current] {
  color: var(--oxblood);
  border-bottom: 1px solid currentColor;
}

/* ============================================================
   revelações (IntersectionObserver)
   ============================================================ */
html.js [data-io] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
html.js [data-io].io-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-io] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .plate-frame--parallax img { transform: none; will-change: auto; }
}

/* ============================================================
   colapso mobile
   ============================================================ */
@media (max-width: 879px) {
  .spread { grid-template-columns: 1fr; gap: clamp(1.8rem, 6vw, 2.6rem); }

  .spread--flip .plate--side { order: 2; }
  .spread--flip .sec-body { order: 1; }

  .sec-body--twocol { column-count: 1; column-rule: none; }

  .mast-row { grid-template-columns: 1fr; justify-items: center; gap: .6rem; }
  .mast-cell, .mast-cell--right { text-align: center; }
  .mast-subrow { justify-content: center; text-align: center; }

  .plate--side, .spread--flip .plate--side { transform: none; }

  .cover-aside { border-top-width: 3px; }
  .folio-strip span:nth-child(2) { display: none; }
}

@media (max-width: 480px) {
  :root { --fs-body: 1.0625rem; }
  .mast-nav { gap: .9rem; }
}
