/* =========================================================
   THE PALACE OF AGES — Architectural project book
   ========================================================= */

:root {
  /* Palette — neutral whites & greys with warm accents */
  --paper: #f4f4f2;
  /* page background */
  --paper-soft: #ffffff;
  /* lightest surface */
  --paper-deep: #e8e7e3;
  /* deeper neutral surface */
  --ink: #161614;
  /* near-black */
  --ink-soft: #3a3a37;
  --ink-faint: #8a8a85;
  --line: #d8d7d2;
  --line-soft: #ececea;
  --rust: #b88727;
  /* primary accent — deeper mustard (text-safe) */
  --rust-deep: #6b3a1f;
  --ochre: #d4a23d;
  /* secondary accent — bright mustard (blocks) */
  --ochre-deep: #b88727;
  --terra: #6b3a1f;
  /* accent — brown */
  --concrete: #c9c9c4;

  /* Type — display: Bricolage Grotesque, body: Plus Jakarta Sans, mono: IBM Plex Mono */
  --serif: "Bricolage Grotesque", "Söhne", system-ui, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --container: 1280px;
  --pad: clamp(20px, 4vw, 64px);
  --section-pad: clamp(72px, 10vw, 144px);
  --header-h: 76px;
  --mobile-nav-h: 72px;
}

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

/* Skip-to-content — keyboard accessibility */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  z-index: 9999;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-to-content:focus {
  top: 8px;
}

/* Focus ring — keyboard navigation */
:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
  border-radius: 2px;
}

html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  position: relative;
}

/* Subtle warm wash — barely perceptible */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 85% 12%, rgba(212, 162, 61, 0.035) 0%, transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(194, 90, 54, 0.03) 0%, transparent 45%);
}

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

a {
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: color .3s ease;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* ───────────────────────── BLUEPRINT GRID BACKGROUND ───────────────────────── */
.blueprint-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(to right, rgba(22, 22, 20, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 22, 20, 0.045) 1px, transparent 1px);
  background-size: 80px 80px;
}

.blueprint-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(22, 22, 20, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 22, 20, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ───────────────────────── HEADER ───────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  background: rgba(244, 244, 242, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s ease, background .4s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(22, 22, 20, 0.08);
}

.header-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.015em;
  font-weight: 500;
  line-height: 1;
}

.logo-mark {
  width: 28px;
  height: 28px;
  position: relative;
  margin-top: -7px;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.nav {
  display: flex;
  gap: 36px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.nav a {
  padding: 6px 0;
  position: relative;
  text-transform: uppercase;
  font-weight: 500;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.7, 0, .2, 1);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  overflow: hidden;
  position: relative;
  background: transparent;
  transition: color .35s ease, border-color .35s ease;
}

.header-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .45s cubic-bezier(.7, 0, .2, 1);
  z-index: -1;
}

.header-cta:hover {
  color: var(--paper);
  border-color: var(--ink);
}

.header-cta:hover::before {
  transform: translateY(0);
}

.header-cta .arrow {
  transition: transform .35s ease;
}

.header-cta:hover .arrow {
  transform: translateX(3px);
}


/* ───────────────────────── BOTTOM MOBILE NAV ───────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(26, 22, 18, 0.96);
  color: var(--paper);
  border-radius: 999px;
  padding: 8px;
  gap: 4px;
  box-shadow: 0 18px 40px rgba(26, 22, 18, 0.22), 0 2px 6px rgba(26, 22, 18, 0.18);
  backdrop-filter: blur(20px);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  border-radius: 999px;
  transition: opacity .25s ease, background .35s ease, color .35s ease;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

.mobile-nav-item.active {
  background: var(--rust);
  color: var(--paper);
  opacity: 1;
}

.mobile-nav-item:not(.active):active {
  opacity: 1;
}

/* ───────────────────────── SECTIONS ───────────────────────── */
.section {
  position: relative;
  z-index: 2;
  padding: var(--section-pad) var(--pad);
}

.section:not(.hero) {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}

/* Section label / eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--rust);
  border-radius: 50%;
}

.eyebrow .num {
  color: var(--rust);
  font-weight: 600;
}

/* ───────────────────────── HERO ───────────────────────── */
.hero {
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: clamp(80px, 10vw, 140px);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.hero-meta .line {
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--ink-soft);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 7.5vw, 124px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 28px;
  font-variation-settings: "opsz" 96;
}

.hero-title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.hero-title .word>span {
  display: inline-block;
  transform: translateY(110%);
  animation: word-rise 1.1s cubic-bezier(.2, .7, .2, 1) forwards;
}

.hero-title .word:nth-child(1)>span {
  animation-delay: .15s;
}

.hero-title .word:nth-child(2)>span {
  animation-delay: .25s;
}

.hero-title .word:nth-child(3)>span {
  animation-delay: .35s;
}

.hero-title .word:nth-child(4)>span {
  animation-delay: .45s;
}

@keyframes word-rise {
  to {
    transform: translateY(0);
  }
}

.hero-title .ages {
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
  position: relative;
  font-variation-settings: "opsz" 96;
}

.hero-title .ages::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 4px;
  background: var(--ochre);
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-grow 1.2s cubic-bezier(.7, 0, .2, 1) .8s forwards;
}

@keyframes underline-grow {
  to {
    transform: scaleX(1);
  }
}

.hero-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--ink-soft);
  margin-bottom: 28px;
  opacity: 0;
  animation: fade-up .8s ease .7s forwards;
  letter-spacing: -0.01em;
}

.hero-text {
  max-width: 480px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 36px;
  opacity: 0;
  animation: fade-up .8s ease .85s forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 460px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade-up .8s ease 1s forwards;
}

.credit-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.credit-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Hero CTAs */
.hero-actions {
  display: flex;
  gap: 16px;
  margin: 0 0 36px 0;
  opacity: 0;
  animation: fade-up .8s ease .95s forwards;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
  transition: color .35s ease, transform .35s ease;
  z-index: 1;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .45s cubic-bezier(.7, 0, .2, 1);
  z-index: -1;
}

.btn:hover::before {
  transform: translateY(0);
}

.btn:hover {
  color: var(--paper);
}

.btn.primary {
  background: var(--ink);
  color: var(--paper);
}

.btn.primary::before {
  background: var(--rust);
}

.btn.primary:hover {
  color: var(--paper);
}

.btn .arrow {
  transition: transform .35s ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

/* Hero book stage */
.hero-stage {
  position: relative;
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-book {
  width: 78%;
  filter: drop-shadow(0 40px 60px rgba(26, 22, 18, 0.28)) drop-shadow(0 12px 20px rgba(26, 22, 18, 0.18));
  transform: translateY(40px) rotate(-3deg);
  opacity: 0;
  animation: book-enter 1.4s cubic-bezier(.2, .7, .2, 1) .4s forwards;
  position: relative;
  z-index: 3;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
  object-fit: contain;
}

.hero-stage:hover .hero-book {
  transform: translateY(0) rotate(-5deg) scale(1.02);
}

@keyframes book-enter {
  from {
    opacity: 0;
    transform: translateY(40px) rotate(-3deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(-3deg);
  }
}

/* Decorative SVG layers around hero stage */
.hero-deco {
  position: absolute;
  inset: -8%;
  z-index: 1;
  pointer-events: none;
}

.hero-deco svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Hero scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  opacity: 0;
  animation: fade-up .8s ease 1.4s forwards;
}

.scroll-indicator .bar {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--ink-soft), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-indicator .bar::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--rust);
  animation: scroll-drip 2.4s ease-in-out infinite;
}

@keyframes scroll-drip {
  0% {
    top: -50%;
  }

  100% {
    top: 100%;
  }
}

/* ───────────────────────── ARCHITECT SECTION ───────────────────────── */
.architect {
  background: var(--paper-soft);
  position: relative;
}

.architect-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 72px;
  align-items: center;
}

.architect-image-wrap {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}

.architect-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
}

.architect-image-wrap:hover img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.08);
}

.architect-image-wrap::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid var(--ink);
  pointer-events: none;
  transform: translate(16px, 16px);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  z-index: 1;
}

.architect-image-wrap:hover::before {
  transform: translate(8px, 8px);
}

.architect-image-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--paper-soft);
  padding: 14px 18px 4px 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  z-index: 2;
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  font-variation-settings: "opsz" 72;
}

.section-title .accent {
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}

.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 24px;
  max-width: 560px;
}

.body-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 540px;
  margin-bottom: 20px;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--rust);
}

.spec-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

/* ───────────────────────── PROJECT (the architectural work) ───────────────────────── */
.project {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.project .eyebrow {
  color: var(--concrete);
}

.project .eyebrow .dot {
  background: var(--ochre);
}

.project .eyebrow .num {
  color: var(--ochre);
}

.project .section-title {
  color: var(--paper);
}

.project .section-title .accent {
  color: var(--ochre);
}

.project .body-text {
  color: rgba(245, 238, 220, 0.7);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 80px;
  align-items: center;
}

.project-text {
  padding-right: 24px;
}

.project-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-stat {
  border-top: 1px solid rgba(245, 238, 220, 0.18);
  padding-top: 16px;
}

.project-stat .v {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  color: var(--ochre);
  line-height: 1;
  letter-spacing: -0.025em;
}

.project-stat .k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(245, 238, 220, 0.55);
  margin-top: 6px;
}

/* Architectural isometric build animation */
.project-visual {
  position: relative;
  aspect-ratio: 1/1.1;
}

.project-visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ───────────────────────── BOOK PREVIEW ───────────────────────── */
.preview {
  background: var(--paper);
  position: relative;
}

.preview-stage {
  position: relative;
  margin-top: 64px;
  border-radius: 4px;
  overflow: visible;
}

.preview-stage img {
  width: 100%;
  filter: drop-shadow(0 30px 50px rgba(26, 22, 18, 0.22));
  transform: scale(0.96);
  transition: transform 1.4s cubic-bezier(.2, .7, .2, 1);
  margin-inline: auto;
}

.preview-stage.in img {
  transform: scale(1);
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  justify-content: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-soft);
  transition: border-color .3s ease, color .3s ease, transform .3s ease;
}

.tag:hover {
  border-color: var(--rust);
  color: var(--rust);
  transform: translateY(-2px);
}

.tag .num {
  color: var(--rust);
  font-weight: 600;
}

.preview-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: end;
}

.preview-header .right {
  padding-bottom: 8px;
}

/* ───────────────────────── TESTIMONIALS ───────────────────────── */
.testimonials {
  background: var(--paper-soft);
  position: relative;
  overflow: hidden;
}

.testimonials-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 56px;
  gap: 32px;
  flex-wrap: wrap;
}

.testimonials-header p {
  max-width: 380px;
}

.testimonials-track-wrap {
  position: relative;
  margin: 0 calc(var(--pad) * -1);
  padding: 0 var(--pad);
}

.testimonials-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.testimonial {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease, border-color .5s ease;
  position: relative;
}

.testimonial:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 50px -20px rgba(26, 22, 18, 0.18);
  border-color: var(--rust);
}

.testimonial .quote-mark {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 0.5;
  color: var(--rust);
  height: 18px;
}

.testimonial .quote {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.testimonial .who {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--rust);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 16px;
  flex-shrink: 0;
}

.who .name {
  font-size: 14px;
  font-weight: 500;
}

.who .role {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.slider-controls {
  display: none;
  margin-top: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot-btn {
  width: 8px;
  height: 8px;
  background: var(--line);
  border-radius: 50%;
  transition: background .3s ease, width .3s ease;
  padding: 0;
}

.dot-btn.active {
  background: var(--rust);
  width: 24px;
  border-radius: 999px;
}

.arrows {
  display: flex;
  gap: 10px;
}

.arrow-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s ease, color .3s ease;
}

.arrow-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ───────────────────────── BUY ───────────────────────── */
.buy {
  background: var(--paper);
  position: relative;
}

.buy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}

.edition {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color .4s ease, transform .4s ease;
  overflow: hidden;
}

.edition::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.7, 0, .2, 1);
}

.edition:hover::before {
  transform: scaleX(1);
}

.edition:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
}

.edition.featured {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.edition.featured::before {
  background: var(--ochre);
  transform: scaleX(1);
}

.edition-tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.edition.featured .edition-tag {
  color: var(--ochre);
}

.edition-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.edition-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.edition.featured .edition-desc {
  color: rgba(245, 238, 220, 0.65);
}

.edition-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

.edition.featured .edition-specs {
  border-color: rgba(245, 238, 220, 0.18);
  color: rgba(245, 238, 220, 0.75);
}

.edition-spec {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edition-spec svg {
  width: 14px;
  height: 14px;
  color: var(--rust);
  flex-shrink: 0;
}

.edition.featured .edition-spec svg {
  color: var(--ochre);
}

.edition-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.edition-price .v {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.edition-price .c {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.edition.featured .edition-price .c {
  color: rgba(245, 238, 220, 0.6);
}

.edition .btn {
  width: 100%;
  justify-content: center;
}

.edition.featured .btn {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.edition.featured .btn::before {
  background: var(--ochre);
}

.edition.featured .btn:hover {
  color: var(--ink);
}

/* ───────────────────────── WRITER ───────────────────────── */
.writer {
  background: var(--paper-soft);
  position: relative;
}

.writer-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 72px;
  align-items: center;
}

.writer-image-wrap {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  order: 2;
}

.writer-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
}

.writer-image-wrap:hover img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.08);
}

.writer-image-wrap::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid var(--ink);
  pointer-events: none;
  transform: translate(-16px, 16px);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  z-index: 1;
}

.writer-image-wrap:hover::before {
  transform: translate(-8px, 8px);
}

.signature {
  margin-top: 32px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.signature svg {
  display: block;
  height: 56px;
  margin-top: 8px;
  color: var(--rust);
}

/* ───────────────────────── FOOTER ───────────────────────── */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px var(--pad) 32px;
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(245, 238, 220, 0.12);
}

.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ochre);
  margin-bottom: 18px;
  font-weight: 500;
}

.footer .brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  margin-bottom: 16px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.footer .brand-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 238, 220, 0.55);
  margin-bottom: 24px;
}

.footer p,
.footer a,
.footer li {
  color: rgba(245, 238, 220, 0.7);
  font-size: 14px;
  line-height: 1.7;
  list-style: none;
}

.footer ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer a:hover {
  color: var(--ochre);
}

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 238, 220, 0.5);
}

.czechthis {
  color: var(--ochre);
  font-weight: 500;
}

.czechthis a:hover {
  color: var(--paper);
}

/* ───────────────────────── REVEAL ANIMATIONS ───────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal.d1 {
  transition-delay: .08s;
}

.reveal.d2 {
  transition-delay: .16s;
}

.reveal.d3 {
  transition-delay: .24s;
}

.reveal.d4 {
  transition-delay: .32s;
}

.reveal.d5 {
  transition-delay: .40s;
}

/* Title splits character by character */
.split-line {
  overflow: hidden;
  display: block;
}

.split-line>span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(.2, .7, .2, 1);
}

.split-line.in>span {
  transform: translateY(0);
}

/* SVG drawing animations */
.draw-path {
  stroke-dasharray: var(--dash, 1000);
  stroke-dashoffset: var(--dash, 1000);
  transition: stroke-dashoffset 2s cubic-bezier(.5, 0, .2, 1);
}

.in-view .draw-path,
.draw-path.in {
  stroke-dashoffset: 0;
}

.fade-in-svg {
  opacity: 0;
  transition: opacity 1.2s ease;
  transition-delay: var(--delay, 0s);
}

.in-view .fade-in-svg,
.fade-in-svg.in {
  opacity: var(--target-opacity, 1);
}

/* Floating architectural ornament */
.float-y {
  animation: float-y 6s ease-in-out infinite;
}

@keyframes float-y {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* ───────────────────────── HERO CONTINUOUS MOTION ───────────────────────── */
@keyframes hero-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

@keyframes hero-pulse-soft {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes hero-float-y {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-18px);
  }
}

@keyframes hero-float-y-rev {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(14px);
  }
}

@keyframes hero-drift-xy {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(10px, -12px);
  }

  50% {
    transform: translate(-6px, -20px);
  }

  75% {
    transform: translate(-14px, -4px);
  }
}

@keyframes hero-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes hero-tilt {

  0%,
  100% {
    transform: rotate(-3deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes hero-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes hero-walk-figure {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(140px);
  }
}

@keyframes hero-dash-flow {
  to {
    stroke-dashoffset: -40;
  }
}

/* Single rule for all hero animations — origin from each element's own center */
.anim-pulse,
.anim-pulse-soft,
.anim-float-y,
.anim-float-yr,
.anim-drift,
.anim-spin,
.anim-spin-fast,
.anim-tilt,
.anim-bob,
.anim-walk {
  transform-box: fill-box;
  transform-origin: center;
}

.anim-pulse {
  animation: hero-pulse 6s ease-in-out infinite;
}

.anim-pulse-soft {
  animation: hero-pulse-soft 4.5s ease-in-out infinite;
}

.anim-float-y {
  animation: hero-float-y 8s ease-in-out infinite;
}

.anim-float-yr {
  animation: hero-float-y-rev 11s ease-in-out infinite;
}

.anim-drift {
  animation: hero-drift-xy 14s ease-in-out infinite;
}

.anim-spin {
  animation: hero-spin 60s linear infinite;
}

.anim-spin-fast {
  animation: hero-spin 24s linear infinite;
}

.anim-tilt {
  animation: hero-tilt 6s ease-in-out infinite;
}

.anim-bob {
  animation: hero-bob 2.4s ease-in-out infinite;
}

.anim-walk {
  animation: hero-walk-figure 14s linear infinite;
}

/* Dimension line dash flow */
.anim-dash-flow {
  stroke-dasharray: 6 4;
  animation: hero-dash-flow 1.8s linear infinite;
}

/* Honour reduced motion */
@media (prefers-reduced-motion: reduce) {

  .anim-pulse,
  .anim-pulse-soft,
  .anim-float-y,
  .anim-float-yr,
  .anim-drift,
  .anim-spin,
  .anim-spin-fast,
  .anim-tilt,
  .anim-bob,
  .anim-walk,
  .anim-dash-flow,
  .float-y,
  .orn-tilt,
  .orn-tilt-rev,
  .orn-float-x,
  .orn-float-y,
  .orn-orbit,
  .orn-bob,
  .orn-sway,
  .orn-drift {
    animation: none !important;
  }

  .trace-path,
  .draw-path {
    animation: none !important;
  }
  /* .scroll-line reduced-motion handled in JS */
}

/* ───────────────────────── PER-SECTION ORNAMENTS ───────────────────────── */
.section-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.section-deco>svg {
  position: absolute;
  overflow: visible;
}

/* Default ornament look — quiet ink on light bg */
.ornament {
  color: var(--ink);
  opacity: 0.16;
}

.section.project .ornament {
  color: var(--paper);
  opacity: 0.22;
}

/* Yellow / brown variants */
.ornament.warm {
  color: var(--ochre);
  opacity: 0.42;
}

.ornament.brown {
  color: var(--terra);
  opacity: 0.36;
}

/* Scroll-driven drawing — modern browsers via view() timeline,
   gracefully falls back to IntersectionObserver-triggered class .in */
.trace-path {
  fill: none;
  stroke-dasharray: var(--dash, 1000);
  stroke-dashoffset: var(--dash, 1000);
  transition: stroke-dashoffset 2.4s cubic-bezier(.4, 0, .2, 1);
}

.in-view .trace-path,
.trace-path.in {
  stroke-dashoffset: 0;
}

/* scroll-line — JS controls everything, CSS only sets fill */
.scroll-line {
  fill: none;
}

/* trace-path — CSS scroll-driven animation in supporting browsers */
@supports (animation-timeline: view()) {
  .trace-path {
    transition: none;
    animation: trace-draw linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 75%;
  }
}

@keyframes trace-draw {
  from { stroke-dashoffset: var(--dash, 1000); }
  to   { stroke-dashoffset: 0; }
}

/* Continuous ornament motion */
@keyframes orn-tilt {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

@keyframes orn-tilt-rev {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-4deg);
  }
}

@keyframes orn-sway {

  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(3deg);
  }
}

@keyframes orn-float-x {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(12px);
  }
}

@keyframes orn-float-y {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(14px);
  }
}

@keyframes orn-drift {

  0%,
  100% {
    transform: translate(0, 0);
  }

  33% {
    transform: translate(8px, -10px);
  }

  66% {
    transform: translate(-10px, 6px);
  }
}

@keyframes orn-orbit {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes orn-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.orn-tilt {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-tilt 9s ease-in-out infinite;
}

.orn-tilt-rev {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-tilt-rev 11s ease-in-out infinite;
}

.orn-sway {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-sway 7s ease-in-out infinite;
}

.orn-float-x {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-float-x 13s ease-in-out infinite;
}

.orn-float-y {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-float-y 10s ease-in-out infinite;
}

.orn-drift {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-drift 16s ease-in-out infinite;
}

.orn-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-orbit 80s linear infinite;
}

.orn-bob {
  transform-box: fill-box;
  transform-origin: center;
  animation: orn-bob 4.5s ease-in-out infinite;
}

/* ───────────────────────── RESPONSIVE ───────────────────────── */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-stage {
    aspect-ratio: 1/1;
    max-width: 420px;
    margin: 0 auto;
  }

  .architect-grid,
  .project-grid,
  .writer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .writer-image-wrap {
    order: -1;
  }

  .preview-header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .buy-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .nav {
    display: none;
  }

  .header {
    padding: 0 20px;
  }

  .header-cta {
    padding: 8px 14px;
    font-size: 12px;
  }

  .mobile-nav {
    display: flex;
  }

  body {
    padding-bottom: calc(var(--mobile-nav-h) + 14px);
  }
}

@media (max-width: 720px) {
  .testimonials-track {
    grid-template-columns: repeat(4, 82%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 4px 0 8px;
    scrollbar-width: none;
  }

  .testimonials-track::-webkit-scrollbar {
    display: none;
  }

  .testimonial {
    scroll-snap-align: center;
  }

  .slider-controls {
    display: flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 40px;
  }

  .footer-bottom {
    font-size: 10px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 32px);
  }

  .hero-credits {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .scroll-indicator {
    display: none;
  }
}

@media (max-width: 480px) {
  .testimonials-track {
    grid-template-columns: repeat(4, 88%);
  }

  .mobile-nav-item {
    padding: 10px 12px;
  }

  .mobile-nav-item span {
    font-size: 9px;
  }
}