:root {
  --paper: #f3ebdb;
  --paper-warm: #fbf7ee;
  --paper-deep: #e4d8be;
  --ink: #2d2414;
  --ink-soft: rgba(45, 36, 20, 0.86);
  --olive: #7b6a2a;
  --olive-deep: #5f511f;
  --backdrop-brown: #65594d;
  --line: rgba(90, 73, 26, 0.26);
  --panel: rgba(255, 251, 243, 0.78);
  --panel-strong: rgba(255, 249, 238, 0.95);
  --shadow: 0 20px 60px rgba(69, 52, 20, 0.14);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.92), rgba(243, 235, 219, 0.98)),
    linear-gradient(180deg, #f8f1e3, #ede0c5 62%, #e7d7b8);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(114, 93, 40, 0.045), rgba(114, 93, 40, 0.045)),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.42), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(147, 119, 43, 0.08), transparent 24%);
  mix-blend-mode: multiply;
}

body.splash-open {
  overflow: hidden;
}

.splash-overlay[hidden] {
  display: none !important;
}

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

a,
button,
summary {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease, box-shadow 160ms ease;
}

:focus-visible {
  outline: 3px solid rgba(123, 106, 42, 0.48);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-180%);
  background: var(--olive-deep);
  color: #fffdf7;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 10;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 18px auto;
  padding: 24px;
  border: 1.5px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.74), rgba(250, 243, 230, 0.9));
  box-shadow: var(--shadow);
  overflow: clip;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(101, 89, 77, 0.82);
  backdrop-filter: blur(10px);
}

.splash-panel {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(123, 106, 42, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.96), rgba(244, 235, 220, 0.94));
  box-shadow: 0 32px 100px rgba(26, 18, 8, 0.32);
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(123, 106, 42, 0.24);
  border-radius: 22px;
  pointer-events: none;
}

.page-shell::after {
  inset: 6px;
  border-color: rgba(123, 106, 42, 0.12);
}

.hero {
  padding: 8px 0 24px;
}

.topbar,
.site-footer,
.lightbox-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar {
  padding-bottom: 26px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Marcellus", Georgia, serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.brandmark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.nav-links,
.hero-actions,
.pair-controls,
.story-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-links a,
.site-footer a {
  color: var(--olive-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.site-footer a:hover {
  border-color: currentColor;
}

.hero-grid,
.overview-grid,
.books-grid,
.downloads-grid,
.use-grid,
.spotlight-grid,
.extensions-grid,
.chapter-grid,
.portfolio-grid {
  display: grid;
  gap: 22px;
}

.hero-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
}

.overview-grid,
.downloads-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

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

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

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

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

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

.hero-copy h1,
.portfolio-copy h2,
.section-heading h2,
.overview-card h3,
.book-card h3,
.use-card h3,
.story-copy h3,
.download-card h3,
.chapter-card h3,
.extension-card h3,
.portfolio-card h3,
.worked-example h3 {
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
}

.hero-copy h1 {
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  line-height: 0.96;
  margin: 0 0 14px;
  max-width: 10ch;
}

.eyebrow,
.card-kicker,
.story-kicker,
.story-nav a,
.pair-figure figcaption,
.spotlight-card figcaption,
.feature-panel figcaption,
.brand-panel figcaption {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--olive);
}

.hero-summary,
.subtitle,
.section-intro,
.overview-copy p,
.overview-card p,
.book-card p,
.use-card p,
.story-copy p,
.download-card p,
.chapter-card p,
.extension-card p,
.portfolio-card p,
.worked-example p,
#lightbox-group,
#lightbox-title {
  font-size: clamp(1.12rem, 2vw, 1.28rem);
  line-height: 1.45;
}

.button,
.toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: "Marcellus", Georgia, serif;
  text-decoration: none;
  border: 1px solid rgba(111, 94, 34, 0.26);
  background: rgba(255, 252, 245, 0.78);
  color: var(--olive-deep);
}

.button:hover,
.toggle-button:hover,
.image-link:hover,
summary:hover {
  transform: translateY(-1px);
}

.button-primary,
.toggle-button.is-active {
  background: linear-gradient(180deg, #8a772f, #6f5e22);
  color: #fffdf7;
  box-shadow: 0 14px 30px rgba(111, 94, 34, 0.22);
}

.button-secondary {
  background: rgba(255, 252, 245, 0.76);
}

.hero-art,
.overview-card,
.book-card,
.use-card,
.worked-example,
.story-step,
.download-card,
.chapter-card,
.extension-card,
.portfolio-card,
.library-disclosure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-art,
.overview-card,
.book-card,
.use-card,
.worked-example,
.download-card,
.portfolio-card {
  padding: 22px;
}

.portfolio-splash {
  padding: 4px 0 28px;
}

.portfolio-copy {
  max-width: 920px;
  margin-bottom: 18px;
}

.portfolio-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.06;
}

.portfolio-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.portfolio-card:hover {
  transform: translateY(-2px);
}

.portfolio-card h3 {
  margin: 6px 0 10px;
  font-size: 1.5rem;
}

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

.portfolio-grid-splash {
  margin-top: 18px;
}

.splash-tr-mark {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.76);
  border: 1px solid rgba(111, 94, 34, 0.16);
  box-shadow: 0 14px 32px rgba(69, 52, 20, 0.12);
}

.splash-tr-mark img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.portfolio-card-visual {
  overflow: hidden;
}

.portfolio-shot {
  margin: -22px -22px 18px;
  min-height: 208px;
  padding: 22px;
  border-bottom: 1px solid rgba(111, 94, 34, 0.12);
  display: grid;
  place-items: center;
}

.shot-highlightit {
  background:
    radial-gradient(circle at top right, rgba(253, 229, 6, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(19, 18, 15, 0.96), rgba(34, 31, 26, 0.98));
}

.shot-bowlsiq {
  background:
    radial-gradient(circle at top, rgba(132, 180, 103, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(236, 244, 229, 0.98), rgba(220, 235, 208, 0.98));
}

.shot-story {
  background:
    radial-gradient(circle at top, rgba(229, 183, 82, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(20, 15, 10, 0.98), rgba(45, 34, 22, 0.98));
}

.portfolio-logo {
  display: block;
  max-width: 72%;
  max-height: 148px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.portfolio-logo-highlightit {
  width: min(260px, 72%);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
}

.portfolio-logo-bowlsiq {
  width: min(240px, 72%);
  filter: drop-shadow(0 12px 24px rgba(50, 71, 39, 0.18));
}

.portfolio-logo-story {
  width: min(118px, 72%);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.splash-actions {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

#portfolio-splash-enter {
  background: var(--backdrop-brown);
  border-color: var(--backdrop-brown);
  color: #fffdf7;
  box-shadow: 0 14px 30px rgba(69, 52, 20, 0.2);
}

#portfolio-splash-enter:hover {
  filter: brightness(1.04);
}

.framed-image {
  background: var(--panel);
}

.hero-art picture,
.feature-panel picture,
.spotlight-card picture,
.image-link picture {
  display: block;
}

.section-heading {
  max-width: 900px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.04;
}

.overview,
.books-section,
.use-section,
.storyboard-section,
.extensions-section,
.library-section,
.downloads-section,
.faq-section {
  padding: 34px 0 12px;
}

.story-nav {
  margin-bottom: 18px;
}

.story-nav a {
  text-decoration: none;
  color: var(--olive-deep);
  padding: 10px 12px;
  border: 1px solid rgba(111, 94, 34, 0.2);
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.75);
}

.storyboard-list {
  display: grid;
  gap: 18px;
}

.story-step {
  position: relative;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 251, 243, 0.95), rgba(243, 235, 219, 0.82)),
    linear-gradient(90deg, transparent, rgba(123, 106, 42, 0.04), transparent);
}

.story-step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(123, 106, 42, 0.07), transparent 24%);
  pointer-events: none;
}

.story-step-grid {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
  align-items: start;
}

.story-number {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(111, 94, 34, 0.32);
  background: rgba(255, 250, 241, 0.9);
  font-family: "Marcellus", Georgia, serif;
  font-size: 1.2rem;
  color: var(--olive-deep);
}

.story-copy h3 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.story-copy p {
  margin: 0 0 12px;
}

.pair-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pair-media[data-enhanced="true"] {
  grid-template-columns: 1fr;
}

.pair-media[data-enhanced="true"] .pair-figure[hidden] {
  display: none;
}

.pair-media-split {
  grid-template-columns: 1fr 1fr;
}

.pair-figure {
  margin: 0;
}

.pair-figure figcaption,
.spotlight-card figcaption {
  margin-top: 10px;
  text-align: center;
}

.image-link {
  display: block;
  padding: 12px;
  border: 1px solid rgba(111, 94, 34, 0.18);
  border-radius: calc(var(--radius) - 10px);
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.image-link img {
  display: block;
  width: 100%;
  border-radius: calc(var(--radius) - 16px);
}

.story-image-link img,
.extension-card .card-link img {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: rgba(255, 252, 245, 0.92);
}

.chapter-card .card-link img,
.spotlight-card .card-link img {
  object-fit: cover;
}

.feature-panel figcaption,
.brand-panel figcaption {
  padding-top: 14px;
  text-align: center;
}

.brand-panel {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 100%;
}

.brand-panel img {
  width: min(180px, 42%);
}

.library-disclosure {
  padding: 18px;
  margin-bottom: 16px;
}

summary {
  cursor: pointer;
  font-family: "Marcellus", Georgia, serif;
  font-size: 1.18rem;
}

.library-disclosure[open] summary {
  margin-bottom: 16px;
}

.chapter-card,
.extension-card,
.spotlight-card {
  padding: 14px;
}

.chapter-card h3,
.extension-card h3 {
  margin: 14px 0 6px;
  font-size: 1.35rem;
}

.chapter-card p,
.extension-card p {
  margin: 0;
  color: var(--ink-soft);
}

.site-footer {
  padding: 28px 0 8px;
  color: var(--ink-soft);
  border-top: 1px solid rgba(123, 106, 42, 0.22);
  margin-top: 22px;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-family: "Marcellus", Georgia, serif;
  font-size: 1.22rem;
  color: var(--ink);
}

.faq-item p {
  margin: 14px 0 0;
  font-size: clamp(1.08rem, 1.9vw, 1.22rem);
  line-height: 1.5;
}

.lightbox {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 18px;
  border: 1px solid rgba(123, 106, 42, 0.28);
  border-radius: 26px;
  background: rgba(249, 244, 233, 0.97);
  box-shadow: 0 30px 90px rgba(31, 22, 10, 0.35);
}

.lightbox::backdrop {
  background: rgba(39, 28, 12, 0.78);
  backdrop-filter: blur(4px);
}

.lightbox-close {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(123, 106, 42, 0.32);
  background: rgba(255, 251, 243, 0.9);
  font-family: "Marcellus", Georgia, serif;
  cursor: pointer;
}

.lightbox img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 240px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 18px;
  transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
  transform: scale(var(--zoom-scale, 1));
  transition: transform 120ms ease;
}

.lightbox-stage {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 251, 243, 0.82);
}

.lightbox.zoom-hover #lightbox-image {
  cursor: zoom-in;
}

.lightbox.zoom-active #lightbox-image {
  --zoom-scale: 2.15;
  cursor: zoom-out;
}

.lightbox-hint {
  margin: 10px 0 0;
  color: var(--olive);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

#lightbox-group {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--olive);
  font-size: 0.92rem;
}

#lightbox-title {
  margin: 12px 0 0;
}

@media (max-width: 1080px) {
  .story-step-grid {
    grid-template-columns: 72px 1fr;
  }

  .story-image-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 920px) {
  .hero-grid,
  .overview-grid,
  .books-grid,
  .downloads-grid,
  .use-grid,
  .extensions-grid,
  .spotlight-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 16px, 1240px);
    padding: 16px;
    border-radius: 20px;
  }

  .splash-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .splash-tr-mark {
    top: 18px;
    right: 18px;
    width: 60px;
    height: 60px;
  }

  .splash-tr-mark img {
    width: 46px;
    height: 46px;
  }

  .topbar,
  .site-footer,
  .lightbox-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .story-step-grid,
  .pair-media,
  .pair-media-split,
  .chapter-grid {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .lightbox-hint {
    display: none;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .topbar,
  .hero-actions,
  .pair-controls,
  .lightbox,
  .story-nav {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .page-shell::before,
  .page-shell::after {
    display: none;
  }
}
