/* ════════════════════════════════════════════════════════════════
   DAS PORTFOLIO — newspaper front page
   Type: Playfair Display (headlines) + Inter (body)
   Palette: warm paper, near-black ink, pastel accents
   ════════════════════════════════════════════════════════════════ */

:root {
  --paper: #fbf8f1;
  --cream: #fffdee;
  --ink: #2c2a26;
  --ink-soft: #6b675f;
  --rule: #d8d2c4;
  --rule-dark: #2c2a26;
  --pastel-blue: #b9cfe8;
  --pastel-rose: #e8c4c4;
  --pastel-sage: #c5d1b9;
  --pastel-butter: #f3e7b9;
  --plot-ink: #8a4a21;
  --plot-green: #7f9d5e;
  --halftone: radial-gradient(circle at 1px 1px, rgba(44, 42, 38, 0.04) 1px, transparent 1.7px);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --ease-tactile: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(138, 74, 33, 0.05), transparent 60%),
    repeating-linear-gradient(0deg, rgba(44, 42, 38, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #fcf9f2 0%, #faf6ec 45%, #f5efdf 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pastel-butter); }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ── Page frame ─────────────────────────────────────────────── */

.paper {
  max-width: 1100px;
  margin: 0 auto;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0) 260px),
    radial-gradient(ellipse 140% 30% at 50% 0%, rgba(255, 253, 238, 0.85), transparent 70%),
    linear-gradient(178deg, #fcf9f1 0%, #faf7ee 55%, #f8f3e6 100%);
  min-height: 100vh;
}

/* smooth language crossfade (fallback when View Transitions unavailable) */
.paper, .ticker { transition: opacity 0.25s var(--ease-tactile); }
body.lang-fading .paper,
body.lang-fading .ticker { opacity: 0; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Opening sheet (loading screen) ─────────────────────────── */

body.loading { overflow: hidden; }

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  perspective: 1800px;
}

#page-loader.turn,
#page-loader.peeling { pointer-events: none; }

.loader-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background:
    radial-gradient(ellipse 75% 60% at 50% 32%, rgba(255, 255, 255, 0.7), transparent 70%),
    linear-gradient(165deg, #fffef5 0%, #fffdee 55%, #f7f1da 100%);
  transform-origin: left center;
  backface-visibility: hidden;
  will-change: transform;
}

.loader-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 10%;
  background: linear-gradient(270deg, rgba(44, 42, 38, 0.06), transparent);
}

/* the turn is driven by js/flip.js (shared with the book pages);
   the .turn class remains as the reduced-motion fade path */

.loader-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.4rem, 7.5vw, 4.8rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  color: var(--ink);
  min-height: 1.1em;
}

.loader-caret {
  display: inline-block;
  width: 5px;
  height: 0.82em;
  background: var(--ink);
  margin-left: 8px;
  vertical-align: baseline;
  animation: blink 0.8s infinite;
}

.loader-dateline {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  transition: opacity 0.45s var(--ease-tactile);
}

#page-loader .loader-dateline.show { opacity: 1; }

/* ── News ticker ────────────────────────────────────────────── */

.ticker {
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 200% at 50% -60%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #f7eecb 0%, #f3e7b9 55%, #ecdfa4 100%);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.ticker-track {
  display: inline-flex;
  padding: 0.4rem 0;
  animation: ticker-scroll 45s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item { padding-right: 2rem; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Masthead ───────────────────────────────────────────────── */

.masthead {
  background:
    radial-gradient(ellipse 70% 130% at 50% -25%, rgba(255, 255, 255, 0.75), transparent 70%),
    linear-gradient(180deg, #fffef5 0%, #fffdee 60%, #fcf8e1 100%);
  border-bottom: 3px double var(--ink);
  text-align: center;
  padding: 0 1.5rem;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead-meta { color: var(--ink-soft); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.lang-toggle button {
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: none;
  border: none;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  transition: color 0.25s var(--ease-tactile), border-color 0.25s var(--ease-tactile);
}

.lang-toggle button:hover { color: var(--ink); }

.lang-toggle button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.lang-divider { color: var(--rule); }

.masthead-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3rem, 9.5vw, 6.2rem);
  letter-spacing: -0.04em;
  margin: 0;
  padding-top: 1.4rem;
  line-height: 1;
}

.masthead-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 1rem;
}

.dateline {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 0.45rem 0;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dateline .dot { color: var(--ink-soft); }

.section-index {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.8rem;
  padding: 0.55rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

.section-index a {
  text-decoration: none;
  padding-bottom: 1px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left bottom;
  transition: background-size 0.35s var(--ease-tactile);
}

.section-index a:hover { background-size: 100% 2px; }

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 3.2rem 1.5rem 2.4rem;
  border-bottom: 1px solid var(--ink);
  background:
    radial-gradient(ellipse 55% 75% at 50% 18%, rgba(185, 207, 232, 0.14), transparent 68%),
    radial-gradient(ellipse 90% 40% at 50% 100%, rgba(44, 42, 38, 0.018), transparent 70%);
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.kicker::before, .kicker::after { content: " ❧ "; color: var(--rule); }
.kicker-left::before, .kicker-left::after { content: none; }

.hero-headline {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.9rem, 5.4vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 auto;
  max-width: 18ch;
  min-height: 2.3em;
}

.cursor {
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background: var(--ink);
  margin-left: 6px;
  animation: blink 0.8s infinite;
  vertical-align: baseline;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.hero-deck {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 1.2rem auto 0;
  line-height: 1.5;
}

.byline {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 1.6rem;
  color: var(--ink);
}

/* ── Front-page grid (editorial + sidebar) ──────────────────── */

.front-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border-bottom: 1px solid var(--ink);
}

/* the wide ASCII <pre> must never set the column's minimum width */
.front-grid > * { min-width: 0; }

.editorial { padding: 2.2rem 2.2rem 2.4rem; }

.article-head { margin-bottom: 1.2rem; }

.article-headline {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0.2rem 0 0;
}

.editorial-body p {
  margin: 0 0 1rem;
  font-size: 0.97rem;
  text-align: justify;
  hyphens: auto;
}

.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
}

.hero-figure {
  margin: 1.8rem 0 0;
  border: 1px solid var(--ink);
  background:
    radial-gradient(ellipse 80% 100% at 50% -20%, rgba(255, 255, 255, 0.6), transparent 70%),
    linear-gradient(170deg, #fffef6 0%, #fdfae9 70%, #faf5dd 100%);
  padding: 1rem 1rem 0.6rem;
  transition: transform 0.5s var(--ease-tactile), box-shadow 0.5s var(--ease-tactile);
}

.hero-figure:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
}

/* ── fig. 1 — ASCII robot arm, after a1k0n's donut ──────────── */

.ascii-art {
  display: block;
  margin: 0;
  overflow: hidden;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 10px;
  letter-spacing: 0;
  white-space: pre;
  text-align: left;
  color: var(--plot-ink);
  user-select: none;
}

.hero-figure figcaption {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.5rem 0 0.3rem;
  border-top: 1px solid var(--rule);
  margin-top: 0.6rem;
}

/* ── Sidebar ────────────────────────────────────────────────── */

.sidebar {
  border-left: 1px solid var(--ink);
  padding: 2.2rem 1.6rem;
  background:
    var(--halftone) 0 0 / 16px 16px,
    linear-gradient(180deg, var(--cream), rgba(251, 248, 241, 0) 340px),
    linear-gradient(170deg, #fcf9f0, #f9f4e6);
}

.sidebar-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px double var(--ink);
}

.sidebar-group { margin-bottom: 1.5rem; }

.sidebar-group h4 {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
}

.sidebar-note {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-list li {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid var(--ink);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--paper);
  transition: background 0.3s var(--ease-tactile), transform 0.3s var(--ease-tactile);
}

.chip-list li:hover {
  background: var(--pastel-blue);
  transform: translateY(-2px);
}

.chip-list li:nth-child(3n+2):hover { background: var(--pastel-rose); }
.chip-list li:nth-child(3n):hover { background: var(--pastel-sage); }

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.plain-list li {
  padding: 0.3rem 0;
  border-bottom: 1px dotted var(--rule);
}

.plain-list li:last-child { border-bottom: none; }

.weather-box {
  border: 1px solid var(--ink);
  background:
    radial-gradient(ellipse 80% 120% at 20% -20%, rgba(255, 255, 255, 0.5), transparent 65%),
    linear-gradient(160deg, #c8dbf0 0%, #b9cfe8 60%, #a9c2e0 100%);
  padding: 0.9rem 1rem;
  margin-top: 2rem;
}

.weather-box h4 {
  font-family: var(--serif);
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}

.weather-box p {
  font-size: 0.8rem;
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

/* ── Section bands & heads ──────────────────────────────────── */

.band { padding: 2.8rem 2.2rem 2.4rem; border-bottom: 1px solid var(--ink); }

.section-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
}

.section-head::before,
.section-head::after {
  content: "";
  flex: 1;
  border-top: 3px double var(--ink);
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  letter-spacing: 0.01em;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-head-minor { margin-top: 3rem; }

.section-head-minor h2 {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  text-transform: none;
  font-style: italic;
  font-weight: 700;
  white-space: normal;
}

.section-sub {
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.7rem 0 2.2rem;
}

/* ── Experience stories ─────────────────────────────────────── */

.story {
  max-width: 760px;
  margin: 0 auto 2.6rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px dotted var(--rule-dark);
}

.story:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.story-dateline {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
}

.role-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 1rem;
}

.story-body p {
  font-size: 0.97rem;
  margin: 0 0 0.9rem;
  text-align: justify;
  hyphens: auto;
}

@media (min-width: 760px) {
  .story-cols {
    column-count: 2;
    column-gap: 2.4rem;
    column-rule: 1px solid var(--rule);
  }
  .story-cols p { break-inside: avoid-column; }
}

.story-tags { margin-top: 1rem; }

.story-more {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.story-more a {
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left bottom;
  transition: background-size 0.35s var(--ease-tactile);
}

.story-more a:hover { background-size: 100% 2px; }

/* ── Fold ───────────────────────────────────────────────────── */

.fold {
  position: relative;
  text-align: center;
  padding: 1.1rem 0;
  border-bottom: 2px dashed var(--ink-soft);
  margin-bottom: -1px;
}

.fold-label {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  position: relative;
  top: 1.85rem;
  padding: 0 1rem;
}

/* ── Project cards ──────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

.card {
  border: 1px solid var(--ink);
  background:
    var(--halftone) 0 0 / 16px 16px,
    radial-gradient(ellipse 90% 60% at 50% -15%, rgba(255, 255, 255, 0.6), transparent 65%),
    linear-gradient(165deg, #fffef6 0%, #fffdee 55%, #fbf6df 100%);
  padding: 1.5rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 0.45s var(--ease-tactile), box-shadow 0.45s var(--ease-tactile);
}

.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}

.card-featured {
  background:
    var(--halftone) 0 0 / 16px 16px,
    radial-gradient(ellipse 90% 60% at 50% -15%, rgba(255, 255, 255, 0.55), transparent 65%),
    linear-gradient(165deg, #fcf9f1 0%, #faf7ee 55%, #f6f0de 100%);
  border-width: 2px;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.stamp {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 0.1rem 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
  background: linear-gradient(160deg, #efd2d2 0%, #e8c4c4 60%, #e0b5b5 100%);
  transform: rotate(-2deg);
  transition: transform 0.35s var(--ease-tactile);
}

.card:hover .stamp { transform: rotate(2deg) scale(1.06); }

.stamp-live { background: linear-gradient(160deg, #d2dcc7 0%, #c5d1b9 60%, #b8c6a9 100%); }

.card-headline {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0;
}

.card-body {
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.editors-note {
  font-size: 0.8rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  background:
    radial-gradient(ellipse 70% 140% at 15% -30%, rgba(255, 255, 255, 0.5), transparent 65%),
    linear-gradient(160deg, #f7eecb 0%, #f3e7b9 65%, #eee0a8 100%);
  border-left: 3px solid var(--ink);
  line-height: 1.5;
}

.editors-note em { font-family: var(--serif); font-weight: 700; }

/* ── Education ──────────────────────────────────────────────── */

.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
  margin-top: 2rem;
}

.edu-item {
  border-top: 3px double var(--ink);
  padding-top: 1rem;
}

.edu-item h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
}

.edu-school { margin: 0; font-size: 0.9rem; }

.edu-meta {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  background:
    radial-gradient(ellipse 80% 70% at 50% -10%, rgba(255, 253, 238, 0.07), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(255, 253, 238, 0.025) 1px, transparent 1.7px) 0 0 / 18px 18px,
    linear-gradient(180deg, #36332d 0%, #2c2a26 45%, #221f1a 100%);
  color: var(--paper);
  text-align: center;
  padding: 2.6rem 2rem 2rem;
}

.section-head-invert::before,
.section-head-invert::after { border-top-color: var(--paper); }

.section-head-invert h2 { color: var(--paper); }

.contact-pitch {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  margin: 1.4rem auto 1.6rem;
  max-width: 44ch;
}

.contact-links {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 2.2rem;
  font-size: 0.9rem;
}

.contact-links a {
  color: var(--paper);
  text-decoration: none;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--pastel-butter), var(--pastel-butter));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left bottom;
  transition: background-size 0.35s var(--ease-tactile), color 0.35s var(--ease-tactile);
}

.contact-links a:hover {
  color: var(--pastel-butter);
  background-size: 100% 2px;
}

.colophon {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(251, 248, 241, 0.65);
  border-top: 1px solid rgba(251, 248, 241, 0.25);
  padding-top: 1.2rem;
  margin: 0;
  max-width: 64ch;
  margin-inline: auto;
}

/* ── Book pagination (Apple-Books-style page turns) ─────────── */

body.book-mode .book {
  position: relative;
  perspective: 2600px;
}

body.book-mode .book-page {
  display: none;
  background: linear-gradient(178deg, #fcf9f1 0%, #faf7ee 55%, #f8f3e6 100%);
}

body.book-mode .book-page.active { display: block; }

body.book-mode .book.flipping { overflow: hidden; }

body.book-mode .book.flipping .book-page.active {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 1;
}

/* the peel itself (fold geometry, flap, crease, shadow) is driven
   per-frame by js/flip.js — no keyframes needed here */

/* ── Page controls (folio bar) ──────────────────────────────── */

.page-controls { display: none; }

body.book-mode .page-controls {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.4rem;
  border-top: 1px solid var(--ink);
  background:
    linear-gradient(180deg, #fffef5 0%, #fdfae9 100%);
}

.page-controls button {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left bottom;
  transition: background-size 0.35s var(--ease-tactile), opacity 0.3s;
}

.page-controls button:hover:not(:disabled) { background-size: 100% 2px; }

.page-controls button:disabled {
  opacity: 0.25;
  cursor: default;
}

.page-indicator {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

.section-index a.current-page { background-size: 100% 2px; }

/* ── Scroll reveals ─────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-tactile), transform 0.7s var(--ease-tactile);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .front-grid { grid-template-columns: 1fr; }
  .sidebar { border-left: none; border-top: 1px solid var(--ink); }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .editorial, .band { padding-left: 1.2rem; padding-right: 1.2rem; }
  .editorial-body p, .story-body p { text-align: left; }
  .edu-grid { grid-template-columns: 1fr; }
  .masthead-top { font-size: 0.64rem; }
  .masthead-issue { display: none; }
  .section-head h2 { white-space: normal; }
}

/* ── Reduced motion ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .cursor, .loader-caret { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .hero-figure, .chip-list li, .stamp { transition: none; }
  .loader-sheet { transition: opacity 0.3s ease; }
  #page-loader.turn .loader-sheet { animation: none; transform: none; box-shadow: none; opacity: 0; }
}

/* ── Print (it is, after all, a newspaper) ──────────────────── */

@media print {
  .ticker, .lang-toggle, .section-index, .skip-link, .page-controls { display: none !important; }
  body.book-mode .book-page { display: block !important; }
  .paper { border: none; max-width: 100%; }
  .reveal { opacity: 1; transform: none; }
  .footer { background: none; color: var(--ink); }
  .footer a, .section-head-invert h2 { color: var(--ink); }
  .section-head-invert::before, .section-head-invert::after { border-top-color: var(--ink); }
}
