@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400i.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --oranssi: #E67A1D;
  --petrooli: #437377;
  --turkoosi: #2E9496;
  --musta: #101010;
  --kalkki: #F4F1EA;
  --kirkonkivi: #8E8981;
  --yo: #1F3550;
  --serif: "Instrument Serif", Georgia, serif;
  --text: "Literata", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--kalkki);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--kalkki);
  color: var(--musta);
  font-family: var(--text);
  font-size: clamp(1rem, 0.95rem + 0.22vw, 1.14rem);
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:focus-visible { outline: 3px solid var(--oranssi); outline-offset: 4px; }

.cover {
  position: relative;
  min-height: max(100vh, 100svh);
  overflow: hidden;
  isolation: isolate;
  color: var(--kalkki);
  background: var(--yo);
}

.cover__image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  animation: cover-drift 20s ease-in-out infinite alternate;
}

.cover__scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg, rgba(31, 53, 80, 0.35) 0%, rgba(31, 53, 80, 0.22) 36%, rgba(31, 53, 80, 0) 72%);
}

.cover__content {
  width: min(72rem, calc(100% - 3rem));
  margin: 0 auto;
  padding-top: clamp(5rem, 13vh, 8rem);
}

.cover h1 {
  max-width: 11ch;
  margin: 0.12em 0 0;
  font: 400 clamp(4rem, 9.4vw, 9.25rem) / 0.83 var(--serif);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.cover__subtitle {
  max-width: 37rem;
  margin: 1.75rem 0 0;
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  line-height: 1.6;
  text-shadow: 0 1px 12px rgba(16, 16, 16, 0.35);
}

.cover__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}

.cover__scroll span { font-size: 1.15rem; }

.eyebrow {
  margin: 0;
  color: var(--petrooli);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow--light { color: var(--kalkki); }

.chapter {
  width: min(72rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(6rem, 11vw, 10rem) 0;
}

.chapter__head {
  position: relative;
  border-top: 1px solid rgba(142, 137, 129, 0.75);
  padding-top: 1.35rem;
}

.chapter__head h2 {
  position: relative;
  z-index: 1;
  max-width: 14ch;
  margin: 1.25rem 0 0;
  color: var(--petrooli);
  font: 400 clamp(3rem, 7.2vw, 6.75rem) / 0.92 var(--serif);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.chapter__number {
  position: absolute;
  top: 0.1rem;
  right: 0;
  color: rgba(230, 122, 29, 0.12);
  font: 400 clamp(7rem, 16vw, 14rem) / 0.8 var(--serif);
  pointer-events: none;
  user-select: none;
}

.prose {
  --prose-indent: clamp(0rem, 8vw, 8rem);
  width: min(44rem, calc(100% - var(--prose-indent)));
  margin: clamp(2.5rem, 5vw, 4rem) 0 0 var(--prose-indent);
}

.prose p { margin: 0 0 1.35em; }

.plate {
  width: 100%;
  margin: clamp(3.5rem, 7vw, 6rem) auto 0;
}

.plate__mat {
  overflow: hidden;
  border: 1px solid var(--oranssi);
  padding: clamp(0.875rem, 1.3vw, 1.125rem);
  background: var(--kalkki);
  box-shadow: 0 24px 60px rgba(16, 16, 16, 0.1);
}

.plate__mat > img { width: 100%; height: auto; }

.plate figcaption {
  margin: 0.8rem 0 0;
  color: rgba(16, 16, 16, 0.72);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.55;
}

.plate--landscape { width: min(56rem, 100%); }
.plate--square { width: min(30rem, 100%); }
.plate--portrait { width: min(32rem, 100%); }
.plate--spot { width: min(25rem, 82%); }

.plate__crop img {
  aspect-ratio: 2.3 / 1;
  object-fit: cover;
  object-position: center 40%;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: stretch;
}

.comparison__item {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 19rem;
  background: #ebe7df;
}

.comparison__item--old { background: var(--petrooli); }
.comparison__item img { width: 100%; height: 100%; object-fit: contain; padding: 1.25rem; }
.comparison__item span {
  padding: 0.65rem 1rem;
  color: var(--musta);
  background: var(--kalkki);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: clamp(3rem, 6vw, 5rem);
}

.swatch__color {
  position: relative;
  min-height: 15rem;
  border: 1px solid transparent;
  background: var(--swatch);
}

.swatch__color--light { border-color: rgba(142, 137, 129, 0.55); }
.swatch__color span {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.12rem 0.35rem;
  color: var(--kalkki);
  background: var(--musta);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.swatch p { margin: 0.65rem 0 0; font-size: 0.74rem; line-height: 1.5; }
.swatch code { font: inherit; color: rgba(16, 16, 16, 0.72); }
.palette-note { max-width: 56rem; margin: 3.5rem auto 0; font-size: 0.92rem; }

.type-specimens { display: grid; gap: 1rem; margin-top: clamp(3rem, 6vw, 5rem); }
.type-card {
  border: 1px solid rgba(142, 137, 129, 0.55);
  padding: clamp(1.25rem, 3.5vw, 3rem);
  background: rgba(255, 255, 255, 0.2);
}
.type-card span { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.type-card p { margin: 0.5rem 0 0; line-height: 1.12; }
.type-card--display p { font: 400 clamp(3rem, 7vw, 6rem) / 1 var(--serif); }
.type-card--literata p { font: 400 clamp(1.5rem, 3vw, 2.5rem) / 1.35 var(--text); }
.type-card--ui p { font-size: clamp(0.85rem, 1.3vw, 1.05rem); font-weight: 600; letter-spacing: 0.14em; }

.voice-pairs { margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid rgba(142, 137, 129, 0.55); }
.voice-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  border-bottom: 1px solid rgba(142, 137, 129, 0.55);
  padding: 2rem 0;
}
.voice-pair p { margin: 0; }
.voice-pair s { color: rgba(16, 16, 16, 0.48); text-decoration-thickness: 1px; }

.chapter--wide { width: 100%; }
.chapter__inner { width: min(72rem, calc(100% - 3rem)); margin: 0 auto; }
.plate--full { width: min(88rem, calc(100% - 3rem)); }

.quiet-link { margin-top: 1.4rem; text-align: center; font-size: 0.8rem; }
.quiet-link a { color: var(--petrooli); }

.object-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.object-grid .plate { margin-top: clamp(3rem, 6vw, 5rem); }
.object-grid--last { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.object-grid--last .plate { grid-column: 1; }

.closing {
  width: 100%;
  padding: clamp(6rem, 12vw, 11rem) 1.5rem 2rem;
  color: var(--kalkki);
  background: var(--yo);
}
.closing__inner { width: min(72rem, 100%); margin: 0 auto; }
.chapter__head--dark { border-top-color: rgba(244, 241, 234, 0.38); }
.chapter__head--dark h2 { color: var(--kalkki); }
.prose--light { color: var(--kalkki); }
.closing__mark {
  width: 8rem;
  margin: 4rem 0 5rem;
  border: 1px solid var(--oranssi);
  padding: 0.75rem;
  background: var(--kalkki);
  box-shadow: 0 24px 60px rgba(16, 16, 16, 0.18);
}
.closing__mark img { width: 100%; }
.closing__credit {
  margin: 0;
  border-top: 1px solid rgba(244, 241, 234, 0.25);
  padding-top: 1.4rem;
  color: rgba(244, 241, 234, 0.8);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.has-motion .reveal { opacity: 0; transform: translateY(12px); transition: opacity 250ms ease, transform 250ms ease; }
.has-motion .reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes cover-drift {
  from { transform: scale(1.01); }
  to { transform: scale(1.055) translate3d(-0.6%, -0.35%, 0); }
}

@media (max-width: 900px) {
  .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .swatch__color { min-height: 11rem; }
}

@media (max-width: 680px) {
  body { line-height: 1.7; }
  .cover__content, .chapter, .chapter__inner { width: calc(100% - 2rem); }
  .cover__content { padding-top: 5rem; }
  .cover h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
  .cover__subtitle { max-width: 24rem; }
  .chapter { padding: 5.5rem 0; }
  .chapter__head h2 { font-size: clamp(2.75rem, 14vw, 4.5rem); }
  .prose { width: 100%; margin-left: 0; }
  .comparison { grid-template-columns: 1fr; }
  .comparison__item { min-height: 13rem; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatch__color { min-height: 9rem; }
  .voice-pair { grid-template-columns: 1fr; gap: 1rem; }
  .object-grid, .object-grid--last { grid-template-columns: 1fr; }
  .object-grid--last .plate { grid-column: auto; }
  .plate--full { width: calc(100% - 2rem); }
  .plate--spot { width: min(25rem, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover__image { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
