:root {
  color-scheme: light;
  --paper: #f7f3e9;
  --ink: #15372d;
  --muted: #4d5e53;
  --rust: #9a4223;
  --line: #c9cbbd;
  --sage: #dce5d6;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.6 var(--sans);
}

a { color: inherit; }
a:focus-visible { outline: 3px solid var(--rust); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }

.frame { width: min(calc(100% - 3rem), 74rem); margin-inline: auto; }

.theme-preview:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  padding: .45rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}

.theme-preview a {
  padding: .25rem .65rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  font-weight: 700;
  text-decoration: none;
}

.theme-preview a[aria-current="page"] {
  border-color: var(--ink);
}

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.75rem;
}

.site-header { border-bottom: 1px solid var(--line); }

.wordmark {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.wordmark strong { color: var(--rust); }
.text-link { font-size: .9rem; font-weight: 650; text-underline-offset: .25em; }

.hero {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
  padding-block: clamp(3rem, 7vw, 6.5rem);
}

.hero-copy, .preview { min-width: 0; }

.product-name {
  color: var(--rust);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2 { font-family: var(--serif); font-weight: 500; }

h1 {
  max-width: 12ch;
  margin-block: .75rem 1.25rem;
  font-size: clamp(3rem, 6.3vw, 5.9rem);
  letter-spacing: -.065em;
  line-height: .99;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4.3vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.lead {
  max-width: 32rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.5;
}

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-block: 1.8rem .85rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.15rem;
  padding: .65rem 1rem;
  border: 1px solid var(--ink);
  border-radius: .35rem;
  font-size: .94rem;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: #244a3e; }
.button-secondary:hover { background: #e9e7db; }
.format, figcaption, .site-footer p { color: var(--muted); font-size: .9rem; }

.preview-surface {
  position: relative;
  overflow: hidden;
  min-height: 19rem;
  aspect-ratio: 1.14;
  border-radius: .6rem;
  background: #294d40;
}

.preview-sheet {
  position: absolute;
  width: 52%;
  border: 1px solid #d0d5ce;
  box-shadow: 0 .75rem 1.5rem #122b2450;
}

.preview-sheet-back { top: 9%; left: 37%; transform: rotate(8deg); }
.preview-sheet-front { top: 17%; left: 12%; transform: rotate(-6deg); }
figcaption { margin-top: .6rem; }

.story {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.story-copy { max-width: 42rem; font-size: 1.08rem; }
.story-copy p + p { margin-top: 1rem; }

.example { background: var(--sage); }

.example-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: start;
  gap: clamp(2rem, 7vw, 6rem);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.example h2 { margin-block: .65rem 1rem; }
.example-copy { max-width: 31rem; color: var(--muted); }
.repair { border-top: 1px solid #a4b5a6; }
.repair div { padding-block: .9rem; border-bottom: 1px solid #a4b5a6; }
.repair dt { margin-bottom: .2rem; font-weight: 750; }
.repair dd { color: #334a3e; }

.inside { padding-block: clamp(2.5rem, 6vw, 5rem); }

.files {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 1.65rem;
}

.files article { border-top: 1px solid var(--line); padding-top: 1rem; }
.files h3 { margin-bottom: .45rem; font-size: 1.12rem; line-height: 1.35; }
.files p { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); padding-block: 1rem; }

@media (max-width: 48rem) {
  .frame { width: min(calc(100% - 2rem), 42rem); }
  .hero, .story, .example-layout, .files { grid-template-columns: 1fr; }
  .hero { gap: 1.9rem; }
  h1 { max-width: 15ch; }
  .preview-surface { max-height: 26rem; }
  .story, .example-layout { gap: 1.25rem; }
  .files { gap: 1.3rem; }
}

@media (max-width: 25rem) {
  .actions { align-items: stretch; flex-direction: column; }
  .preview-surface { min-height: 15rem; }
  .site-footer { align-items: start; flex-direction: column; gap: .25rem; }
}
