:root {
  --ink: #120d08;
  --ink-soft: #3a2e22;
  --paper: #f7f1e4;
  --paper-deep: #efe5d0;
  --gold: #b48a3c;
  --gold-light: #d9b36a;
  --muted: #7a6a58;
  --rule: rgba(180, 138, 60, .35);
  --font-serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --font-sans: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
  --bar-height: 60px;
  --shadow: 0 20px 40px -20px rgba(18, 13, 8, .45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--bar-height);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
}

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

a {
  color: var(--gold);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-height);
  background: var(--ink);
  border-bottom: 1px solid rgba(217, 179, 106, .35);
}

.topbar__inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__brand {
  margin-right: auto;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: #f6ecd6;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  color: #ecd9a8;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 2px;
  transition: background-color .25s ease, color .25s ease;
}

.topbar__link svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.topbar__link:hover,
.topbar__link:focus-visible {
  background: rgba(217, 179, 106, .15);
  color: #fff;
  outline: none;
}

.topbar__link[aria-current="page"],
.topbar__link.is-active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--gold-light);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Chapter links only where there is room; the contents grid covers phones */
@media (max-width: 960px) {
  .topbar__link--chapter {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar__brand {
    font-size: 1.05rem;
  }

  .topbar__link {
    padding: 0 8px;
  }
}

/* ---------- Page & hero ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 16px clamp(3rem, 8vw, 6rem);
}

.page-hero {
  max-width: 820px;
  margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.05;
  color: var(--ink);
}

.page-hero h1 em,
.chapter__title em {
  color: var(--gold);
}

.lead {
  margin: 1.5rem auto 0;
  max-width: 640px;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 300;
  color: var(--ink-soft);
}

.ornament {
  display: block;
  width: 160px;
  height: 1px;
  margin: 2rem auto 0;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

/* ---------- Intro (figure + text) ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.about__figure {
  margin: 0;
}

.about__figure img {
  width: 100%;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.prose p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h3 {
  margin: 0 0 .75rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  color: var(--ink);
}

.prose .big,
p.big {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
}

/* ---------- Contents grid (gallery style) ---------- */

.contents {
  margin: clamp(3.5rem, 8vw, 6rem) 0 0;
}

.contents__title {
  margin: 0 0 1.5rem;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item {
  display: block;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.gallery__thumb {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(217, 179, 106, .35), rgba(180, 138, 60, .15)),
    var(--paper-deep);
  border: 1px solid var(--rule);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.gallery__num {
  position: absolute;
  left: 10px;
  top: 8px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  color: #f6ecd6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .7);
}

.gallery__title {
  display: block;
  margin-top: .6rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
}

.gallery__meta {
  display: block;
  margin-top: .15rem;
  font-size: .95rem;
  line-height: 1.35;
  color: var(--muted);
}

.gallery__item:hover .gallery__thumb,
.gallery__item:focus-visible .gallery__thumb {
  border-color: var(--gold);
  box-shadow: 0 16px 32px -18px rgba(18, 13, 8, .5);
}

.gallery__item:focus-visible {
  outline: none;
}

.gallery__item:hover .gallery__title,
.gallery__item:focus-visible .gallery__title {
  color: var(--gold);
}

.gallery__item:hover .gallery__thumb img,
.gallery__item:focus-visible .gallery__thumb img {
  transform: scale(1.04);
}

/* ---------- Chapters ---------- */

.chapter {
  padding: clamp(3.5rem, 9vw, 7rem) 0 0;
}

.chapter__head {
  max-width: 820px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.chapter__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  line-height: 1.05;
  color: var(--ink);
}

/* Text + picture rows */

.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.75rem, 5vw, 4.5rem);
  align-items: center;
  margin: 0 0 clamp(3rem, 7vw, 5.5rem);
}

.row--flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.row--flip > .prose {
  order: 2;
}

.row--even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.row--top {
  align-items: start;
}

@media (max-width: 820px) {
  .row,
  .row--flip,
  .row--even {
    grid-template-columns: 1fr;
  }

  .row--flip > .prose {
    order: 0;
  }
}

/* Figures */

.fig {
  margin: 0;
}

.fig img {
  width: 100%;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  background: var(--paper-deep);
}

.fig--plain img {
  border: 0;
  box-shadow: none;
  background: none;
}

.fig--narrow {
  max-width: 460px;
  margin-inline: auto;
}

.fig figcaption,
.caption {
  margin-top: .7rem;
  font-size: .92rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
}

.zoom {
  position: relative;
  display: block;
  cursor: zoom-in;
}

.zoom::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6ecd6' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='m15 15 5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 20px no-repeat,
    rgba(18, 13, 8, .62);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .3s ease, transform .3s ease;
}

.zoom:hover::after,
.zoom:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

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

@media (hover: none) {
  .zoom::after {
    opacity: .85;
    transform: scale(1);
  }
}

/* Image groups */

.grid {
  display: grid;
  gap: clamp(12px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grid--center {
  align-items: center;
}

@media (max-width: 820px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .grid--3,
  .grid--2.grid--stack { grid-template-columns: 1fr; }
}

.fig--cover img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* Statement band */

.statement {
  position: relative;
  margin: clamp(3rem, 7vw, 5.5rem) calc(50% - 50vw);
  padding: clamp(3.5rem, 9vw, 7rem) 16px;
  background: var(--ink);
  color: #f6ecd6;
  overflow: hidden;
  isolation: isolate;
}

.statement__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .32;
}

.statement__text {
  max-width: 820px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 300;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .5);
}

.statement__text p {
  margin: 0;
}

.statement__text p + p {
  margin-top: 1rem;
}

.statement__text em {
  color: var(--gold-light);
}

/* Flower motif triptych */

.motifs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 36px);
  margin: 0 0 clamp(3rem, 7vw, 5.5rem);
  padding: 0;
  list-style: none;
}

.motif .fig img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.motif p {
  margin: 1rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  line-height: 1.35;
  color: var(--ink);
}

@media (max-width: 820px) {
  .motifs {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
  }
}

/* Panorama of Prague */

.panorama {
  position: relative;
  margin: 0 calc(50% - 50vw) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
  background: var(--ink);
}

.panorama__img {
  width: 100%;
  height: clamp(320px, 62vh, 620px);
  max-width: none;
  object-fit: cover;
  object-position: 0% 50%;
  filter: sepia(.25) contrast(1.05);
  animation: pan 70s ease-in-out infinite alternate;
}

@keyframes pan {
  from { object-position: 0% 50%; }
  to   { object-position: 100% 50%; }
}

.panorama__card {
  position: absolute;
  right: max(16px, calc(50vw - 600px));
  bottom: clamp(16px, 4vw, 40px);
  max-width: 520px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(247, 241, 228, .94);
  border-left: 2px solid var(--gold);
  box-shadow: var(--shadow);
}

.panorama__credit {
  position: absolute;
  left: max(16px, calc(50vw - 600px));
  top: 14px;
  margin: 0;
  padding: .2rem .6rem;
  font-size: .85rem;
  font-style: italic;
  color: #f6ecd6;
  background: rgba(18, 13, 8, .55);
}

@media (max-width: 820px) {
  .panorama__img {
    height: 300px;
  }

  .panorama__card {
    position: static;
    max-width: none;
    margin: 0;
    box-shadow: none;
  }
}

/* Linen backdrop (the album's own fabric) */

.linen {
  position: relative;
  margin: 0 calc(50% - 50vw) clamp(3rem, 7vw, 5.5rem);
  padding: clamp(3rem, 7vw, 5.5rem) 16px;
  background: url("../images/slides/textura-lneneho-platna.jpg") center / cover;
}

.linen__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: center;
}

.linen .prose {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(247, 241, 228, .94);
  border-left: 2px solid var(--gold);
  box-shadow: var(--shadow);
}

.linen + .linen {
  margin-top: calc(-1 * clamp(3rem, 7vw, 5.5rem));
}

@media (max-width: 820px) {
  .linen__inner {
    grid-template-columns: 1fr;
  }
}

/* Facts */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 1rem;
  background: var(--paper-deep);
  border-left: 2px solid var(--gold);
}

.facts strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
}

.facts span {
  font-size: .95rem;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
  }
}

/* ---------- Quiz: original or copy ---------- */

.quiz {
  margin: 0 0 clamp(3rem, 7vw, 5.5rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
}

.quiz__question {
  margin: 0 0 .4rem;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  color: var(--ink);
}

.quiz__hint {
  margin: 0 0 1.75rem;
  text-align: center;
  color: var(--muted);
}

.quiz__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.5vw, 28px);
}

.quiz__item {
  margin: 0;
}

.quiz__pick {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  background: none;
  cursor: pointer;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.quiz__pick img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.quiz__pick:hover,
.quiz__pick:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 16px 32px -18px rgba(18, 13, 8, .5);
  outline: none;
}

.quiz__letter {
  display: block;
  margin-top: .5rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink);
}

.quiz__answer {
  margin-top: .5rem;
  font-size: .95rem;
  font-style: italic;
  text-align: center;
  color: var(--muted);
}

.js .quiz:not(.is-solved) .quiz__answer,
.js .quiz:not(.is-solved) .quiz__more {
  display: none;
}

.quiz.is-solved .quiz__pick {
  cursor: default;
}

.quiz.is-solved .quiz__item.is-original .quiz__pick {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.quiz__result {
  min-height: 1.6em;
  margin: 1.5rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  text-align: center;
  color: var(--ink);
}

.quiz__more {
  margin-top: 1.25rem;
}

.quiz__more p {
  max-width: 72ch;
  margin: 0 auto 1rem;
}

@media (max-width: 520px) {
  .quiz__pair {
    grid-template-columns: 1fr;
  }
}

/* ---------- Branches: three original drawings ---------- */

.branches {
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
}

.branches .gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .branches .gallery {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-inline: auto;
  }
}

.gallery__item[aria-expanded="true"] .gallery__thumb {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold), 0 16px 32px -18px rgba(18, 13, 8, .5);
}

.gallery__item[aria-expanded="true"] .gallery__title {
  color: var(--gold);
}

.branch {
  margin: 0 0 clamp(3rem, 7vw, 5.5rem);
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.js .branch[hidden] {
  display: none;
}

.branch__head {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  color: var(--ink);
}

.branch__head span {
  color: var(--gold);
}

.branch__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Lens: a magnified crop of the same picture */

.lens {
  position: relative;
}

.lens__ring {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--ring, 16%);
  aspect-ratio: 1;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(18, 13, 8, .35);
  pointer-events: none;
}

.lens__glass {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 42%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #f6ecd6;
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow: 0 18px 40px -12px rgba(18, 13, 8, .65);
  pointer-events: none;
}

/* Centre the point (--x, --y) of the picture, enlarged --z times */
.lens__glass img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--z) * 100%);
  max-width: none;
  border: 0;
  box-shadow: none;
  transform: translate(calc(-1 * var(--x)), calc(-1 * var(--y)));
}

@media (max-width: 520px) {
  .lens__glass {
    right: -6px;
    bottom: -6px;
  }
}

.lens--square .lens__glass {
  border-radius: 2px;
  width: 46%;
  aspect-ratio: 3 / 4;
}

.lens--square .lens__ring {
  border-radius: 2px;
  aspect-ratio: 3 / 4;
}

/* Slow pan over the face, ending on the date */

.pan {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.pan img {
  width: 100%;
  transform-origin: 50% 0;
}

.pan.is-playing img {
  animation: pan-face 14s ease-in-out forwards;
}

@keyframes pan-face {
  0%   { transform: scale(1); transform-origin: 50% 15%; }
  12%  { transform: scale(1.9); transform-origin: 50% 15%; }
  70%  { transform: scale(1.9); transform-origin: 50% 70%; }
  100% { transform: scale(2.4); transform-origin: 50% 98%; }
}

.pan__btn {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
}

.pan.is-playing .pan__btn {
  opacity: 0;
  pointer-events: none;
}

/* Small headgear figures */

.hats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  padding: 0;
  list-style: none;
}

.hats img {
  aspect-ratio: 1;
  object-fit: cover;
}

@media (max-width: 820px) {
  .hats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Buttons ---------- */

.cta,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: .7em 1.4em;
  font: inherit;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .9rem;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}

.cta:hover,
.cta:focus-visible,
.btn:hover,
.btn:focus-visible {
  background: var(--gold);
  outline: none;
}

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--gold);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--paper);
}

/* ---------- VIS / UV comparison ---------- */

.compare {
  margin: 0;
}

.compare__stage {
  --pos: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  background: var(--ink);
  touch-action: pan-y;
  user-select: none;
}

.compare__stage img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  pointer-events: none;
}

.compare__top {
  position: absolute;
  inset: 0;
  height: 100%;
  clip-path: inset(0 0 0 var(--pos));
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #f6ecd6;
  box-shadow: 0 0 8px rgba(0, 0, 0, .5);
  pointer-events: none;
}

.compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  border: 2px solid #f6ecd6;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6ecd6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 7-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 20px no-repeat,
    rgba(18, 13, 8, .55);
  transform: translate(-50%, -50%);
}

.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.compare__range:focus-visible + .compare__handle::after {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(217, 179, 106, .5);
}

.compare__tag {
  position: absolute;
  top: 10px;
  padding: .1rem .5rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f6ecd6;
  background: rgba(18, 13, 8, .6);
  pointer-events: none;
}

.compare__tag--left { left: 10px; }
.compare__tag--right { right: 10px; }

.compare__zoom {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6ecd6' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='m15 15 5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 20px no-repeat,
    rgba(18, 13, 8, .62);
  cursor: zoom-in;
}

.compare__zoom:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* No JS: show both pictures one under another */
html:not(.js) .compare__top {
  position: static;
  clip-path: none;
}

html:not(.js) .compare__handle,
html:not(.js) .compare__range,
html:not(.js) .compare__zoom,
html:not(.js) .compare__tag {
  display: none;
}

/* ---------- Case cards with expandable comment ---------- */

.case {
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
}

.case__title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: var(--ink);
}

.case__layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 8fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
}

.case__locator img {
  width: 100%;
  border: 1px solid var(--rule);
}

@media (max-width: 820px) {
  .case__layout {
    grid-template-columns: 1fr;
  }

  .case__locator {
    max-width: 260px;
  }
}

.note {
  margin-top: 1rem;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

.note summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .7rem 1rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.note summary::-webkit-details-marker {
  display: none;
}

.note summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: var(--gold);
  transition: transform .3s ease;
}

.note[open] summary::before {
  transform: rotate(45deg);
}

.note summary:hover,
.note summary:focus-visible {
  color: var(--gold);
  outline: none;
}

.note p {
  margin: 0;
  padding: 0 1rem 1rem 3.1rem;
}

/* ---------- Lab photos ---------- */

.lab {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

@media (max-width: 640px) {
  .lab {
    grid-template-columns: 1fr 1fr;
  }

  .lab li:last-child {
    grid-column: 1 / -1;
  }

  .lab li:last-child img {
    aspect-ratio: 4 / 3;
  }
}

.spec {
  margin: 1rem 0 0;
  border-collapse: collapse;
  font-size: .95rem;
}

.spec th,
.spec td {
  padding: .35rem .9rem .35rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.spec th {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Call to action band ---------- */

.ask {
  margin: clamp(3rem, 7vw, 5.5rem) calc(50% - 50vw) 0;
  padding: clamp(3.5rem, 8vw, 6rem) 16px;
  background: var(--ink);
  color: #f6ecd6;
}

.ask__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.ask h2 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.1;
}

.ask h2 em {
  color: var(--gold-light);
}

.ask p {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.ask .cta {
  margin-top: .5rem;
  color: var(--ink);
  background: var(--gold-light);
}

.ask .cta:hover,
.ask .cta:focus-visible {
  background: #f6ecd6;
}

.ask__mail {
  word-break: break-all;
}

.ask img {
  width: 100%;
  border: 1px solid rgba(217, 179, 106, .35);
}

.ask__note {
  margin-top: 1.5rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(217, 179, 106, .35);
  font-family: var(--font-serif);
  font-size: 1.35rem !important;
  font-style: italic;
  color: var(--gold-light);
}

@media (max-width: 820px) {
  .ask__inner {
    grid-template-columns: 1fr;
  }
}

/* ---------- Colophon ---------- */

.colophon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-top: clamp(3rem, 7vw, 5rem);
}

.colophon h2 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  color: var(--ink);
}

.colophon h3 {
  margin: 1.25rem 0 .25rem;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

.colophon ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.colophon p,
.colophon li {
  font-size: 1rem;
}

.colophon .refs li {
  margin-bottom: .6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}

@media (max-width: 820px) {
  .colophon {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */

.footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
  padding: 1.5rem 16px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.footer__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px clamp(28px, 5vw, 64px);
  max-width: 1000px;
  margin: 1rem auto 1.75rem;
  padding: 0;
  list-style: none;
}

.footer__logos img {
  height: 44px;
  width: auto;
}

@media (max-width: 520px) {
  .footer__logos img {
    height: 36px;
  }
}

/* ---------- Gallery page filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

.filters button {
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .45em 1.1em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.filters button:hover,
.filters button:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.filters button[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.gallery__item[hidden] {
  display: none;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(18, 13, 8, .96);
  color: #f6ecd6;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease, visibility 0s;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 10px;
}

.lightbox__count {
  margin-right: auto;
  padding-left: 8px;
  font-size: .9rem;
  letter-spacing: .1em;
  color: #ecd9a8;
}

.lightbox__btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  color: #ecd9a8;
  background: transparent;
  cursor: pointer;
}

.lightbox__btn svg {
  width: 22px;
  height: 22px;
}

.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  color: #fff;
  background: rgba(217, 179, 106, .15);
  outline: none;
}

.lightbox__stage {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.lightbox__stage.is-dragging {
  cursor: grabbing;
}

.lightbox__img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 16px);
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 64px;
  margin-top: -32px;
  background: rgba(18, 13, 8, .5);
}

.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }

.lightbox__caption {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 16px 18px;
  font-size: .95rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  color: #ecd9a8;
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1s ease;
}

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .panorama__img,
  .pan.is-playing img {
    animation: none;
  }
}

/* Gallery tiles carry their own hover state, no zoom badge */
.gallery__item.zoom::after {
  display: none;
}

.site {
  outline: none;
}

.lens + figcaption {
  margin-top: 1.75rem;
}

@media (max-width: 820px) {
  .about {
    grid-template-columns: 1fr;
  }
}

/* Two-line logo needs more height to match the others */
.footer__logos .footer__logo--tall {
  height: 64px;
}

@media (max-width: 520px) {
  .footer__logos .footer__logo--tall {
    height: 52px;
  }
}

/* Project note spans both colophon columns */
.colophon__intro {
  grid-column: 1 / -1;
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

.colophon__intro p {
  max-width: 72ch;
  margin: 0;
}

/* Columns sized by each picture's width/height ratio (--cols), so the pictures share one height */
.grid--match {
  grid-template-columns: var(--cols);
  align-items: start;
}

/* ---------- Trace: where on the cover → under the microscope ---------- */

.trace {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1rem;
}

.trace__where {
  width: min(100%, 340px);
  margin: 0;
}

.trace__where figcaption {
  text-align: center;
}

.spot-wrap {
  position: relative;
}

.spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--ring);
  aspect-ratio: 1;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(18, 13, 8, .45), 0 0 14px 2px rgba(217, 179, 106, .55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: spot-pulse 2.4s ease-in-out infinite;
}

@keyframes spot-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.3); }
}

.trace__arrow {
  display: block;
  width: 44px;
  margin: .75rem 0 .25rem;
  color: var(--gold);
  transform: rotate(90deg);
}

.trace__arrow svg {
  display: block;
  width: 100%;
}

/* Small gold ring ties captions to the marked spot */
.caption--spot::before {
  content: "";
  display: inline-block;
  width: .85em;
  height: .85em;
  margin-right: .45em;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  vertical-align: -.1em;
}

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