.skip-link {
  position: fixed;
  top: -100%;
  left: 8px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-soft: #f2f6f1;
  --surface-strong: #e7eee5;
  --text: #171917;
  --text-soft: #596258;
  --text-muted: #606c60;
  --border: #d6ded2;
  --primary: #111111;
  --primary-hover: #30342f;
  --accent: #1b7f63;
  --accent-hover: #15705a;
  --accent-soft: rgba(27, 127, 99, 0.1);
  --success: #26775f;
  --shadow-sm: 0 1px 4px rgba(26, 38, 29, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 38, 29, 0.08);
  --shadow-lg: 0 24px 80px rgba(26, 38, 29, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

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

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 380px), var(--bg);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.page-shell { width: min(100%, 1480px); margin: 0 auto; padding: 24px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 56px; margin-bottom: 24px;
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text); font-size: 15px; font-weight: 800;
  letter-spacing: 0; text-decoration: none;
}

.brand-name { font-weight: 800; }

.brand-tagline {
  display: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

@media (min-width: 600px) {
  .brand { gap: 12px; }
  .brand-tagline { display: inline; }
  .brand-tagline::before {
    content: "\00b7";
    margin-right: 12px;
    color: var(--border);
  }
}

.brand-mark {
  width: 32px; height: 32px;
  border: 1px solid #23211f; border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: grid; place-items: center;
  color: #fff; font-family: "Dancing Script", serif;
  font-size: 20px; font-weight: 700; font-style: italic;
}
.brand-mark::after { content: "a"; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-nav {
  display: none;
}
.topbar-nav a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.topbar-nav a:hover,
.topbar-nav a:focus-visible {
  color: var(--text);
  background: var(--border);
}
.topbar-nav a[aria-current="page"] {
  color: var(--accent);
}
@media (min-width: 700px) {
  .topbar-nav { display: flex; align-items: center; gap: 4px; }
}

.hero { margin-bottom: 32px; }

.hero-eyebrow {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}

.hero-title { margin: 0 0 10px; }

.hero-desc {
  margin: 0;
  max-width: 660px;
  color: var(--text-soft);
  font-size: 15px; line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 24px; align-items: stretch;
}

.preview-pane, .control-pane { min-width: 0; }
.preview-pane { display: flex; flex-direction: column; gap: 16px; }

.preview-header {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.08; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; }
h3, h4, p { letter-spacing: 0; }
h3 { margin: 0; font-size: 24px; line-height: 1.18; font-weight: 800; }
h2, h3, h4 { scroll-margin-top: 32px; }
h4 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 800; }
p { margin: 0; }

.intent-strip {
  color: var(--text-soft); font-size: 13px; line-height: 1.4;
  margin-top: 6px;
}

.paper-stage {
  position: relative; display: grid; place-items: center;
  min-height: 660px; padding: 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #edf3ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -24px 60px rgba(37, 83, 65, 0.08),
    var(--shadow-lg);
  overflow: hidden;
}

.preview-stage-label {
  position: absolute; top: 12px; left: 12px;
  margin: 0; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}

#cursiveCanvas {
  display: block; width: auto; max-width: 100%;
  max-height: min(76vh, 760px);
  border: 1px solid rgba(23, 25, 23, 0.1); border-radius: 3px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 32px 70px rgba(26, 38, 29, 0.2);
}

.preview-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-size {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-download-btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.status-row {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 24px; color: var(--text-soft); font-size: 13px; font-weight: 700;
}

.status-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--success); box-shadow: 0 0 0 4px rgba(38, 119, 95, 0.14);
}

.control-pane {
  align-self: start; position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 48px); overflow-y: auto; overflow-x: hidden;
  padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 60px rgba(26, 38, 29, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .control-pane { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.control-pane-header { padding: 16px 20px 8px; }
.control-pane-header .eyebrow { margin-bottom: 4px; }
.control-pane-header h2 { margin-bottom: 8px; }

.control-pane-desc {
  color: var(--text-soft);
  font-size: 13px; line-height: 1.5;
  font-weight: 500;
}

.quick-settings { padding: 0 20px; }

.quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-field { display: grid; gap: 6px; }

.quick-label {
  color: var(--text-soft);
  font-size: 12px; font-weight: 800;
}

.control-section {
  display: grid; gap: 16px; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}

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

.field, .range-field, .colour-field { display: grid; gap: 8px; }
.field > span, .colour-field > span, .segmented-field legend {
  color: var(--text-soft); font-size: 13px; font-weight: 800;
}

select {
  width: 100%; min-height: 44px; padding: 0 36px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
    linear-gradient(135deg, var(--text-soft) 50%, transparent 50%),
    var(--surface-soft);
  background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px, 100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
  appearance: none;
}

.segmented-field { min-width: 0; margin: 0; padding: 0; border: 0; }

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px; min-height: 44px; margin-top: 8px; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented-control.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-control.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.segmented-control label { min-width: 0; }
.segmented-control input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }

.segmented-control span {
  display: grid; place-items: center; min-height: 34px;
  border-radius: 6px; color: var(--text-soft);
  font-size: 13px; font-weight: 800;
}

.segmented-control input:checked + span {
  color: var(--text); background: var(--surface);
  box-shadow: 0 1px 8px rgba(26, 38, 29, 0.1);
}

.range-field > span {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; color: var(--text); font-size: 13px;
}

.range-field strong { font-weight: 800; }

output {
  flex: 0 0 auto; color: var(--text-soft);
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}

input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--primary); }

.range-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.range-select { display: grid; gap: 4px; }
.range-select > span { color: var(--text-soft); font-size: 12px; font-weight: 800; }
.range-select select { width: 100%; min-height: 40px; padding: 0 28px 0 10px; font-size: 14px; }

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

.colour-field { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); }

input[type="color"] { width: 100%; min-width: 0; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}

.primary-button:active, .ghost-button:active { transform: translateY(1px); }

.primary-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes download-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.primary-button.downloading {
  animation: download-pulse 0.3s ease;
}

.small-primary { display: inline-flex; padding: 0 14px; }

.download-button { width: 100%; }

.download-panel {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.download-panel .primary-button {
  min-height: 52px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.download-panel .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-actions .ghost-button {
  width: 100%;
  min-height: 44px;
  font-size: 13px;
}

.trust-line {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
}

.ghost-button:hover { border-color: #bbc9b7; background: var(--surface); }

.content-band {
  display: grid; gap: 32px;
  margin-top: 64px; padding-top: 48px;
  border-top: 1px solid var(--border);
}

.content-intro { max-width: 760px; }
.content-intro h2 { margin-bottom: 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; }
.content-intro p, .copy-section p, .size-panel p, .size-panel li {
  color: var(--text-soft); font-size: 15px; line-height: 1.55;
}
.content-intro p + p { margin-top: 10px; }

.content-meta {
  margin: 6px 0 12px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
}

.blog-byline {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px; align-items: start;
}

.guide-main { display: grid; gap: 40px; min-width: 0; }
.copy-section { display: grid; gap: 20px; }
.copy-heading { display: grid; gap: 4px; }
.copy-heading .eyebrow { margin: 0; }

.text-stack { display: grid; gap: 12px; max-width: 980px; }

.text-stack a {
  display: inline-block;
  padding: 6px 0;
  min-height: 44px;
  align-content: center;
}

.feature-list {
  display: grid; gap: 8px;
  margin: 0; padding-left: 18px;
  color: var(--text-soft); font-size: 15px; line-height: 1.55;
}

.guide-side { display: grid; gap: 12px; }

.size-panel {
  display: grid; gap: 12px; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.size-panel .eyebrow { margin: 0; }
.size-panel ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; }

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

.type-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .control-pane { position: static; max-height: none; overflow: visible; }
  .paper-stage { min-height: 560px; }
  .guide-layout { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .page-shell { padding: 16px; }
  .topbar { align-items: flex-start; }
  .brand-tagline { display: none; }
  .hero { margin-bottom: 24px; }
  .preview-header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 32px; }
  .paper-stage { min-height: 430px; padding: 16px; }
  .preview-actions { position: static; margin-top: 12px; }
  #cursiveCanvas { max-height: 58vh; }
  .control-section { padding: 16px; }
  details.control-section { padding: 0; }
  .control-pane-header { padding: 12px 16px 4px; }
  .quick-settings { padding: 0 16px; }
  .quick-row { grid-template-columns: 1fr; }
  .download-panel { padding: 16px; }
  .download-panel .primary-button { font-size: 15px; min-height: 48px; }
  .secondary-actions { gap: 6px; }
  .secondary-actions .ghost-button { min-height: 44px; font-size: 12px; }
  .colour-grid { grid-template-columns: 1fr; }
  .content-band { margin-top: 48px; padding-top: 32px; }
  .content-intro h2 { font-size: 28px; }
  .type-grid { grid-template-columns: 1fr; }
  .type-grid article { min-height: 0; }
}

#breadcrumbs { margin-bottom: 16px; }
#breadcrumbs nav ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border);
}
#breadcrumbs a { color: var(--text-soft); text-decoration: none; }
#breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
#breadcrumbs [aria-current="page"] { color: var(--text); }

.hub-card-grid {
  margin: 32px 0;
}

.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.silo-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.silo-group .hub-cards-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.hub-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 0.15s;
}

.hub-card:hover { box-shadow: var(--shadow-sm); }

.hub-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.hub-card h3 a { color: var(--text); text-decoration: none; display: inline-block; padding: 6px 0; min-height: 44px; align-content: center; }
.hub-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.hub-card p { font-size: 13px; color: var(--text-soft); line-height: 1.4; margin: 0; }

.site-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.footer-column h3 {
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.footer-column a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
  display: inline-block;
  padding: 6px 0;
  min-height: 48px;
  line-height: 1.3;
  align-content: center;
}

.footer-column a:hover { text-decoration: underline; }

.footer-column a em {
  font-style: normal;
  color: var(--text);
  font-weight: 700;
}

.footer-bottom {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

details summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

details p {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

details a {
  display: inline-block;
  margin-top: 8px;
  font-weight: 800;
  font-size: 13px;
}

details.control-section {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease;
}

details.control-section summary {
  position: relative;
  padding: 16px 44px 16px 20px;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  transition: background-color 120ms ease;
}

details.control-section summary::-webkit-details-marker { display: none; }

details.control-section summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--text-soft);
  border-bottom: 2px solid var(--text-soft);
  transform: rotate(45deg);
  transition: transform 200ms ease, margin-top 200ms ease;
}

details.control-section[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

details.control-section summary:hover { background: var(--surface-soft); }
details.control-section summary:active { background: var(--surface-strong); }

details.control-section[open] summary {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.control-section-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.control-section-body {
  padding: 16px 20px 20px;
  display: grid;
  gap: 16px;
}

.silo-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.silo-group + .silo-group {
  margin-top: 20px;
}

.stage-progression {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stage-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.stage-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stage-link.prev { margin-right: auto; }
.stage-link.next { margin-left: auto; }

.handoff-section {
  margin-top: 8px;
}

.handoff-primary {
  text-align: center;
}

.handoff-button {
  display: inline-flex;
  min-height: 48px;
  padding: 0 28px;
  font-size: 15px;
  text-decoration: none;
}

.noscript-notice {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 20px 24px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: #664d03;
}
.noscript-notice p { margin: 0 0 8px; }
.noscript-notice p:last-child { margin-bottom: 0; }

@media (max-width: 460px) {
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .ghost-button, .small-primary { min-height: 40px; padding: 0 10px; font-size: 13px; }
}

