@font-face {
  font-family: "Miranda Sans";
  src: url("assets/fonts/MirandaSans-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Miranda Sans";
  src: url("assets/fonts/MirandaSans-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f8fafc;
  --ink: #0f172a;
  --amber: #f59e0b;
  --muted: #475569;
  --hairline: #cbd5e1;
  --white: #ffffff;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Miranda Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--amber);
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

button,
a {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-160%);
}

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

.masthead {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100%, var(--max-width));
  min-height: 76px;
  margin: 0 auto;
  padding: 1rem clamp(1.1rem, 4vw, 3rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.2rem);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--amber);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.35em;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--paper);
  font: inherit;
}

main {
  width: 100%;
}

.workbook {
  position: relative;
  width: min(100%, var(--max-width));
  min-height: 720px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink);
}

.workbook-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contents-panel,
.specimen-panel {
  position: relative;
  z-index: 1;
}

.contents-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 43%;
  height: 100%;
  padding: 7.5% 6% 10% 7%;
  color: var(--ink);
}

.page-label {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contents-panel > .page-label {
  margin-bottom: 1.2rem;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  letter-spacing: -0.02em;
  text-transform: none;
}

.audience-nav {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 2rem;
}

.audience-nav a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  min-height: 48px;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  color: var(--ink);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 700;
  text-decoration: none;
}

.audience-nav a span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.audience-nav a:hover,
.audience-nav a[aria-current="true"] {
  background: #fef3c7;
  color: var(--ink);
}

.product-index h2 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-index ul {
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-index a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0.2rem 0;
  color: var(--muted);
  font-size: clamp(0.76rem, 1vw, 0.9rem);
  line-height: 1.35;
  text-decoration: none;
}

.product-index a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.specimen-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1rem, 2.2vw, 2rem);
  width: 60%;
  height: 100%;
  padding: 8% 5.5% 12% 2.5%;
  color: var(--ink);
}

.specimen-cover {
  align-self: start;
  overflow: hidden;
  border-radius: 0.8rem;
  box-shadow: 0 18px 38px rgb(15 23 42 / 22%);
}

.specimen-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.specimen-copy {
  min-width: 0;
}

.specimen-copy .page-label {
  color: #92400e;
}

.specimen-copy h1 {
  max-width: 14ch;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 42ch;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.2vw, 1.08rem);
}

.illustration-label {
  margin: 0 0 0.4rem;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-preview {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 0.55rem;
  background: var(--white);
  scrollbar-color: var(--muted) var(--paper);
  scrollbar-width: thin;
}

.sheet-preview table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.3;
}

.sheet-preview caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sheet-preview th,
.sheet-preview td {
  padding: 0.55rem 0.6rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

.sheet-preview th {
  background: #1e293b;
  color: var(--white);
}

.sheet-preview td:last-child,
.sheet-preview th:last-child {
  border-right: 0;
}

.next-step {
  margin: 1rem 0 0.8rem;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: 0.65rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  background: var(--amber);
  color: var(--ink);
}

.button-primary:hover {
  background: #fbb43c;
}

.button-primary:active {
  background: #d97706;
}

.button-secondary {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.button-secondary:active {
  background: #1e293b;
  color: var(--paper);
}

.fine-print {
  max-width: 38ch;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.appendix {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.1rem, 4vw, 3rem);
  background: var(--paper);
  color: var(--ink);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: end;
  gap: 1rem 3rem;
  margin-bottom: 2.2rem;
}

.section-heading .page-label {
  grid-column: 1 / -1;
  color: #92400e;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-heading > p:last-child {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
}

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

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  background: var(--white);
}

.product-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--ink);
}

.product-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.1rem;
}

.product-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  line-height: 1.25;
}

.product-card p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.product-card .price {
  margin-top: auto;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.product-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
}

.product-card .button {
  width: 100%;
  margin-top: 0.9rem;
}

.product-card a:focus-visible,
.catalog-card a:focus-visible {
  outline-offset: -4px;
}

.product-card-bundle {
  border-color: var(--amber);
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 2rem;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 2rem clamp(1.1rem, 4vw, 3rem);
}

.site-footer p {
  margin: 0;
  color: var(--hairline);
  font-size: 0.86rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 1100px) {
  .workbook {
    min-height: 680px;
  }

  .contents-panel {
    width: 42%;
    padding-left: 5%;
  }

  .specimen-panel {
    grid-template-columns: 1fr;
    width: 58%;
    padding: 7% 4% 8% 3%;
  }

  .specimen-cover {
    width: 54%;
  }

  .specimen-copy h1 {
    font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  }

  .sheet-preview {
    max-width: 100%;
  }

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

@media (max-width: 760px) {
  .masthead {
    flex-wrap: wrap;
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 0.4rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.25rem 1.2rem;
  }

  body.nav-enhanced:not(.nav-open) .site-nav {
    display: none;
  }

  body.nav-enhanced.nav-open .site-nav {
    display: flex;
  }

  .workbook {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: visible;
    background: var(--paper);
  }

  .workbook-bg {
    display: none;
  }

  .contents-panel,
  .specimen-panel {
    position: static;
    width: 100%;
    height: auto;
    padding: 2rem 1.1rem;
  }

  .specimen-panel {
    order: 1;
    padding-top: 1.4rem;
    padding-bottom: 2.4rem;
  }

  .contents-panel {
    order: 2;
    border-top: 1px solid var(--hairline);
  }

  .contents-panel > .page-label {
    font-size: 1.8rem;
  }

  .audience-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .audience-nav a {
    grid-template-columns: 1fr;
    min-height: 56px;
    padding: 0.6rem 0.75rem;
    background: var(--white);
    font-size: 1rem;
  }

  .product-index a {
    min-height: 44px;
    font-size: 0.84rem;
  }

  .specimen-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
    color: var(--ink);
  }

  .specimen-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .specimen-copy .next-step {
    order: 1;
    margin-top: 1.2rem;
  }

  .specimen-copy .button {
    order: 2;
    align-self: flex-start;
  }

  .specimen-copy .fine-print {
    order: 3;
  }

  .specimen-copy .illustration-label {
    order: 4;
    margin-top: 1.6rem;
  }

  .specimen-copy .sheet-preview {
    order: 5;
  }

  .specimen-cover {
    width: min(100%, 460px);
  }

  .specimen-copy h1 {
    max-width: 14ch;
    font-size: clamp(2.4rem, 11vw, 3.6rem);
  }

  .lede {
    font-size: 1rem;
  }

  .sheet-preview table {
    min-width: 560px;
    font-size: 0.72rem;
  }

  .appendix {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .section-heading h2 {
    font-size: clamp(2.4rem, 12vw, 3.8rem);
  }

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

  .product-card {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .product-card img {
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

@media (max-width: 480px) {
  .product-card {
    display: flex;
  }

  .product-card img {
    aspect-ratio: 16 / 9;
  }
}

.page-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1.1rem, 4vw, 3rem);
  background: var(--paper);
  color: var(--ink);
}

.page-intro {
  display: grid;
  gap: 0.8rem;
  max-width: 880px;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.page-intro .page-label,
.prose .page-label,
.detail-heading .page-label,
.next-product .page-label {
  color: #92400e;
}

.page-intro h1,
.detail-heading h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.page-intro > p:last-child,
.detail-heading .lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.catalog-section {
  margin: 0 0 clamp(3.5rem, 8vw, 7rem);
  scroll-margin-top: 2rem;
}

.catalog-section-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.catalog-section-heading .page-label {
  min-width: 2rem;
  margin: 0;
  color: #92400e;
}

.catalog-section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

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

.catalog-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  background: var(--white);
  color: var(--ink);
}

.catalog-section > .catalog-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.catalog-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--ink);
}

.catalog-section > .catalog-card img {
  height: 100%;
  aspect-ratio: auto;
}

.catalog-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.catalog-card .price {
  margin: 0 0 0.5rem;
  color: #92400e;
  font-size: 1.1rem;
  font-weight: 700;
}

.catalog-card h3 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.catalog-card p:not(.price) {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.catalog-card .format {
  margin-top: auto;
  font-size: 0.86rem;
}

.catalog-card a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.6rem;
  font-weight: 700;
}

.catalog-card .button {
  margin-top: 0.8rem;
}

.bundle-section {
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: 1.2rem;
  background: var(--ink);
  color: var(--paper);
}

.bundle-section .catalog-section-heading {
  border-color: #334155;
}

.bundle-section .catalog-section-heading .page-label {
  color: var(--amber);
}

.bundle-section .catalog-card {
  border-color: #334155;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
}

.product-detail > *,
.detail-heading,
.prose {
  min-width: 0;
}

.detail-heading {
  display: grid;
  justify-items: start;
  gap: 1rem;
  max-width: 1000px;
}

.detail-heading h1 {
  max-width: 100%;
  font-size: clamp(3.2rem, 8vw, 6.6rem);
  overflow-wrap: break-word;
}

.detail-heading .button {
  margin-top: 0.6rem;
}

.detail-cover {
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 22px 50px rgb(15 23 42 / 16%);
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.prose p:not(.page-label),
.prose li {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

.prose ul,
.prose ol {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.25rem;
}

.scope-box {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  background: var(--white);
}

.next-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 1rem;
  background: #1e293b;
  color: var(--paper);
}

.next-product .page-label {
  color: var(--amber);
}

.next-product h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.next-product p:not(.page-label) {
  max-width: 58ch;
  margin: 0;
  color: var(--hairline);
}

.about-page {
  display: grid;
  gap: clamp(3rem, 7vw, 6rem);
}

@media (max-width: 1000px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-section > .catalog-card {
    grid-template-columns: 1fr;
  }

  .catalog-section > .catalog-card img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 2.6rem;
    padding-bottom: 3.2rem;
  }

  .page-intro h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .detail-heading h1 {
    font-size: clamp(2.65rem, 12vw, 4.4rem);
  }

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

  .catalog-section-heading {
    align-items: flex-start;
  }

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
