@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/fonts/playfair-display-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/fonts/playfair-display-latin-500-normal.woff2') format('woff2');
}

:root {
  --red: #e6392b;
  --ink: #111;
  --paper: #fdfdfb;
  --card-sat: 0;        /* image saturation: 0 = muted, 1 = rich */
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Playfair Display', Georgia, serif;
}
/* full inversion: paper turns ink, ink turns paper, images go rich */
:root[data-theme="dark"] {
  --ink: #f2efe8;
  --paper: #0b0b0c;
  --card-sat: 1;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  cursor: crosshair;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.55s ease, color 0.55s ease;
}

a { color: inherit; }

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.preloader__dots span {
  display: inline-block;
  width: 12px; height: 18px;
  background: var(--red);
  margin: 0 7px;
  animation: dotblink 0.7s infinite alternate;
}
.preloader__dots span:nth-child(2) { animation-delay: 0.18s; }
.preloader__dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotblink { from { opacity: 1; } to { opacity: 0.15; } }

/* ---------- nav: logo first, then the menu ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 44px;
  padding: 26px 40px;
  font-size: 14px; letter-spacing: 0.14em;
}
.nav__logo {
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.55s ease, border-color 0.55s ease;
  white-space: nowrap;
}
.nav__a {
  font-family: var(--serif);
  font-style: italic;
  color: var(--red);
  font-size: 1.15em;
}
.nav__menu {
  display: flex; align-items: center; gap: 28px;
  margin-right: auto;
}
.nav__link {
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.55s ease;
}
.nav__link--active { border-bottom: 2px solid var(--ink); }
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--red);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav__link:hover::after { width: 100%; }
.nav__link--cta { color: var(--red); }
.nav__ask {
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.16em;
  border: 1px dashed var(--ink);
  padding: 8px 14px;
  white-space: nowrap;
  transition: color 0.55s ease, border-color 0.55s ease, background 0.3s ease;
}
.nav__ask:hover { color: var(--red); border-color: var(--red); }

/* ---------- scattered letters ---------- */
.letters { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.letter {
  position: absolute; top: 0; left: 0;
  will-change: transform;
}
.letter__inner {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: var(--red);
  line-height: 0.8;
  display: block;
  will-change: transform;
}
.letter--bit .letter__inner {
  width: 0.55em; height: 1em;
  background: var(--red);
  font-size: inherit;
}
/* the brand's "A-": outlined italic serif, reads apart from the solid word */
.letter--accent .letter__inner {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: transparent;
  -webkit-text-stroke: 2px var(--red);
  line-height: 0.9;
}

/* ---------- decorative ornaments ---------- */
.decorlayer { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.decor {
  position: absolute;
  color: var(--ink);
  opacity: 0.7;
  will-change: transform;
  transition: color 0.55s ease;
}
.decor--red { color: var(--red); opacity: 0.85; }
.decor svg { width: 100%; height: auto; display: block; overflow: visible; }

/* during inversion the ornament layer "catches fire": everything turns red,
   brightens, and the line-art starts flowing along its strokes */
:root[data-theme="dark"] .decor { color: var(--red); opacity: 1; }
:root[data-theme="dark"] .decor path,
:root[data-theme="dark"] .decor rect:not([fill]),
:root[data-theme="dark"] .decor circle {
  stroke-dasharray: 7 5;
  animation: decorflow 0.9s linear infinite;
}
@keyframes decorflow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="dark"] .decor path,
  :root[data-theme="dark"] .decor rect:not([fill]),
  :root[data-theme="dark"] .decor circle { animation: none; }
}

/* ---------- plaque ---------- */
.plaque {
  position: fixed; z-index: 10;
  left: 50%; top: 50%;
  width: 300px; height: 420px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.plaque__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plaque__outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.55s ease;
}
.plaque__handles { position: absolute; inset: 0; }
.handle {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s, background-color 0.55s ease, border-color 0.55s ease;
}
.handle--hollow { background: var(--paper); border: 1px solid var(--ink); }
.plaque__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 26px;
  text-align: center;
}
.plaque__numeral {
  font-family: var(--serif);
  font-size: 110px;
  line-height: 1;
  color: var(--ink);
  -webkit-text-stroke: 1.4px var(--ink);
  -webkit-text-fill-color: transparent;
  transition: color 0.55s ease, -webkit-text-stroke-color 0.55s ease;
}
.plaque__caption {
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

/* ---------- chapters ---------- */
.chapter {
  position: fixed; inset: 0; z-index: 20;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.chapter.is-active { pointer-events: auto; }
.chapter__mono {
  position: absolute; left: 50%;
  transform: translateX(-50%);
  width: min(760px, 84vw);
  text-align: center;
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: 0.1em;
  white-space: pre-wrap;
}
.chapter__mono--top { top: 14vh; }
.chapter__mono--bottom { bottom: 16vh; }

.chapter__quote {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -46%);
  width: min(980px, 90vw);
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.14;
  text-align: center;
}

/* ---------- image cards (saturate on inversion) ---------- */
.chapter__blocks {
  position: absolute; left: 50%; top: 54%;
  transform: translate(-50%, -50%);
  display: flex; gap: 28px; align-items: center;
}
.chapter__blocks--grid { top: 56%; }
.img-card {
  width: 240px; height: 170px;
  position: relative;
  display: flex; align-items: flex-end;
  border: 1px dashed var(--ink);
  filter: grayscale(calc(1 - var(--card-sat))) saturate(calc(0.7 + var(--card-sat) * 0.75)) contrast(1.04);
  transition: filter 0.8s ease, border-color 0.55s ease;
}
.img-card--tall { width: 210px; height: 280px; }
.img-card--wide { width: 330px; height: 200px; }
/* placeholder art — replaced by real imagery later */
.img-card--a { background: linear-gradient(135deg, #2b5aa8 0%, #43b0d5 55%, #e8c15a 100%); }
.img-card--b { background: linear-gradient(120deg, #b33a2e 0%, #e8734a 50%, #f2c14e 100%); }
.img-card--c { background: linear-gradient(150deg, #6a3ab3 0%, #b04ad5 60%, #e85a8a 100%); }
.img-card--d { background: linear-gradient(135deg, #1f7a4d 0%, #4ab58a 55%, #c8e05a 100%); }
.img-card--e { background: linear-gradient(115deg, #a83a2b 0%, #d5814a 50%, #5a9be8 100%); }
.img-card__tag {
  font-size: 12px; letter-spacing: 0.16em;
  padding: 8px 10px;
  color: #fff;
  background: rgba(10, 10, 12, 0.55);
}

/* pricing teaser tiles (chapter VIII) */
.chapter__tiers {
  position: absolute; left: 50%; top: 58%;
  transform: translate(-50%, -50%);
  width: min(980px, 90vw);
  display: flex; justify-content: center; gap: 26px;
}
.tierline {
  flex: 1; max-width: 290px;
  border: 1px dashed var(--ink);
  padding: 30px 24px 26px;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease, background-color 0.55s ease;
}
.tierline:hover { border-color: var(--red); transform: translateY(-4px); }
.tierline--hot { border: 2px solid var(--red); }
.tierline__name { display: block; font-size: 12px; letter-spacing: 0.2em; margin-bottom: 16px; }
.tierline__price {
  display: block;
  font-family: var(--serif);
  font-size: 42px; line-height: 1;
  margin-bottom: 8px;
}
.tierline__per { display: block; font-size: 11px; letter-spacing: 0.12em; opacity: 0.65; }

/* ask-AI line under the contacts */
.chapter__ask {
  position: absolute; left: 50%; bottom: 5.5vh;
  transform: translateX(-50%);
  width: min(760px, 90vw);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.16em;
  opacity: 0.85;
}
.chapter__ask a { color: var(--red); text-underline-offset: 4px; }

/* contacts */
.chapter__contacts {
  position: absolute; left: 50%; bottom: 12vh;
  transform: translateX(-50%);
  width: min(1000px, 88vw);
  display: flex; justify-content: space-between; gap: 60px;
}
.contact { width: 46%; text-align: center; }
.contact__head { font-size: 17px; letter-spacing: 0.12em; margin-bottom: 18px; }
.contact__body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 19px; line-height: 1.45;
}

/* ---------- invert toggle + progress ---------- */
.invert {
  position: fixed; left: 50%; bottom: 22px; z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--ink);
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.18em;
  cursor: pointer; padding: 6px;
  transition: color 0.55s ease;
}
.invert:hover { color: var(--red); }
.invert__dot {
  width: 10px; height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* small hint for AI crawlers, bottom-left */
.aihint {
  position: fixed; left: 26px; bottom: 24px; z-index: 40;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-decoration: none;
  border-bottom: 1px dashed var(--ink);
  padding-bottom: 2px;
  opacity: 0.6;
  transition: color 0.55s ease, opacity 0.3s ease;
}
.aihint:hover { color: var(--red); opacity: 1; }

.progress {
  position: fixed; right: 26px; top: 50%; z-index: 40;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
}
.progress__dot {
  width: 7px; height: 7px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, border-color 0.55s ease;
}
.progress__dot.is-on { background: var(--red); border-color: var(--red); transform: scale(1.35); }

/* ---------- popup ---------- */
.popup {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 7vh;
  pointer-events: none;
}
.popup__box {
  pointer-events: auto;
  position: relative;
  width: min(560px, 92vw);
  border: 1px dashed var(--ink);
  background: var(--paper);
  text-align: center;
  padding: 30px 40px 26px;
  font-size: 16px; line-height: 1.5;
  transition: background-color 0.55s ease, border-color 0.55s ease;
}
.popup__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--ink);
}
.popup__close:hover { color: var(--red); }
.popup__warn { font-family: Helvetica, Arial, sans-serif; font-size: 17px; }
.popup__link {
  display: inline-block;
  margin-top: 14px;
  letter-spacing: 0.12em;
  text-underline-offset: 4px;
}
.popup__link:hover { color: var(--red); }
.popup__divider { border-top: 1px dashed var(--ink); margin: 22px -40px; }
.popup__cookie { font-family: Helvetica, Arial, sans-serif; font-size: 16px; }

/* flash overlay on chapter switch / inversion */
.flash {
  position: fixed; inset: 0; z-index: 60;
  background: var(--red);
  opacity: 0; pointer-events: none;
}
.flash--invert { background: #fff; mix-blend-mode: difference; }

@media (max-width: 960px) {
  .nav { gap: 22px; }
  .nav__menu { gap: 16px; }
  .nav__menu .nav__link[data-goto] { display: none; } /* keep page links, drop chapter jumps */
  .nav__ask { display: none; }
}
@media (max-width: 720px) {
  .nav { padding: 18px 20px; font-size: 13px; }
  .decor { opacity: 0.4; }
  .chapter__ask { display: none; }
  .aihint { display: none; }
  .chapter__tiers { flex-direction: column; gap: 12px; top: 56%; }
  .tierline { max-width: none; padding: 16px; }
  .tierline__price { font-size: 30px; }
  .plaque { width: 220px; height: 320px; }
  .plaque__numeral { font-size: 74px; }
  .plaque__caption { font-size: 20px; }
  .chapter__mono { font-size: 14px; }
  .chapter__blocks { flex-direction: column; gap: 16px; }
  .img-card { width: 200px; height: 130px; }
  .img-card--tall { width: 180px; height: 190px; }
  .img-card--wide { width: 250px; height: 150px; }
  .chapter__contacts { flex-direction: column; gap: 30px; bottom: 9vh; }
  .contact { width: 100%; }
  .progress { right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader__dots span { animation: none; }
}
