:root {
  --bg: #f2efe7;
  --paper: #fbf8f1;
  --ink: #18222d;
  --ink-soft: rgba(24, 34, 45, 0.72);
  --line: rgba(24, 34, 45, 0.12);
  --line-strong: rgba(24, 34, 45, 0.22);
  --accent: #b5533d;
  --accent-deep: #7f3323;
  --shadow-lg: 0 30px 80px rgba(31, 26, 20, 0.16);
  --shadow-md: 0 18px 40px rgba(31, 26, 20, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(181, 83, 61, 0.12), transparent 28%),
    radial-gradient(circle at right 18% top 14%, rgba(79, 124, 124, 0.14), transparent 22%),
    linear-gradient(180deg, #f5f1e7 0%, #ece4d6 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 34, 45, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 34, 45, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
}

body.viewerOpen {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-body);
  font-size: 0.95em;
  color: var(--accent-deep);
}

.isHidden {
  display: none !important;
}

.pageShell {
  width: min(1440px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.pageMain {
  display: grid;
  gap: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 22px;
}

.brandLockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brandLockupMark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff6ee;
  font-family: var(--font-display);
  font-size: 1.18rem;
  box-shadow: var(--shadow-md);
}

.brandLockupText {
  display: grid;
  gap: 2px;
}

.brandLockupText strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.brandLockupText span {
  color: var(--ink-soft);
}

.topbarMeta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.statusChip,
.topbarLink {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(251, 248, 241, 0.86);
  box-shadow: 0 6px 20px rgba(31, 26, 20, 0.06);
}

.topbarLink {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: stretch;
}

.heroCopyBlock,
.heroStage,
.workflowStrip,
.libraryShell,
.footerNote {
  animation: rise-in 720ms ease both;
}

.heroCopyBlock {
  padding: 28px 0 0;
}

.heroEyebrow,
.sectionEyebrow,
.panelEyebrow,
.posterEyebrow,
.overlayEyebrow {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1,
.sectionIntro h2,
.overlayTitle,
.posterTitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.98;
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  margin-top: 10px;
}

.heroLead,
.heroSublead {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-soft);
}

.heroLead {
  margin-top: 18px;
  font-size: 1.24rem;
  line-height: 1.52;
}

.heroSublead {
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.heroActions,
.previewActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.primaryButton,
.secondaryButton,
.secondaryLink,
.overlayButton {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.primaryButton {
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff8f3;
  box-shadow: 0 16px 34px rgba(127, 51, 35, 0.24);
}

.secondaryButton,
.secondaryLink,
.overlayButton,
.topbarLink {
  background: rgba(251, 248, 241, 0.88);
  border-color: var(--line-strong);
  color: var(--ink);
}

.primaryButton:hover,
.secondaryButton:hover,
.secondaryLink:hover,
.overlayButton:hover,
.topbarLink:hover,
.specialtyButton:hover,
.heroBook:hover,
.caseCover:hover {
  transform: translateY(-2px);
}

.primaryButton:focus-visible,
.secondaryButton:focus-visible,
.secondaryLink:focus-visible,
.overlayButton:focus-visible,
.specialtyButton:focus-visible,
.caseCover:focus-visible,
.heroBook:focus-visible,
.brandLockup:focus-visible,
.topbarLink:focus-visible {
  outline: 3px solid rgba(181, 83, 61, 0.28);
  outline-offset: 3px;
}

.primaryButton:disabled,
.secondaryButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondaryLink[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

.heroStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.heroStat {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.76);
  box-shadow: 0 10px 26px rgba(31, 26, 20, 0.08);
}

.heroStatLabel {
  display: block;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.heroStatValue {
  display: block;
  margin-top: 4px;
  font-size: 1.9rem;
  font-weight: 700;
}

.heroStage {
  position: relative;
  min-height: 620px;
  padding: 30px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(181, 83, 61, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(22, 31, 44, 0.96) 0%, rgba(18, 29, 41, 0.92) 100%);
  color: #f8f4ec;
  box-shadow: var(--shadow-lg);
}

.heroStage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
}

.heroPoster {
  position: relative;
  z-index: 1;
  max-width: 21rem;
  padding: 22px 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(251, 248, 241, 0.08);
  backdrop-filter: blur(12px);
}

.posterTitle {
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.posterCopy {
  margin: 14px 0 0;
  color: rgba(248, 244, 236, 0.78);
  line-height: 1.7;
}

.posterMeta,
.previewMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.posterMeta span,
.previewMeta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
}

.previewMeta span {
  border-color: var(--line);
  background: rgba(181, 83, 61, 0.06);
}

.heroShelf {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 30%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
  min-height: 340px;
  pointer-events: none;
}

.heroBook {
  pointer-events: auto;
  position: relative;
  width: min(22%, 140px);
  min-width: 86px;
  height: calc(220px + var(--shelf-height, 0px));
  padding: 20px 14px 18px;
  border: 0;
  border-radius: 18px 18px 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: #fffaf4;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, transparent 18%),
    linear-gradient(165deg, var(--series-top) 0%, var(--series-bottom) 100%);
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.22);
  transform: translateY(40px);
  animation: shelf-rise 820ms cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.heroBook::before,
.caseCover::before,
.ghostCover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.18);
}

.heroBook::after,
.caseCover::after,
.ghostCover::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.heroBookSeries,
.coverSeries {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.heroBookCount,
.coverNumber {
  display: block;
  margin-top: auto;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

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

.workflowStep,
.caseShelfPanel,
.previewPanel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.82);
  box-shadow: 0 12px 28px rgba(31, 26, 20, 0.08);
}

.workflowStep {
  padding: 20px 20px 18px;
}

.workflowNumber {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.workflowStep h2,
.previewPanel h4,
.panelTitle,
.previewTitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.workflowStep h2 {
  font-size: 1.38rem;
}

.workflowStep p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.66;
}

.librarySection {
  display: grid;
  gap: 18px;
}

.sectionIntro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.sectionIntro h2 {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 12ch;
}

.sectionCopy {
  max-width: 34rem;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.libraryShell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.specialtyRail {
  display: grid;
  gap: 10px;
  align-self: start;
}

.specialtyButton {
  position: relative;
  min-height: 86px;
  padding: 16px 16px 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.76);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 26, 20, 0.06);
}

.specialtyButton.isActive {
  border-color: rgba(24, 34, 45, 0.22);
  background: rgba(251, 248, 241, 0.94);
  box-shadow: 0 18px 28px rgba(31, 26, 20, 0.1);
}

.specialtyButton.isActive::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--series-top) 0%, var(--series-bottom) 100%);
}

.specialtyName {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
}

.specialtyCount,
.specialtyDescription {
  display: block;
  margin-top: 4px;
}

.specialtyCount {
  color: var(--accent-deep);
  font-size: 0.92rem;
}

.specialtyDescription {
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.93rem;
}

.caseShelfPanel {
  padding: 18px;
}

.panelHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.panelTitle {
  margin-top: 8px;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
}

.panelMeta {
  margin: 0;
  color: var(--ink-soft);
  text-align: right;
}

.caseShelf {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.caseCover,
.ghostCover {
  position: relative;
  min-height: 258px;
  border-radius: 20px 20px 18px 14px;
  overflow: hidden;
}

.caseCover {
  padding: 18px 18px 20px;
  border: 0;
  text-align: left;
  color: #fffaf4;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, transparent 18%),
    linear-gradient(165deg, var(--series-top) 0%, var(--series-bottom) 100%);
  box-shadow: 0 18px 34px rgba(31, 26, 20, 0.18);
  transform: translateY(24px);
  opacity: 0;
  animation: shelf-rise 700ms cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.caseCover.isActive {
  box-shadow: 0 22px 42px rgba(31, 26, 20, 0.22);
}

.caseCoverTitle {
  display: block;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.02;
}

.caseCoverSubtitle {
  display: block;
  margin-top: 10px;
  color: rgba(255, 250, 244, 0.82);
  line-height: 1.42;
}

.caseCoverFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 22px;
  color: rgba(255, 250, 244, 0.92);
  font-size: 0.92rem;
}

.coverStatus {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.emptyShelf {
  padding: 30px 8px 10px;
  text-align: center;
}

.ghostCoverRow {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.ghostCover {
  width: min(180px, 28vw);
  min-width: 110px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48) 0%, transparent 18%),
    linear-gradient(160deg, #d3c6b8 0%, #bcae9f 100%);
  box-shadow: 0 14px 26px rgba(31, 26, 20, 0.08);
}

.emptyShelfTitle {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.emptyShelfCopy {
  max-width: 34rem;
  margin: 10px auto 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.previewPanel {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.previewTitle {
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.previewSubtitle,
.previewBody,
#reflectionText {
  margin: 12px 0 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.previewTags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.previewTag {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(181, 83, 61, 0.08);
  color: var(--accent-deep);
}

.reflectionBlock {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reflectionBlock h4 {
  font-size: 1.2rem;
}

.footerNote {
  margin-top: 24px;
  padding: 0 4px;
  color: var(--ink-soft);
}

.viewerOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 20, 30, 0.72);
  backdrop-filter: blur(18px);
}

.viewerOverlayInner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1500px, calc(100vw - 20px));
  height: min(96vh, 980px);
  margin: 10px auto;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(19, 28, 39, 0.98);
  box-shadow: 0 36px 90px rgba(4, 7, 11, 0.42);
  animation: overlay-in 260ms ease both;
}

.viewerOverlayBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8f4ec;
}

.overlayTitleGroup {
  min-width: 0;
}

.overlayTitle {
  margin-top: 6px;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  color: #fffaf4;
}

.overlayButton {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fffaf4;
}

.viewerFrameWrap {
  min-height: 0;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shelf-rise {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes overlay-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .heroStage {
    min-height: 520px;
  }

  .heroShelf {
    left: 36%;
  }

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

  .specialtyRail {
    grid-template-columns: repeat(6, minmax(200px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .previewPanel {
    position: static;
  }
}

@media (max-width: 860px) {
  .pageShell {
    width: min(100vw - 16px, 1440px);
    padding-top: 12px;
  }

  .topbar,
  .sectionIntro,
  .viewerOverlayBar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbarMeta {
    width: 100%;
    flex-wrap: wrap;
  }

  .heroStats,
  .workflowStrip {
    grid-template-columns: 1fr;
  }

  .heroStage {
    padding: 22px;
    min-height: 500px;
  }

  .heroShelf {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 26px;
    justify-content: flex-start;
    min-height: 0;
  }

  .heroBook {
    width: min(31%, 132px);
  }

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

  .viewerOverlayInner {
    width: min(100vw - 12px, 1500px);
    height: min(100vh - 12px, 980px);
    margin: 6px auto;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    max-width: none;
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }

  .heroActions,
  .previewActions {
    flex-direction: column;
  }

  .primaryButton,
  .secondaryButton,
  .secondaryLink,
  .overlayButton,
  .topbarLink {
    width: 100%;
  }

  .heroBook {
    width: min(46%, 150px);
  }

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

  .panelHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .panelMeta {
    text-align: left;
  }

  .ghostCoverRow {
    flex-direction: column;
    align-items: center;
  }

  .ghostCover {
    width: min(210px, 62vw);
  }
}
