:root {
  --bg: #f3ecdf;
  --paper: #fbf7f1;
  --ink: #211d18;
  --muted: #6f675d;
  --line: #ddd2c1;
  --bronze: #aa8057;
  --sand: #e9dcc9;
  --moss: #647160;
  --rust: #b06c4d;
  --shadow: 0 28px 60px rgba(33, 29, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Lato", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(180deg, #f6efe3 0%, #efe3d3 100%);
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: rgba(251, 247, 241, 0.88);
  border-bottom: 1px solid rgba(170, 128, 87, 0.16);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 135px;
  height: auto;
  object-fit: contain;
}

.brand-eyebrow,
.brand-name,
.eyebrow,
.label {
  margin: 0;
}

.brand-eyebrow,
.eyebrow,
.label {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--bronze);
}

.brand-name {
  font-size: 13px;
  color: var(--ink);
}

.topbar nav {
  display: flex;
  gap: 18px;
}

.topbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
}

.page {
  padding: 28px 22px 42px;
}

.page-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 44px;
  border-radius: 32px;
  background: rgba(251, 247, 241, 0.86);
  border: 1px solid rgba(170, 128, 87, 0.14);
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin-top: 14px;
  font-size: clamp(46px, 6vw, 86px);
  line-height: 0.95;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.hero-title span:first-child {
  color: var(--ink);
}

.hero-title span:last-child {
  color: var(--bronze);
  text-shadow: 0 10px 24px rgba(170, 128, 87, 0.16);
}

h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.08;
}

h3 {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.centered-head {
  text-align: center;
}

.centered-head h2 {
  margin-left: auto;
  margin-right: auto;
  max-width: 12ch;
}

.nowrap {
  white-space: nowrap;
}

.subline {
  margin: 18px 0 0;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}

.lead,
.statement,
.section-text,
.thesis-side p,
.rule-card p,
.space-copy p,
.next-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  max-width: 34rem;
  margin-top: 22px;
  font-size: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.chip-row span {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--bronze);
  font-size: 12px;
}

.cover-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 36px;
  min-height: calc(100vh - 138px);
  align-items: center;
}

.cover-copy {
  order: 2;
  padding-right: 10px;
}

.cover-media {
  order: 1;
  position: relative;
  min-height: 760px;
}

.hero-frame,
.floating-card,
.grammar-image,
.space-media figure,
.mosaic figure {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(170, 128, 87, 0.18);
  box-shadow: 0 22px 40px rgba(33, 29, 24, 0.08);
}

.hero-frame {
  height: 760px;
  border-radius: 42px;
}

.hero-video-shell {
  position: relative;
  background: #16120f;
}

.hero-video-link {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-video-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.06) 0%, rgba(20, 16, 12, 0.76) 100%);
  color: #f8f1e8;
}

.hero-video-caption p {
  margin: 0;
  max-width: 32rem;
  line-height: 1.6;
  font-size: 14px;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.cover-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 229, 0.28);
  color: #f8f1e8;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.cover-action.primary {
  background: rgba(255, 244, 229, 0.92);
  color: var(--ink);
  border-color: transparent;
}

.thesis-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
}

.statement {
  max-width: 45rem;
  margin-top: 22px;
  font-size: 18px;
}

.thesis-side {
  display: grid;
  gap: 16px;
}

.thesis-side article,
.rule-card,
.next-grid article {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(170, 128, 87, 0.15);
}

.grammar-layout .section-head,
.spaces .section-head,
.overview .section-head,
.plan .section-head,
.next .section-head {
  max-width: 940px;
  margin-bottom: 28px;
}

.section-head h2,
.thesis-main h2 {
  max-width: 18ch;
}

.grammar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.rule-card {
  min-height: 200px;
}

.rule-card.accent h3,
.rule-card.accent .label {
  color: var(--moss);
}

.grammar-image {
  border-radius: 28px;
  min-height: 280px;
}

.grammar-image.large {
  grid-column: span 2;
  min-height: 400px;
}

.space-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid rgba(170, 128, 87, 0.16);
}

.space-row.feature {
  border-top: none;
  padding-top: 0;
}

.space-copy {
  padding-right: 8px;
}

.space-media.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.space-media figure {
  min-height: 360px;
  border-radius: 28px;
}

.overview-layout .section-head.narrow {
  max-width: 620px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.mosaic figure {
  min-height: 210px;
  border-radius: 26px;
}

.reference-set {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reference-set figure {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(170, 128, 87, 0.18);
  box-shadow: 0 22px 40px rgba(33, 29, 24, 0.08);
  border-radius: 26px;
  min-height: 260px;
}

.reference-set .large {
  grid-column: span 2;
  min-height: 360px;
}

.reference-set figcaption {
  padding: 14px 18px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(251, 247, 241, 0.92);
}

.plan-layout {
  display: grid;
  gap: 24px;
}

.plan-figure {
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(170, 128, 87, 0.18);
  box-shadow: 0 22px 40px rgba(33, 29, 24, 0.08);
}

.plan-figure img {
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #fff;
  padding: 20px;
}

.plan-figure figcaption {
  padding: 16px 20px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.mosaic .large {
  grid-column: span 2;
  min-height: 360px;
}

.next-layout {
  position: relative;
}

.next-layout::before {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  background: var(--bronze);
  margin-bottom: 24px;
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

main figure img.zoomable,
.plan-figure img,
.hero-frame img,
.floating-card img {
  cursor: zoom-in;
}

.hero-video {
  cursor: pointer;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  background: rgba(12, 10, 8, 0.88);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-stage {
  max-width: min(1100px, 82vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(88vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.lightbox-stage p {
  margin: 0;
  max-width: 70ch;
  text-align: center;
  color: rgba(255, 248, 239, 0.86);
  line-height: 1.6;
}

.lightbox-close,
.lightbox-nav {
  border: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-nav {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  font-size: 34px;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .cover-layout,
  .thesis-layout,
  .grammar-grid,
  .reference-set,
  .space-row,
  .mosaic,
  .next-grid {
    grid-template-columns: 1fr;
  }

  .cover-copy,
  .cover-media {
    order: initial;
  }

  .cover-media {
    min-height: auto;
  }

  .hero-frame {
    height: 560px;
  }

  .hero-video-caption {
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 18px;
  }

  .grammar-image.large,
  .reference-set .large,
  .mosaic .large {
    grid-column: auto;
  }

  .topbar {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar nav {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .brand-logo {
    width: 112px;
  }
}

.appendix .section-head h2 {
  max-width: none;
}

.original-set figure {
  min-height: 240px;
}

@media (max-width: 760px) {
  .page {
    padding: 16px 12px 28px;
  }

  .page-inner {
    padding: 24px 18px;
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
    line-height: 0.92;
  }

  h2 {
    font-size: clamp(26px, 8vw, 38px);
  }

  .lead,
  .statement,
  .section-text {
    font-size: 15px;
  }

  .hero-frame {
    height: 460px;
    border-radius: 28px;
  }

  .hero-video-caption {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 14px;
    border-radius: 18px;
  }

  .hero-video-caption p {
    font-size: 13px;
  }

  .cover-actions {
    gap: 10px;
  }

  .cover-action {
    width: 100%;
    min-height: 40px;
  }

  .space-media.two-up,
  .mosaic,
  .reference-set,
  .next-grid {
    grid-template-columns: 1fr;
  }

  .space-row {
    gap: 18px;
    padding: 20px 0;
  }

  .space-media figure,
  .grammar-image,
  .mosaic figure {
    min-height: 240px;
  }

  .plan-figure img {
    aspect-ratio: 4 / 5;
    padding: 12px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-nav {
    display: none;
  }

  .lightbox-stage {
    max-width: 100%;
    max-height: 100%;
  }

  .lightbox-stage img {
    max-height: 74vh;
  }
}
