:root {
  --ink: #172523;
  --muted: #5a6b67;
  --paper: #f4f0e7;
  --paper-deep: #e8e1d4;
  --night: #102927;
  --night-deep: #091b1a;
  --moss: #3f655d;
  --moss-light: #8eb3a6;
  --glacier: #c6e0dc;
  --ember: #c96e45;
  --ember-dark: #9d4d2e;
  --gold: #dabd7d;
  --line: rgba(23, 37, 35, 0.16);
  --shadow: 0 24px 70px rgba(8, 31, 29, 0.14);
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E");
}

a {
  color: var(--ember-dark);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ember);
}

button,
select,
input {
  font: inherit;
}

button,
select {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--night);
  background: #fff;
  border-radius: 8px;
  transform: translateY(-150%);
}

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

.site-header {
  position: relative;
  z-index: 20;
  color: #f8f4ea;
  background: var(--night-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(218, 189, 125, 0.7);
  border-radius: 50%;
  font-family: Georgia, serif;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.site-nav a {
  color: rgba(248, 244, 234, 0.82);
  font-size: 0.92rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.nav-toggle {
  display: none;
  padding: 9px 12px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
}

.hero {
  position: relative;
  overflow: hidden;
  color: #f8f4ea;
  background:
    radial-gradient(circle at 76% 18%, rgba(127, 188, 171, 0.22), transparent 32%),
    radial-gradient(circle at 12% 70%, rgba(201, 110, 69, 0.14), transparent 26%),
    linear-gradient(145deg, #0a211f 0%, #173d38 58%, #0d2826 100%);
}

.hero::after {
  position: absolute;
  right: -10%;
  bottom: -2px;
  left: -10%;
  height: 140px;
  content: "";
  opacity: 0.42;
  background:
    linear-gradient(155deg, transparent 0 48%, #061714 49% 100%) left bottom / 52% 100% no-repeat,
    linear-gradient(205deg, transparent 0 49%, #0b2420 50% 100%) right bottom / 58% 84% no-repeat;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 76px 0 118px;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1.14fr);
  gap: 66px;
  align-items: center;
}

.hero-grid > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ember);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e9a07c;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5.7rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3.3vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.hero-lead {
  max-width: 590px;
  margin: 26px 0 0;
  color: rgba(248, 244, 234, 0.76);
  font-size: 1.12rem;
}

.hero-note {
  margin: 24px 0 0;
  padding-left: 18px;
  color: rgba(248, 244, 234, 0.66);
  border-left: 2px solid var(--ember);
  font-size: 0.9rem;
}

.generator-card {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  background: rgba(248, 246, 239, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.generator-form {
  padding: 30px;
}

.form-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.form-heading h2 {
  margin: 0;
  font-size: 1.72rem;
}

.form-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.field label,
.range-field label {
  margin-bottom: 7px;
  display: block;
  font-size: 0.84rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.field select {
  width: 100%;
  max-width: 100%;
  min-height: 50px;
  padding: 0 40px 0 13px;
  color: var(--ink);
  background-color: #fff;
  border: 1px solid #c9cec9;
  border-radius: var(--radius-sm);
}

.range-field {
  margin-top: 18px;
}

.range-line {
  display: grid;
  grid-template-columns: 76px 1fr 90px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.range-line input {
  width: 100%;
  accent-color: var(--ember);
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  font-weight: 780;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 22px;
  color: #fff;
  background: var(--ember-dark);
  border: 1px solid var(--ember-dark);
}

.primary-button:hover {
  background: #843d25;
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--night);
  background: transparent;
  border: 1px solid rgba(16, 41, 39, 0.3);
}

.secondary-button:hover {
  background: rgba(16, 41, 39, 0.06);
}

.result-panel {
  position: relative;
  padding: 30px;
  background: #fff;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.result-panel[hidden] {
  display: none;
}

.result-kicker {
  margin: 0 0 4px;
  color: var(--ember-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.result-meta {
  margin: 12px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  color: var(--moss);
  background: #edf3f0;
  border: 1px solid #d3e2dc;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.result-item dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-item dd {
  margin: 2px 0 0;
}

.result-story {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 18px 20px;
  background: var(--paper);
  border-left: 3px solid var(--ember);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
}

.result-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.copy-status {
  align-self: center;
  color: var(--moss);
  font-size: 0.86rem;
}

.section {
  padding: 100px 0;
}

.section-compact {
  padding: 76px 0;
}

.section-dark {
  color: #f5f2e8;
  background: var(--night);
}

.section-inner {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 48px;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-dark .section-heading p:not(.eyebrow) {
  color: rgba(245, 242, 232, 0.7);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.step {
  padding: 28px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.step-number {
  width: 42px;
  height: 42px;
  margin-bottom: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--moss);
  border-radius: 50%;
  font-family: Georgia, serif;
}

.step p,
.fact-card p,
.example-card p {
  margin: 0;
  color: var(--muted);
}

.facts-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}

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

.fact-card {
  padding: 23px 24px;
  color: var(--ink);
  background: #fff;
  border-radius: var(--radius-md);
}

.name-formula {
  position: sticky;
  top: 32px;
  padding: 34px;
  color: #f5f2e8;
  background: var(--night-deep);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.formula-line {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  font-size: 1.28rem;
  text-align: center;
}

.formula-box {
  padding: 15px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
}

.formula-caption {
  color: rgba(245, 242, 232, 0.65);
  font-size: 0.86rem;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.example-card {
  min-height: 260px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.example-card strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.example-card .tag {
  align-self: flex-start;
}

.faq-list {
  max-width: 860px;
  margin: 0 auto;
}

.faq-list details {
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.22rem;
  font-weight: 650;
}

.faq-list details p {
  margin: 12px 36px 0 0;
  color: var(--muted);
}

.page-hero {
  padding: 76px 0 66px;
  color: #f8f4ea;
  background:
    radial-gradient(circle at 76% 20%, rgba(142, 179, 166, 0.2), transparent 30%),
    var(--night);
}

.page-hero-inner {
  width: min(calc(100% - 40px), 900px);
  margin: 0 auto;
}

.page-hero h1 {
  max-width: 830px;
  font-size: clamp(2.7rem, 5vw, 5rem);
}

.page-hero p:last-child {
  max-width: 700px;
  margin: 22px 0 0;
  color: rgba(248, 244, 234, 0.7);
}

.prose {
  width: min(calc(100% - 40px), 820px);
  margin: 0 auto;
  padding: 78px 0 100px;
}

.prose h2 {
  margin-top: 58px;
  font-size: 2rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 30px;
}

.prose p,
.prose li {
  color: #3f504c;
}

.prose li + li {
  margin-top: 7px;
}

.prose .callout {
  margin: 34px 0;
  padding: 22px 24px;
  background: #fff;
  border-left: 3px solid var(--ember);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
}

.prose .callout p {
  margin: 0;
}

.definition-list {
  display: grid;
  gap: 16px;
}

.definition-list div {
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.definition-list dt {
  font-weight: 800;
}

.definition-list dd {
  margin: 5px 0 0;
  color: var(--muted);
}

.site-footer {
  color: rgba(248, 244, 234, 0.74);
  background: var(--night-deep);
}

.footer-inner {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 54px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 48px;
}

.footer-title {
  margin: 0 0 10px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.4rem;
}

.footer-copy {
  max-width: 490px;
  margin: 0;
}

.footer-heading {
  margin: 0 0 12px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.site-footer a {
  color: rgba(248, 244, 234, 0.74);
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 42px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.footer-bottom p {
  margin: 0;
}

.noscript {
  margin: 0;
  padding: 12px 20px;
  color: #fff;
  background: #7d3d27;
  text-align: center;
}

.error-page {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  color: #f8f4ea;
  background:
    radial-gradient(circle at 70% 30%, rgba(142, 179, 166, 0.2), transparent 33%),
    var(--night-deep);
}

.error-content {
  width: min(calc(100% - 40px), 700px);
  padding: 80px 0;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--ember);
  font-family: Georgia, serif;
  font-size: clamp(5rem, 17vw, 11rem);
  line-height: 0.85;
}

.error-content h1 {
  margin-top: 24px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.error-content p {
  margin: 18px auto 28px;
  color: rgba(248, 244, 234, 0.72);
}

.error-content .primary-button {
  width: auto;
  margin: 0;
  text-decoration: none;
}

/* Theme discovery and individual generator pages */
.finder-hero {
  padding: 78px 0 90px;
  color: #f8f4ea;
  background:
    radial-gradient(circle at 78% 20%, rgba(142, 179, 166, 0.22), transparent 30%),
    linear-gradient(140deg, var(--night-deep), #19443e);
}

.finder-inner,
.theme-hero-inner,
.theme-layout,
.catalog-inner {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.finder-hero h1,
.theme-hero h1 {
  max-width: 900px;
}

.finder-hero .hero-lead {
  max-width: 760px;
}

.finder-box {
  max-width: 820px;
  margin-top: 34px;
  padding: 10px;
  display: flex;
  gap: 10px;
  color: var(--ink);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.finder-box input,
.catalog-search input {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9cec9;
  border-radius: 9px;
}

.finder-box a {
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--ember-dark);
  border-radius: 9px;
  font-weight: 760;
  text-decoration: none;
}

.finder-box .primary-button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.category-grid,
.theme-card-grid,
.theme-results,
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-card,
.theme-link-card,
.theme-result-card,
.related-card {
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.category-card {
  display: flex;
  flex-direction: column;
}

.category-card h3,
.theme-link-card h3,
.related-card h3 {
  font-size: 1.22rem;
}

.category-card p,
.theme-link-card p,
.related-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.category-card a,
.theme-link-card a,
.related-card a {
  margin-top: auto;
  font-weight: 780;
}

.catalog-hero {
  padding: 64px 0 50px;
  color: #f8f4ea;
  background: var(--night);
}

.catalog-hero h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
  overflow-wrap: anywhere;
}

.catalog-search {
  max-width: 720px;
  margin-top: 28px;
}

.catalog-search label {
  margin-bottom: 8px;
  display: block;
  font-weight: 750;
}

.catalog-search input {
  width: 100%;
}

.catalog-status {
  margin: 10px 0 0;
  color: rgba(248, 244, 234, 0.7);
  font-size: 0.9rem;
}

.catalog-body {
  padding: 70px 0 100px;
}

.category-jump-list {
  margin: 0 0 58px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.category-jump-list a,
.pill-link {
  padding: 7px 11px;
  display: inline-block;
  color: var(--night);
  background: var(--paper-deep);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 730;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.catalog-section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.catalog-section-header {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  gap: 32px;
}

.catalog-section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.catalog-section-header p {
  margin: 0;
  color: var(--muted);
}

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

.theme-link-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.theme-link-card[hidden],
.catalog-section[hidden] {
  display: none;
}

.theme-hero {
  padding: 42px 0 78px;
  color: #f8f4ea;
  background:
    radial-gradient(circle at 85% 22%, rgba(218, 189, 125, 0.14), transparent 28%),
    linear-gradient(145deg, var(--night-deep), #173d38);
}

.breadcrumbs {
  margin-bottom: 34px;
  color: rgba(248, 244, 234, 0.66);
  font-size: 0.88rem;
}

.breadcrumbs a {
  color: inherit;
}

.theme-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(460px, 1.15fr);
  gap: 58px;
  align-items: start;
}

.theme-hero h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
}

.theme-generator-card {
  overflow: hidden;
  color: var(--ink);
  background: #f8f6ef;
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.25);
}

.theme-generator-card form {
  padding: 27px;
}

.theme-results {
  padding: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--paper-deep);
}

.theme-result-card {
  padding: 18px;
  background: #fff;
}

.theme-result-card > p:first-child {
  margin: 0 0 5px;
  color: var(--ember-dark);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-result-card h3 {
  outline: none;
}

.theme-result-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.text-button {
  padding: 0;
  color: var(--ember-dark);
  background: transparent;
  border: 0;
  font-weight: 780;
  cursor: pointer;
}

.theme-content {
  padding: 80px 0 100px;
}

.theme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 70px;
}

.theme-article > section {
  margin-bottom: 62px;
}

.theme-article h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.theme-article p,
.theme-article li {
  max-width: 760px;
}

.tip-list {
  padding: 0;
  display: grid;
  gap: 15px;
  list-style: none;
}

.tip-list li {
  padding: 18px 20px;
  background: #fff;
  border-left: 4px solid var(--moss);
  border-radius: 0 12px 12px 0;
}

.example-name-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.worksheet-grid article {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.worksheet-grid span {
  color: var(--ember-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.worksheet-grid h3 {
  margin-top: 8px;
}

.worksheet-grid p {
  margin: 0;
  color: var(--muted);
}

.example-name-list article {
  padding: 22px;
  background: var(--paper-deep);
  border-radius: 14px;
}

.example-name-list p {
  margin: 8px 0 0;
  color: var(--muted);
}

.theme-sidebar {
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 22px;
  background: var(--night);
  border-radius: 18px;
}

.theme-sidebar h2 {
  color: #fff;
  font-size: 1.25rem;
}

.theme-sidebar ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.theme-sidebar a {
  color: var(--glacier);
}

.theme-disclaimer {
  padding: 18px 20px;
  color: #68422f;
  background: #f1dfca;
  border-radius: 12px;
}

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

  .theme-hero-grid,
  .theme-layout {
    grid-template-columns: 1fr;
  }

  .theme-sidebar {
    position: static;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 76px;
    right: 20px;
    left: 20px;
    display: none;
    padding: 18px;
    background: var(--night-deep);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    padding: 10px 8px;
    display: block;
  }

  .site-nav a[aria-current="page"] {
    text-underline-offset: 4px;
  }

  .hero-grid {
    width: 100%;
    max-width: var(--max-width);
    padding-right: 20px;
    padding-left: 20px;
    grid-template-columns: 1fr;
    gap: 42px;
    padding-top: 60px;
  }

  .hero-copy {
    max-width: 760px;
  }

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

  .name-formula {
    position: static;
  }

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

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .header-inner,
  .section-inner,
  .footer-inner,
  .page-hero-inner,
  .prose {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-grid {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand {
    font-size: 1.12rem;
  }

  .hero-grid {
    padding: 50px 14px 94px;
  }

  .generator-form,
  .result-panel {
    padding: 22px;
  }

  .field-grid,
  .result-details,
  .steps,
  .examples-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .range-line {
    grid-template-columns: 62px 1fr 76px;
    gap: 8px;
  }

  .section {
    padding: 76px 0;
  }

  .section-heading {
    margin-bottom: 34px;
  }

  .result-story {
    grid-column: auto;
  }

  .formula-line {
    grid-template-columns: 1fr;
  }

  .formula-plus {
    transform: rotate(90deg);
  }

  .footer-grid > :first-child {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .finder-inner,
  .theme-hero-inner,
  .theme-layout,
  .catalog-inner {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .finder-box {
    align-items: stretch;
    flex-direction: column;
  }

  .finder-box a {
    justify-content: center;
  }

  .category-grid,
  .theme-card-grid,
  .theme-results,
  .related-grid,
  .example-name-list,
  .worksheet-grid,
  .catalog-section-header {
    grid-template-columns: 1fr;
  }

  .theme-generator-card form,
  .theme-results {
    padding: 18px;
  }

  .catalog-hero h1 {
    font-size: clamp(2.1rem, 10vw, 3rem);
  }

  .category-jump-list > li {
    min-width: 0;
    max-width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
