/* Mikaela Stamataki — author website
   An editorial journal: bold serif headlines, ink rules, tilted pictures laid
   on the page like prints on a table, and Deep Olive kept for what matters. */

:root {
  --paper: #F5F0E7;   /* main background */
  --linen: #DDD0B9;   /* soft sections, borders */
  --ink: #292521;     /* headings, body, navigation, rules */
  --olive: #353D35;   /* buttons, feature panels */
  --walnut: #6E594B;  /* labels, captions (on Paper only) */

  --serif: "DM Serif Display", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura PT", Futura, "Century Gothic", system-ui, sans-serif;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 9vw, 7.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--olive); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--olive); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; text-decoration: none; }
.skip-link:focus { top: 1rem; color: var(--paper); }

.wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(3.4rem, 9vw, 7.25rem); }
h2 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
h3 { font-size: 1.6rem; line-height: 1.1; }
h1 em, h2 em { font-style: italic; font-weight: 400; }
.indent { display: block; padding-left: clamp(1.5rem, 9vw, 7rem); }

p { margin: 0; max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.65; }
.aside {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.25; color: var(--walnut);
}
.label {
  display: block;
  font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--walnut);
}
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2rem; }

/* ---------- Notice bar (inner pages) ---------- */
.notice { background: var(--olive); color: var(--paper); font-size: 0.88rem; }
.notice-inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.25rem 1.25rem; padding-block: 0.6rem; text-align: center; }
.notice a { color: var(--paper); font-weight: 500; }
.notice a:hover { color: var(--linen); }
.notice :focus-visible { outline-color: var(--paper); }

/* ---------- Masthead ---------- */
.masthead-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem; padding-block: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--ink);
}
.wordmark { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.25rem); font-weight: 400; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); line-height: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; }
.site-nav a { font-size: 1rem; text-decoration: none; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--linen); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
@media (max-width: 40rem) {
  .masthead-inner { flex-direction: column; align-items: flex-start; padding-block: 1.25rem 1rem; }
  .site-nav ul { gap: 0.25rem 1.25rem; }
  .site-nav a { font-size: 0.95rem; }
}

/* ---------- Buttons & arrow links ---------- */
.arrow { width: 0.85em; height: 0.85em; flex: none; transition: transform 0.2s ease; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.9rem;
  min-height: 3.4rem; padding: 0.85rem 1.75rem;
  background: var(--olive); color: var(--paper);
  border: 1px solid var(--olive); border-radius: 0;
  font: 500 1rem/1.2 var(--sans); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 1.25rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--walnut);
  text-decoration: none; font-size: 1rem; align-self: flex-start;
}
.arrow-link:hover .arrow { transform: translate(2px, -2px); }
.on-olive .arrow-link { color: var(--paper); border-bottom-color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }

/* ---------- Tilted pictures ---------- */
.print { margin: 0; position: relative; }
.print img { width: 100%; box-shadow: 0 2px 4px -2px var(--ink), 0 28px 48px -30px var(--ink); }
.tilt-l img { transform: rotate(-2.5deg); }
.tilt-r img { transform: rotate(2deg); }
.print figcaption {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.6rem); color: var(--walnut);
  text-align: right; margin-top: 1.5rem;
}

/* ---------- The letter stamp ---------- */
.stamp { display: block; width: clamp(8.5rem, 14vw, 11.5rem); height: auto; color: var(--ink); flex: none; }
.stamp .ring { fill: var(--paper); stroke: currentColor; stroke-width: 1.4; }
.stamp .ring-inner { fill: none; stroke: currentColor; stroke-width: 0.8; stroke-dasharray: 2 4; }
.stamp text { font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; fill: currentColor; }
.stamp .env { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stamp .spin { transform-origin: 100px 100px; transform: rotate(var(--spin, 0deg)); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
form { margin: 0; }
.form { display: flex; flex-direction: column; gap: 1.6rem; max-width: 36rem; }
.field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.field label, .field-label { font-size: 0.95rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--walnut); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; }
@media (max-width: 34rem) { .row-2 { grid-template-columns: 1fr; } }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 3.1rem;
  padding: 0.7rem 0;
  background: transparent; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--walnut); border-radius: 0;
  font: 400 1.1rem/1.5 var(--sans);
  appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--walnut); opacity: 0.85; }
input:focus, select:focus, textarea:focus { outline: none; border-bottom: 2px solid var(--olive); padding-bottom: calc(0.7rem - 1px); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--olive); outline-offset: 4px; }
textarea { min-height: 9rem; resize: vertical; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 0.85rem) 1.35rem, calc(100% - 0.5rem) 1.35rem;
  background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2rem;
}

.signup-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem; }
.signup-inline .field { flex: 1 1 15rem; }
.signup-inline .btn { flex: 0 0 auto; }

.fine { font-size: 0.88rem; line-height: 1.6; color: var(--walnut); max-width: 36rem; }
.fine a { color: var(--walnut); }
.form-status { font-size: 0.95rem; padding: 0.75rem 1rem; border-left: 2px solid var(--olive); background: var(--linen); color: var(--ink); }
.form-status:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.todo { border: 1px dashed var(--walnut); padding: 1rem 1.25rem; font-size: 0.95rem; max-width: var(--measure); display: flex; flex-direction: column; gap: 0.4rem; }

/* ---------- HOME: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(3rem, 7vw, 6rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5.5rem) var(--section);
}
.hero > * { min-width: 0; }
.hero-copy { display: flex; flex-direction: column; gap: 1.6rem; }
.hero-title { font-size: clamp(4rem, 11.5vw, 9rem); line-height: 0.86; letter-spacing: -0.03em; margin-top: 0.25rem; }
.hero-tagline { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.22; max-width: 28rem; }
.hero-art { position: relative; padding: 2rem 2rem 0 0; }
.hero-art .stamp { position: absolute; right: -1rem; top: -2.5rem; z-index: 2; }
.hero-signup { border-top: 1px solid var(--ink); padding-top: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 36rem; }
.signup-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.1rem); line-height: 1.1; }
@media (max-width: 56rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 30rem; padding: 0 0 2.5rem 1rem; margin-inline: auto; width: 100%; }
  .hero-art .stamp { right: -0.25rem; top: -2rem; width: 7rem; }
}

/* ---------- HOME: meet & themes ---------- */
.meet {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(3rem, 7vw, 6rem); align-items: center;
  padding-block: var(--section); border-top: 1px solid var(--ink);
}
.meet .print { max-width: 26rem; }
@media (max-width: 48rem) { .meet { grid-template-columns: 1fr; } .meet .print { max-width: 20rem; margin-inline: auto; } }

.themes { padding-block: 0 var(--section); display: flex; flex-direction: column; gap: 1.75rem; }
.theme-words { font-size: clamp(2.6rem, 7.5vw, 6rem); line-height: 1; display: flex; flex-wrap: wrap; gap: 0 0.45em; }
.theme-words span:nth-child(even) { font-style: italic; color: var(--walnut); }

/* ---------- Olive band ---------- */
.on-olive { background: var(--olive); color: var(--paper); }
.on-olive :focus-visible { outline-color: var(--paper); }
.on-olive .label { color: var(--linen); }
.band-inner {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(2.5rem, 6vw, 5rem); align-items: end; padding-block: var(--section);
}
.band-inner h2 { font-size: clamp(2.8rem, 6.5vw, 5.25rem); }
@media (max-width: 52rem) { .band-inner { grid-template-columns: 1fr; } }

/* ---------- Letters block (home, closing) ---------- */
.letters-block {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: var(--section);
}
@media (max-width: 60rem) { .letters-block { grid-template-columns: 1fr; } }

/* ---------- Page heads ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 4rem); display: flex; flex-direction: column; gap: 1.5rem; }
.page-head h1 { font-size: clamp(3.6rem, 10vw, 8rem); }

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(3rem, 7vw, 6rem); align-items: start; padding-block: 0 var(--section);
}
.about-text { border-top: 1px solid var(--ink); padding-top: 2.25rem; display: flex; flex-direction: column; gap: 1.4rem; }
.about .print { margin-top: 1rem; }
@media (max-width: 52rem) { .about { grid-template-columns: 1fr; } .about .print { max-width: 22rem; margin-inline: auto; } }

/* ---------- Books ---------- */
.book {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(3rem, 7vw, 6rem); align-items: center; padding-block: 0 var(--section);
}
.book .print { max-width: 30rem; }
.book h2 { font-size: clamp(2.8rem, 5vw, 4rem); }
.details { margin: 0; border-top: 1px solid var(--linen); max-width: var(--measure); }
.details div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding-block: 0.8rem; border-bottom: 1px solid var(--linen); }
.details dt { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--walnut); padding-top: 0.15rem; }
.details dd { margin: 0; }
@media (max-width: 52rem) { .book { grid-template-columns: 1fr; } .book .print { max-width: 22rem; margin-inline: auto; } }
@media (max-width: 30rem) { .details div { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ---------- Letters page ---------- */
.letters-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.letters-head h1 { font-size: clamp(3.6rem, 10vw, 8rem); line-height: 0.9; }
.letters-head .lede { margin-top: 2rem; }
@media (max-width: 44rem) { .letters-head { grid-template-columns: 1fr; } .letters-head .stamp { width: 8rem; } }
.letters-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 6rem); align-items: start; padding-block: 0 var(--section);
}
.letters-copy { border-top: 1px solid var(--ink); padding-top: 2.25rem; display: flex; flex-direction: column; gap: 1.4rem; }
@media (max-width: 52rem) { .letters-body { grid-template-columns: 1fr; } .letters-body .print { order: 2; } }
.contents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); padding-block: 0 var(--section); }
.contents > div { border-top: 1px solid var(--ink); padding-top: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; }
@media (max-width: 48rem) { .contents { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 6rem); align-items: start; padding-block: 0 var(--section); }
.contact > * { border-top: 1px solid var(--ink); padding-top: 2.25rem; }
.contact h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
@media (max-width: 52rem) { .contact { grid-template-columns: 1fr; } }

/* ---------- Prose ---------- */
.prose { padding-block: clamp(2.5rem, 6vw, 4rem) var(--section); max-width: 44rem; }
.prose h1 { font-size: clamp(3rem, 7vw, 5rem); margin-top: 1rem; }
.prose h2 { font-size: 2rem; margin-top: 2.75rem; }
.prose p { margin-top: 1rem; max-width: none; }

/* ---------- Footer ---------- */
.site-footer .wrap > .footer-top { border-top: 1px solid var(--ink); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2rem 3rem; padding-block: 3.5rem 2.5rem; }
.footer-name { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 0.95; letter-spacing: -0.02em; margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 0 2.5rem; font-size: 0.85rem; color: var(--walnut); }
.footer-base a { color: var(--walnut); }



/* =========================================================
   Movement: things to discover while scrolling
   ========================================================= */

/* reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--olive); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* reveal on scroll: only below-the-fold elements wait, and only when JS runs */
[data-reveal] { transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
[data-reveal].is-pending { opacity: 0; transform: translateY(32px); }

/* pictures straighten a little when you reach for them */
.print img { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.print:hover img { transform: rotate(0deg) scale(1.015); }

/* ---------- 3D book ---------- */
.book3d { --ry: 28deg; --rx: 0deg; --t: 2.6rem; position: relative; width: 100%; max-width: 25rem; margin-inline: auto; perspective: 1800px; }
.book3d .b { position: relative; aspect-ratio: 1200 / 1496; transform-style: preserve-3d; transform: rotateY(var(--ry)) rotateX(var(--rx)); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.book3d .face { position: absolute; }
.book3d .front { inset: 0; transform: translateZ(calc(var(--t) / 2)); }
.book3d .front img { width: 100%; height: 100%; object-fit: cover; }
.book3d .front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(41, 37, 33, 0.35), rgba(41, 37, 33, 0) 7%); pointer-events: none; }
.book3d .back { inset: 0; background: var(--olive); transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); }
.book3d .spine {
  top: 0; bottom: 0; left: calc(var(--t) / -2); width: var(--t);
  background: var(--olive); color: var(--paper);
  transform: rotateY(-90deg);
  writing-mode: vertical-rl;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 0; font-family: var(--serif); font-size: 1.15rem; line-height: 1;
}
.book3d .spine small { font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--linen); }
.book3d .pages { top: 1.2%; bottom: 1.2%; left: calc(100% - var(--t) / 2); width: calc(var(--t) - 4px); transform: rotateY(90deg); background: repeating-linear-gradient(90deg, var(--paper) 0 2px, var(--linen) 2px 3px); }
.book3d::after { content: ""; position: absolute; left: 6%; right: 0; bottom: -7%; height: 9%; background: radial-gradient(closest-side, rgba(41, 37, 33, 0.35), rgba(41, 37, 33, 0)); z-index: -1; }
.book-caption { text-align: center; margin-top: 2.75rem; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--ink); background: var(--linen); padding-block: 1.1rem; }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee-track span { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.1; white-space: nowrap; padding-right: 2.5rem; }
.marquee-track span:nth-child(odd) { font-style: italic; }
.marquee-track span::after { content: "\2726"; font-style: normal; font-size: 0.55em; vertical-align: middle; margin-left: 2.5rem; color: var(--walnut); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- debut row (three columns, as in the Lovable layout) ---------- */
.debut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr); gap: clamp(2.5rem, 5vw, 4rem); align-items: end; padding-block: var(--section); }
.debut .side { border-left: 1px solid var(--ink); padding-left: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 62rem) { .debut { grid-template-columns: 1fr 1fr; } .debut .side { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--ink); padding-top: 2rem; } }
@media (max-width: 44rem) { .debut { grid-template-columns: 1fr; } }

/* ---------- bookshelf: the trilogy ---------- */
.shelf { display: flex; align-items: flex-end; justify-content: center; gap: 0.35rem; min-height: 23rem; padding-inline: 1rem; border-bottom: 4px solid var(--ink); }
.spine-book {
  height: var(--h); width: var(--w);
  writing-mode: vertical-rl;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 64% 1px; background-repeat: no-repeat; background-position: center 0.6rem, center calc(100% - 0.6rem);
  transform-origin: bottom left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.9s ease;
  text-decoration: none;
}
.spine-book small { font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; }
.spine-book:hover { transform: translateY(-12px); }
.s1 { --h: 21rem; --w: 4.4rem; background-color: var(--olive); color: var(--paper); }
.s1:hover { color: var(--paper); }
.s2 { --h: 19.25rem; --w: 3.8rem; background-color: var(--linen); color: var(--ink); }
.s3 { --h: 20.25rem; --w: 4rem; background-color: var(--walnut); color: var(--paper); margin-left: 0.25rem; transform: rotate(7deg); }
.s3:hover { transform: rotate(4deg) translateY(-10px); }
.shelf-note { text-align: center; margin-top: 1rem; }

/* ---------- envelope ---------- */
.envelope { position: relative; width: min(24rem, 100%); aspect-ratio: 3 / 2; margin: 7rem auto 0; perspective: 1200px; }
.env-back { position: absolute; inset: 0; background: var(--walnut); }
.env-letter {
  position: absolute; left: 6%; right: 6%; top: 6%; height: 88%; z-index: 2;
  background: var(--paper); padding: 1.1rem 1.4rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(41, 37, 33, 0.25);
  transform: translateY(-52%);
  transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s;
}
.env-letter .l-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.05; }
.env-letter .l-title em { font-style: italic; }
.env-letter .l-lines { flex: 1; margin-top: 0.4rem; background: repeating-linear-gradient(to bottom, transparent 0 14px, var(--linen) 14px 15px); }
.env-front { position: absolute; inset: 0; z-index: 3; background: var(--linen); clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 1;
  background: var(--linen); clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transform: rotateX(180deg);
  transition: transform 0.6s ease, z-index 0s linear 0.3s;
}
.envelope::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: -10%; height: 12%; background: radial-gradient(closest-side, rgba(41, 37, 33, 0.3), rgba(41, 37, 33, 0)); z-index: -1; }
html.js .envelope:not(.is-open) .env-flap { transform: rotateX(0deg); z-index: 4; transition: none; }
html.js .envelope:not(.is-open) .env-letter { transform: translateY(0); transition: none; }
.letters-env { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: center; padding-block: var(--section); }
@media (max-width: 52rem) { .letters-env { grid-template-columns: 1fr; } .envelope { margin-top: 5rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  [data-reveal].is-pending { opacity: 1; transform: none; }
  .book3d .b { transform: rotateY(24deg); }
}

/* =========================================================
   The canvas: Take Me Home as a stretched canvas you can turn over
   ========================================================= */
.canvas3d { --w: min(22rem, 78vw); --ry: 24deg; --rx: 3deg; --flip: 0deg; --d: calc(var(--w) * 0.142); position: relative; width: var(--w); margin-inline: auto; perspective: 2200px; touch-action: pan-y; }
.canvas3d .c { position: relative; aspect-ratio: 1000 / 1543; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip))); transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.canvas3d.is-scrubbing .c { transition: transform 0.12s linear; }
.canvas3d .c > * { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.canvas3d .c img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-front { inset: 0; transform: translateZ(calc(var(--d) / 2)); }
.c-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(41, 37, 33, 0.28), rgba(41, 37, 33, 0) 4%, rgba(245, 240, 231, 0.12) 6%, rgba(245, 240, 231, 0) 9%); pointer-events: none; }
.c-back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.c-l { top: 0; bottom: 0; left: calc(var(--d) / -2); width: var(--d); transform: rotateY(-90deg); }
.c-l img { object-fit: fill; }
.c-l::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(41, 37, 33, 0.18), rgba(41, 37, 33, 0) 30%, rgba(41, 37, 33, 0) 70%, rgba(41, 37, 33, 0.18)); }
.c-r { top: 0.4%; bottom: 0.4%; left: calc(100% - var(--d) / 2 - 2px); width: var(--d); transform: rotateY(90deg); background: repeating-linear-gradient(90deg, var(--paper) 0 1.5px, var(--linen) 1.5px 2.5px); }
.c-t { left: 0.4%; right: 1%; top: calc(var(--d) / -2 + 2px); height: var(--d); transform: rotateX(90deg); background: repeating-linear-gradient(0deg, var(--paper) 0 1.5px, var(--linen) 1.5px 2.5px); }
.c-b { left: 0.4%; right: 1%; top: calc(100% - var(--d) / 2 - 2px); height: var(--d); transform: rotateX(-90deg); background: repeating-linear-gradient(0deg, var(--paper) 0 1.5px, var(--linen) 1.5px 2.5px); box-shadow: inset 0 0 0 999px rgba(41, 37, 33, 0.12); }
.canvas3d::after { content: ""; position: absolute; left: 0; right: 4%; bottom: -6%; height: 8%; background: radial-gradient(closest-side, rgba(41, 37, 33, 0.38), rgba(41, 37, 33, 0)); z-index: -1; }
.canvas-tools { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2.75rem; flex-wrap: wrap; }
.turn-btn {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.9rem; padding: 0.6rem 1.2rem;
  background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: 999px;
  font: 500 0.95rem/1 var(--sans); cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease;
}
.turn-btn:hover { background: var(--ink); color: var(--paper); }
.turn-btn svg { width: 1.05em; height: 1.05em; transition: transform 0.6s ease; }
.turn-btn[aria-pressed="true"] svg { transform: rotate(180deg); }
.canvas-hint { font-size: 0.85rem; color: var(--walnut); }

/* ---------- scroll stage: the canvas turns as you scroll ---------- */
.flip-stage { position: relative; border-block: 1px solid var(--ink); }
.flip-sticky { padding-block: var(--section); }
.flip-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.flip-steps { display: flex; flex-direction: column; gap: 3rem; }
.step { display: flex; flex-direction: column; gap: 1.25rem; }
.step-quote { font-family: var(--serif); font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; max-width: 30rem; }
.step-quote em { font-style: italic; }
.scroll-hint { display: none; font-size: 0.9rem; color: var(--walnut); align-items: center; gap: 0.5rem; }
.scroll-hint svg { width: 1em; height: 1em; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.step-dots { display: none; gap: 0.5rem; }
.step-dots i { width: 2rem; height: 2px; background: var(--linen); transition: background-color 0.3s ease; }
.step-dots i.on { background: var(--ink); }

/* live (JS on, motion allowed): pin the canvas and play the steps */
.flip-stage.is-live { height: 320vh; }
.flip-stage.is-live .flip-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; padding-block: 0; display: flex; align-items: center; overflow: hidden; }
.flip-stage.is-live .flip-grid { width: 100%; }
.flip-stage.is-live .flip-steps { position: relative; min-height: 26rem; gap: 0; }
.flip-stage.is-live .step { position: absolute; inset: 0; justify-content: center; opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; pointer-events: none; }
.flip-stage.is-live .step.is-active { opacity: 1; transform: none; pointer-events: auto; }
.flip-stage.is-live .scroll-hint, .flip-stage.is-live .step-dots { display: flex; }
.flip-stage.is-live .canvas3d { --w: min(23rem, 46svh); }
@media (max-width: 52rem) {
  .flip-grid { grid-template-columns: 1fr; gap: 2rem; }
  .flip-stage.is-live .flip-grid { gap: 1.25rem; padding-top: 1.5rem; }
  .flip-stage.is-live .flip-steps { min-height: 19rem; }
  .flip-stage.is-live .step-quote { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .flip-stage.is-live .step p:not(.step-quote) { font-size: 0.98rem; line-height: 1.6; }
}

/* ---------- gallery wall labels ---------- */
.wall-label {
  background: var(--paper); border: 1px solid var(--ink);
  padding: 0.85rem 1.1rem; display: flex; flex-direction: column; gap: 0.1rem;
  font-size: 0.85rem; line-height: 1.45; max-width: 17rem;
  box-shadow: 0 10px 24px -18px var(--ink);
}
.wall-label strong { font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.78rem; }
.hero-art .wall-label { position: absolute; left: -0.5rem; bottom: 1.25rem; z-index: 2; transform: rotate(-1.5deg); }
@media (max-width: 56rem) { .hero-art .wall-label { left: 0; bottom: 0.5rem; } }

.labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.labels .wall-label { max-width: none; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.labels .wall-label:nth-child(odd) { transform: rotate(-1deg); }
.labels .wall-label:nth-child(even) { transform: rotate(1.2deg); }
.labels .wall-label:hover { transform: rotate(0deg) translateY(-4px); }
.wip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 40rem) { .wip { grid-template-columns: 1fr; } }
.wip .wall-label { max-width: none; padding: 1.5rem; gap: 0.5rem; }
.wip .wall-label .v { font-size: 1.9rem; }
.labels .wall-label .v { font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; margin-top: 0.3rem; }
@media (max-width: 34rem) { .labels { grid-template-columns: 1fr; } }
.meet-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 6rem); align-items: center; padding-block: var(--section); }
@media (max-width: 52rem) { .meet-grid { grid-template-columns: 1fr; } }

/* ---------- full cover wrap ---------- */
.wrap-cover { padding-block: var(--section); border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 2.5rem; }
.wrap-cover .print { max-width: 62rem; margin-inline: auto; }
.wrap-cover .print img { transform: rotate(-1deg); }

@media (prefers-reduced-motion: reduce) {
  .canvas3d .c { transition: none; }
  .scroll-hint svg { animation: none; }
}
@media (max-width: 52rem) {
  .flip-stage.is-live .canvas3d { --w: min(11rem, 22svh); }
  .flip-stage.is-live .step { justify-content: flex-start; gap: 0.85rem; }
  .flip-stage.is-live .flip-steps { min-height: 24rem; }
  .flip-stage.is-live .step-dots { position: absolute; top: -0.9rem; left: 0; }
  .flip-stage.is-live .step .btn { min-height: 3rem; padding: 0.7rem 1.25rem; }
}
@media (max-width: 52rem) and (max-height: 720px) {
  .flip-stage.is-live .step p:not(.step-quote) { font-size: 0.9rem; line-height: 1.5; }
  .flip-stage.is-live .step .arrow-link { display: none; }
}

/* ---------- From the author ---------- */
.from-author { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; padding-block: var(--section); border-top: 1px solid var(--ink); }
.fta-head { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 2rem; }
.fta-head h2 { font-size: clamp(2.3rem, 4.4vw, 3.6rem); }
.fta-body { display: flex; flex-direction: column; gap: 1.4rem; }
.fta-sign { font-family: var(--serif); font-style: italic; font-size: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--linen); max-width: 16rem; }
@media (max-width: 52rem) { .from-author { grid-template-columns: 1fr; } .fta-head { position: static; } }

/* hero name always fits its own column (never runs under the photo) */
.hero-copy { container-type: inline-size; position: relative; z-index: 3; }
.hero-title { font-size: clamp(3.4rem, 9vw, 8rem); font-size: min(8.5rem, 15.5cqi); }
.hero-title .indent { padding-left: 0.6em; }
