:root {
  --paper: #f3ead8;
  --paper-light: #fbf6eb;
  --paper-deep: #e6d7bd;
  --ink: #241e1a;
  --ink-soft: #63584f;
  --ink-faint: #6f6258;
  --oxblood: #6f2632;
  --oxblood-dark: #551b25;
  --brass: #9a7338;
  --line: rgba(36, 30, 26, 0.22);
  --line-strong: rgba(36, 30, 26, 0.42);
  --surface: rgba(255, 251, 242, 0.68);
  --focus: #274b80;
  --error: #9b252d;
  --success: #275542;
  --shadow-1: 0 12px 28px rgba(66, 46, 29, 0.09);
  --shadow-2: 0 22px 55px rgba(66, 46, 29, 0.14);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Libre Baskerville", Georgia, serif;
  --motion: 280ms cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 4%, rgba(255, 255, 255, 0.75), transparent 30rem),
    linear-gradient(rgba(111, 38, 50, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 8px, auto;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label:has(input) {
  touch-action: manipulation;
}

button,
a,
label:has(input),
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-color: rgba(36, 30, 26, 0.38);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

::selection {
  color: var(--paper-light);
  background: var(--oxblood);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--paper-light);
  background: var(--ink);
  transform: translateY(-140%);
  transition: transform var(--motion);
}

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

.site-header,
main,
footer {
  width: min(100% - 40px, 1280px);
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.brand svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-header nav a,
.header-note {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-header nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.site-header nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform var(--motion);
}

.site-header nav a:hover::after,
.site-header nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-note {
  justify-self: end;
  color: var(--oxblood);
}

.intro {
  padding: clamp(72px, 10vw, 144px) 0 clamp(64px, 8vw, 104px);
  text-align: center;
}

.eyebrow,
.kicker {
  color: var(--oxblood);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow-mark {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.intro h1 {
  max-width: 900px;
  margin: 22px auto 24px;
  font-family: var(--display);
  font-size: clamp(56px, 8vw, 112px);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.intro > p {
  max-width: 690px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
}

.intro-meta {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro-meta span,
.local-note,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.intro-meta svg,
.local-note svg,
.status-pill svg,
.button svg,
.dialog-close svg,
.faq-list summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.maker {
  margin-bottom: 112px;
  border-top: 1px solid var(--line-strong);
}

.maker-heading {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 6px;
}

.maker-heading h2,
.value-section h2,
.printing-copy h2,
.faq-section h2,
dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.local-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(370px, 0.8fr) minmax(520px, 1.2fr);
  min-height: 850px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.controls {
  border-right: 1px solid var(--line-strong);
}

.control-section {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 54px 1fr;
  border-bottom: 1px solid var(--line);
}

.section-number {
  padding-top: 34px;
  color: var(--oxblood);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  border-right: 1px solid var(--line);
}

.section-body {
  min-width: 0;
  padding: 30px;
}

.field-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 9px;
}

.field-heading label,
.label-like,
.sheet-choice label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-heading > span,
.field-heading label span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.68);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--motion), box-shadow var(--motion), background var(--motion);
}

input[type="text"] {
  padding: 11px 13px;
  font-family: var(--display);
  font-size: 21px;
}

input[type="text"]:hover,
select:hover {
  border-color: var(--ink-soft);
}

input[type="text"]:focus,
select:focus {
  background: var(--paper-light);
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(39, 75, 128, 0.14);
  outline: none;
}

.field-help {
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.5;
}

.motto-heading {
  margin-top: 24px;
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.style-card {
  position: relative;
  min-height: 96px;
  padding: 11px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255, 252, 245, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--motion), background var(--motion), transform var(--motion);
}

.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.font-card {
  position: relative;
  min-height: 82px;
  padding: 10px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255, 252, 245, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--motion), background var(--motion), transform var(--motion);
}

.style-card:hover,
.font-card:hover {
  background: rgba(255, 252, 245, 0.92);
  border-color: var(--line-strong);
}

.style-card:active,
.font-card:active {
  transform: scale(0.985);
}

.style-card:has(input:checked),
.font-card:has(input:checked) {
  background: var(--paper-light);
  border-color: var(--oxblood);
  box-shadow: inset 0 0 0 1px var(--oxblood);
}

.style-card:has(input:focus-visible),
.font-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.style-card input,
.font-card input,
.segmented input,
.swatches input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-sample {
  width: 52px;
  height: 60px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 26px;
}

.atelier-sample {
  font-style: italic;
  background:
    radial-gradient(circle at 25% 24%, var(--ink) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 70%, var(--ink) 0 1px, transparent 2px),
    var(--paper);
}

.gothic-sample {
  color: var(--paper-light);
  background: var(--ink);
  font-weight: 600;
}

.botanical-sample {
  color: #25463a;
  background: #edf0e3;
  border-radius: 28px 28px 3px 3px;
}

.vintage-sample {
  font-family: var(--body);
  font-size: 16px;
  letter-spacing: -0.05em;
  background: #ede1c8;
  border-style: double;
  border-width: 3px;
}

.font-sample {
  width: 52px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 24px;
  line-height: 1;
}

.font-cormorant {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 28px;
}

.font-baskerville {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 19px;
}

.font-garamond {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 28px;
}

.font-cinzel {
  font-family: "Cinzel", Georgia, serif;
  font-size: 19px;
  letter-spacing: 0.04em;
}

.style-card strong,
.style-card small,
.font-card strong,
.font-card small {
  display: block;
}

.style-card strong,
.font-card strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.style-card small,
.font-card small {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.style-card .check,
.font-card .check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  padding: 2px;
  color: var(--paper-light);
  background: var(--oxblood);
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--motion), transform var(--motion);
}

.style-card:has(input:checked) .check,
.font-card:has(input:checked) .check {
  opacity: 1;
  transform: scale(1);
}

.compact-section {
  border-bottom: 0;
}

.options-body {
  display: grid;
  gap: 22px;
}

.option-group {
  min-width: 0;
}

.option-group > .label-like {
  display: block;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented span {
  min-height: 44px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--paper-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--motion), background var(--motion);
}

.segmented label:hover span {
  background: #fffaf1;
}

.segmented input:checked + span {
  color: var(--paper-light);
  background: var(--ink);
}

.segmented input:focus-visible + span {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.swatch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.swatches {
  display: flex;
  align-items: center;
  gap: 9px;
}

.swatches label {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.swatches label > span {
  width: 28px;
  height: 28px;
  display: block;
  background: var(--swatch);
  border: 1px solid rgba(36, 30, 26, 0.34);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.28);
  transition: transform var(--motion), box-shadow var(--motion);
}

.swatches input:checked + span {
  transform: scale(0.88);
  box-shadow: 0 0 0 2px var(--paper-light), 0 0 0 4px var(--oxblood);
}

.swatches input:checked + span::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--paper-light);
  border-left: 2px solid var(--paper-light);
  transform: rotate(-45deg);
  filter: drop-shadow(0 1px 1px var(--ink));
}

.swatches input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.preview-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, transparent 0 49%, rgba(36, 30, 26, 0.022) 49% 51%, transparent 51%) 0 0 / 13px 13px,
    rgba(229, 215, 190, 0.42);
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.preview-toolbar h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.status-pill {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--oxblood);
  background: rgba(255, 250, 240, 0.6);
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.unlocked {
  color: var(--success);
}

.preview-stage {
  width: min(100%, 760px);
  margin: clamp(28px, 5vw, 52px) auto;
  padding: clamp(14px, 2.3vw, 26px);
  position: relative;
  background: #d2c2a7;
  border: 1px solid rgba(36, 30, 26, 0.34);
  box-shadow: var(--shadow-2);
}

.preview-stage::before,
.preview-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.preview-stage::before {
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.preview-stage::after {
  width: 42%;
  height: 8px;
  right: 29%;
  bottom: -10px;
  background: rgba(36, 30, 26, 0.12);
  filter: blur(8px);
}

#bookplate {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2;
  background: #f5eddd;
  transition: opacity 160ms ease-out;
}

#bookplate.updating {
  opacity: 0.82;
}

.pack-card {
  margin-top: auto;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 24px;
  align-items: end;
  background: rgba(255, 251, 242, 0.86);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
}

.pack-copy h4 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.1;
}

.pack-copy h4 span {
  margin-left: 8px;
  color: var(--oxblood);
  font-family: var(--body);
  font-size: 17px;
}

.pack-copy ul {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 17px;
  list-style: none;
  color: var(--ink-soft);
  font-size: 10px;
}

.pack-copy li::before {
  content: "·";
  margin-right: 6px;
  color: var(--oxblood);
  font-weight: 700;
}

.sheet-choice {
  min-width: 126px;
}

.sheet-choice label {
  display: block;
  margin-bottom: 6px;
}

.sheet-choice select {
  padding: 8px 34px 8px 10px;
  font-size: 12px;
}

.export-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 0.75fr);
  gap: 8px;
}

.export-actions.unlocked {
  grid-template-columns: repeat(3, 1fr);
}

.export-actions.unlocked .primary {
  display: none;
}

.button {
  min-height: 50px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--motion), background var(--motion), border-color var(--motion), transform var(--motion), box-shadow var(--motion);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button.primary {
  color: var(--paper-light);
  background: var(--oxblood);
  border-color: var(--oxblood);
  box-shadow: 0 7px 18px rgba(111, 38, 50, 0.17);
}

.button.primary:hover {
  background: var(--oxblood-dark);
  border-color: var(--oxblood-dark);
}

.button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

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

.export-button {
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.export-button small {
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.pack-note {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  text-align: center;
}

.toast {
  min-height: 26px;
  padding-top: 8px;
  color: var(--success);
  font-size: 11px;
  text-align: center;
}

.value-section,
.printing-section,
.faq-section {
  padding: 112px 0;
  border-top: 1px solid var(--line-strong);
}

.value-section > div:first-child,
.faq-section > div:first-child {
  max-width: 680px;
}

.value-grid {
  margin-top: 62px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.value-grid article {
  min-height: 250px;
  padding: 28px;
  border-right: 1px solid var(--line);
}

.value-grid article:last-child {
  border-right: 0;
}

.value-grid article > span {
  color: var(--oxblood);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.value-grid h3 {
  margin: 54px 0 12px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
}

.value-grid p,
.printing-copy li p,
.faq-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.printing-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
}

.printing-illustration {
  min-height: 560px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(36, 30, 26, 0.12) 0 1px, transparent 1.5px) 0 0 / 13px 13px,
    rgba(255, 251, 242, 0.38);
  border: 1px solid var(--line);
}

.sheet {
  width: 62%;
  aspect-ratio: 1 / 1.414;
  padding: 8%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5%;
  background: var(--paper-light);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: rotate(-3deg);
}

.sheet span {
  display: block;
  border: 1px solid var(--ink-soft);
  background:
    radial-gradient(ellipse at 50% 38%, transparent 0 24%, var(--ink) 25% 26%, transparent 27%),
    linear-gradient(var(--ink), var(--ink)) 50% 73% / 42% 1px no-repeat;
  opacity: 0.64;
}

.printing-copy ol {
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.printing-copy li {
  padding: 22px 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.printing-copy li > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  background: var(--ink);
  border-radius: 50%;
  font-size: 10px;
}

.printing-copy strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--display);
  font-size: 20px;
}

.faq-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(48px, 8vw, 120px);
}

.faq-list {
  border-top: 1px solid var(--line-strong);
}

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

.faq-list summary {
  min-height: 72px;
  padding: 16px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary svg {
  transition: transform var(--motion);
}

.faq-list details[open] summary svg {
  transform: rotate(180deg);
}

.faq-list p {
  max-width: 620px;
  padding: 0 44px 22px 2px;
}

footer {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 11px;
}

.footer-brand {
  color: var(--ink);
}

footer p:last-child {
  justify-self: end;
}

dialog {
  width: min(92vw, 560px);
  padding: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
}

dialog::backdrop {
  background: rgba(36, 30, 26, 0.56);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  padding: clamp(30px, 6vw, 54px);
  position: relative;
}

.dialog-inner h2 {
  margin: 10px 0 18px;
  font-size: clamp(38px, 6vw, 52px);
}

.dialog-inner > p:not(.kicker) {
  color: var(--ink-soft);
  font-size: 13px;
}

.dialog-inner code {
  padding: 2px 5px;
  color: var(--ink);
  background: var(--paper-deep);
  border-radius: 3px;
  font-size: 12px;
}

.dialog-inner .button {
  width: 100%;
  margin-top: 16px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.dialog-close:hover {
  background: var(--paper-deep);
}

.dialog-note {
  margin-bottom: 0;
  text-align: center;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(330px, 0.72fr) minmax(440px, 1.28fr);
  }

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

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

  .style-card {
    min-height: 78px;
  }

  .style-sample {
    height: 50px;
  }

  .export-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .export-actions .primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-header nav {
    display: none;
  }

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

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

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

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

  .preview-panel {
    min-height: 860px;
  }

  .printing-section,
  .faq-section {
    grid-template-columns: 1fr;
  }

  .printing-illustration {
    min-height: 460px;
  }

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

  footer > p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1280px);
  }

  .site-header {
    min-height: 66px;
  }

  .brand {
    font-size: 18px;
  }

  .brand svg {
    width: 26px;
    height: 26px;
  }

  .header-note {
    font-size: 9px;
  }

  .intro {
    padding: 70px 0 62px;
  }

  .intro h1 {
    margin-top: 18px;
    font-size: clamp(50px, 17vw, 72px);
    line-height: 0.92;
  }

  .intro h1 br {
    display: none;
  }

  .intro > p {
    font-size: 16px;
  }

  .intro-meta {
    gap: 10px 18px;
    font-size: 9px;
  }

  .maker {
    margin-bottom: 72px;
  }

  .maker-heading {
    min-height: 128px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 13px;
  }

  .maker-heading h2,
  .value-section h2,
  .printing-copy h2,
  .faq-section h2 {
    font-size: 42px;
  }

  .control-section {
    grid-template-columns: 40px 1fr;
  }

  .section-number {
    padding-top: 28px;
  }

  .section-body {
    padding: 24px 18px;
  }

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

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

  .swatch-row {
    grid-template-columns: 1fr;
  }

  .segmented span {
    padding-inline: 3px;
    font-size: 9px;
    letter-spacing: 0.015em;
  }

  .preview-panel {
    min-height: 720px;
    padding: 22px 14px;
  }

  .preview-toolbar h3 {
    font-size: 28px;
  }

  .status-pill {
    padding: 6px 9px;
  }

  .preview-stage {
    margin: 30px auto;
    padding: 11px;
  }

  .pack-card {
    padding: 18px 14px;
    grid-template-columns: 1fr;
  }

  .sheet-choice {
    width: 100%;
  }

  .export-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .button {
    padding-inline: 8px;
    letter-spacing: 0.025em;
  }

  .value-section,
  .printing-section,
  .faq-section {
    padding: 78px 0;
  }

  .value-grid {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .value-grid article {
    min-height: auto;
    padding: 28px 2px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .value-grid article:last-child {
    border-bottom: 0;
  }

  .value-grid h3 {
    margin-top: 28px;
  }

  .printing-illustration {
    min-height: 390px;
  }

  .sheet {
    width: 68%;
  }

  .faq-list summary {
    font-size: 20px;
  }

  footer {
    min-height: 126px;
    gap: 12px;
  }

  footer p:last-child {
    text-align: right;
  }
}

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

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

@media print {
  body > *:not(main),
  main > *:not(.maker),
  .maker-heading,
  .controls,
  .preview-toolbar,
  .pack-card,
  .toast {
    display: none !important;
  }

  body,
  main,
  .maker,
  .workspace,
  .preview-panel,
  .preview-stage {
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    border: 0;
    box-shadow: none;
  }
}
