/* ==========================================================================
   Leggo Dante — visual system
   Display: Cormorant Garamond (high-contrast old-style serif)
   Text:    Inter (quiet neutral sans)
   Accent:  travels ember -> amber -> gold down the page (Inferno -> Paradiso)
   ========================================================================== */

:root {
  --paper:      #faf7f2;
  --paper-warm: #f2ece1;
  --paper-deep: #171310;

  --ink:      #1c1917;
  --ink-soft: #4a443d;
  --ink-mute: #8a8177;

  --line:        rgba(28, 25, 23, 0.13);
  --line-strong: rgba(28, 25, 23, 0.28);

  --ember: #8a2b22;
  --amber: #a3763c;
  --gold:  #b99553;

  --accent: var(--ember);

  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --shell:  1140px;
  --rail:   10rem;          /* margin column that holds the canto numerals */
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.72;
  font-weight: 350;
  letter-spacing: 0.001em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint laid-paper warmth — pure CSS, no assets. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(185, 149, 83, 0.09), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(138, 43, 34, 0.045), transparent 65%);
}

body > * { position: relative; z-index: 1; }

::selection {
  background: rgba(138, 43, 34, 0.14);
  color: var(--ink);
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

.masthead.is-stuck {
  background: rgba(250, 247, 242, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--line);
}

.masthead__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.32rem;
  letter-spacing: 0.005em;
  text-transform: none;
  color: var(--ember);
  margin-right: 0.42em;
  vertical-align: -0.07em;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 0.7rem;
  font-weight: 450;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.masthead nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.masthead .section-links { display: none; }

@media (min-width: 860px) {
  .masthead .section-links { display: flex; gap: clamp(14px, 2.4vw, 30px); }
}

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: clamp(0px, 2vw, 26px);
}

@media (min-width: 860px) {
  .lang { border-left: 1px solid var(--line); }
}

.lang a { color: var(--ink-mute); }
.lang a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.lang span { color: var(--line-strong); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: clamp(56px, 11vh, 108px) 0 clamp(64px, 12vh, 120px);
}

.hero__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(36px, 6vw, 76px);
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(36px, 4vw, 60px);
    align-items: end;
  }
}

/* The terzina, set like a critical edition with verse numbers in the margin. */
.terzina {
  margin: 0;
  padding-left: 2.6rem;
  position: relative;
  counter-reset: verse;
}

.terzina ol {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.terzina ol::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.5em;
  bottom: 0.5em;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), rgba(185, 149, 83, 0.15));
  opacity: 0.55;
}

.terzina li {
  counter-increment: verse;
  position: relative;
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.25rem, 0.95rem + 1.2vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink);
  /* verse setting: run-over lines hang below the first */
  padding-left: 1.1em;
  text-indent: -1.1em;
}

.terzina li::before {
  content: counter(verse);
  position: absolute;
  left: -2.6rem;
  top: 0.55em;
  width: 1.2rem;
  text-align: right;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

.terzina .gloss {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: 34ch;
}

.terzina cite {
  display: block;
  margin-top: 26px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(20px, 3vw, 30px);
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--ember);
}

.hero__lead {
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 clamp(28px, 4vw, 38px);
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--btn-fg);
  text-decoration: none;
  padding: 15px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: color 0.35s ease, border-color 0.35s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1);
}

.btn > * { position: relative; }

.btn .arrow {
  transition: transform 0.35s ease;
  font-size: 1.05em;
  line-height: 1;
}

.btn:hover { color: var(--paper); border-color: var(--ink); }
.btn:hover::before { transform: scaleX(1); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--light { --btn-fg: var(--paper); border-color: rgba(250, 247, 242, 0.32); }
.btn--light::before { background: var(--gold); }
.btn--light:hover { color: var(--paper-deep); border-color: var(--gold); }

a.link {
  color: var(--ember);
  text-decoration: none;
  border-bottom: 1px solid rgba(138, 43, 34, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.25s ease;
}

a.link:hover { border-bottom-color: var(--ember); }

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

/* --------------------------------------------------------------------------
   Cantos (sections)
   -------------------------------------------------------------------------- */

.canto {
  padding: clamp(64px, 9vw, 116px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.contact { scroll-margin-top: 72px; }

/* The journey down the page: Inferno -> Purgatorio -> Paradiso */
.canto--i   { --accent: var(--ember); }
.canto--ii  { --accent: #96502c; }
.canto--iii { --accent: var(--amber); }
.canto--iv  { --accent: #ad8949; }
.canto--v   { --accent: var(--gold); }

.canto__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(28px, 4vw, 52px);
}

@media (min-width: 900px) {
  .canto__inner {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
  }
}

.canto__mark {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 0.5em;
}

@media (min-width: 900px) {
  .canto__mark {
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 96px;
  }
}

.canto__numeral {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.06em;
}

p.canto__kicker { margin: 0; }

.canto__kicker {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  max-width: 9rem;
}

.canto h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.85rem, 1.3rem + 2vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 clamp(18px, 2.5vw, 26px);
  max-width: 20ch;
  text-wrap: balance;
}

.prose {
  max-width: 60ch;
  color: var(--ink-soft);
  margin: 0;
}

.prose + .prose { margin-top: 1.15em; }

.prose strong {
  font-weight: 500;
  color: var(--ink);
}

/* Drop cap opens the method section like a printed page. */
.prose--opening::first-letter {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3.55em;
  line-height: 0.82;
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Bio
   -------------------------------------------------------------------------- */

.bio {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
}

@media (min-width: 760px) {
  .bio {
    grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
    align-items: start;
  }
}

.portrait {
  position: relative;
  isolation: isolate;
}

.portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
  border-radius: 2px;
  position: relative;
  z-index: 1;
}

/* Offset hairline frame — an exact copy of the image rect, nudged down-right. */
.portrait::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--accent);
  opacity: 0.4;
  border-radius: 2px;
  z-index: 0;
}

.portrait figcaption {
  margin-top: 30px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.5;
}

.credentials {
  list-style: none;
  margin: clamp(26px, 4vw, 36px) 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 60ch;
}

.credentials li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.credentials li:last-child { border-bottom: 1px solid var(--line); }

.prose--after-list { margin-top: 1.6em; }

.credentials .year {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 0.28em;
}

/* --------------------------------------------------------------------------
   Audience — an index, not a bullet list
   -------------------------------------------------------------------------- */

.audience {
  list-style: none;
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding: 0;
  counter-reset: item;
  max-width: 68ch;
}

.audience li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  transition: color 0.3s ease;
}

.audience li:last-child { border-bottom: 1px solid var(--line); }
.audience li:hover { color: var(--ink); }

.audience li::before {
  content: counter(item, upper-roman);
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding-top: 0.15em;
}

.audience b {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   Video
   -------------------------------------------------------------------------- */

.video {
  margin-top: clamp(28px, 4vw, 40px);
  aspect-ratio: 16 / 9;
  max-width: 720px;
  background:
    radial-gradient(80% 120% at 50% 0%, #2a201b, transparent 70%),
    var(--paper-deep);
  border-radius: 3px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.video::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(185, 149, 83, 0.22);
  border-radius: 2px;
  pointer-events: none;
}

.video__play {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: grid;
  place-items: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), background-color 0.4s ease;
}

.video__play::before {
  content: "";
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--gold);
  margin-left: 4px;
}

.video:hover .video__play {
  transform: scale(1.07);
  background: rgba(185, 149, 83, 0.12);
}

.video__label {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 450;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242, 236, 225, 0.6);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Readings
   -------------------------------------------------------------------------- */

.readings {
  list-style: none;
  margin: clamp(30px, 4vw, 44px) 0 0;
  padding: 0;
  max-width: 68ch;
}

.readings li {
  display: grid;
  gap: 6px 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 620px) {
  .readings li { grid-template-columns: 6.5rem minmax(0, 1fr); }
}

.readings li:last-child { border-bottom: 1px solid var(--line); }

.readings .year {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 0.3em;
}

.readings h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.25;
  margin: 0 0 3px;
  color: var(--ink);
}

.readings p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-mute);
}

.notice {
  margin-top: clamp(30px, 4vw, 42px);
  padding: 24px 28px;
  background: var(--paper-warm);
  border-left: 2px solid var(--accent);
  border-radius: 0 2px 2px 0;
  max-width: 62ch;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.notice p { margin: 0; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  background: var(--paper-deep);
  color: var(--paper);
  padding: clamp(76px, 12vw, 132px) 0 clamp(44px, 6vw, 64px);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 90% at 50% 0%, rgba(185, 149, 83, 0.16), transparent 65%);
  pointer-events: none;
}

.contact__inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
  position: relative;
}

.contact .canto__kicker { color: var(--gold); max-width: none; }

.contact h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  line-height: 1.1;
  margin: 16px 0 20px;
  max-width: none;
  color: var(--paper);
  text-wrap: balance;
}

.contact .prose {
  color: rgba(242, 236, 225, 0.72);
  margin: 0 auto clamp(30px, 4vw, 40px);
  max-width: 46ch;
}

.contact__rule {
  width: 1px;
  height: 54px;
  margin: 0 auto 26px;
  background: linear-gradient(180deg, transparent, var(--gold));
}

.colophon {
  margin-top: clamp(52px, 7vw, 78px);
  padding-top: 22px;
  border-top: 1px solid rgba(242, 236, 225, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 236, 225, 0.42);
}

.colophon a {
  color: rgba(242, 236, 225, 0.62);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 236, 225, 0.22);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.colophon a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* --------------------------------------------------------------------------
   Language gateway (root index — only ever seen without JavaScript)
   -------------------------------------------------------------------------- */

.gateway {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 64px var(--gutter);
}

.gateway h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.15;
  margin: 0;
}

.gateway h1 em {
  font-style: italic;
  color: var(--ember);
}

.gateway__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

/* Scoped to html.js so content is never hidden when scripting is unavailable. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
