:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-soft: #fbf6ef;
  --border: #d6d0c6;
  --border-focus: #8b7e6a;
  --text: #2c2825;
  --text-muted: #736b61;
  --accent: #c85d3a;
  --accent-hover: #a84b2e;
  --accent-bg: #fdf0eb;
  --tag-bg: #ede8e0;
  --success: #356b4f;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-mono: "DM Mono", "Courier New", monospace;
  --radius: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(44, 40, 37, 0.06);
  --shadow-md: 0 8px 24px rgba(44, 40, 37, 0.08);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(circle at top, #fff8f2 0%, rgba(255, 248, 242, 0) 38%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 24px;
  top: -48px;
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
  z-index: 300;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner,
.footer-inner,
.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.site-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-nav a,
.site-nav summary,
.footer-links a {
  color: var(--text-muted);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav summary:hover,
.footer-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.site-nav summary::-webkit-details-marker {
  display: none;
}

.site-nav summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.nav-tools {
  position: relative;
}

.nav-tools[open] summary {
  color: var(--text);
}

.nav-tools-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: min(760px, calc(100vw - 48px));
  max-height: min(70vh, 720px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.nav-tools-menu a {
  color: var(--text);
  font-weight: 600;
}

.hero-block {
  padding: 40px 0 12px;
}

.hero-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  align-items: stretch;
}

.hero-card,
.mini-hero,
.hero-panel,
.cluster,
.flow-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(253, 240, 235, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  animation: riseIn 0.5s ease both;
}

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

.hero-panel {
  animation-delay: 0.08s;
}

.eyebrow,
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.hero-card h1,
.mini-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  max-width: 720px;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.hero-actions,
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 20px;
}

.hero-points {
  margin-top: 18px;
}

.hero-points span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-shortcuts {
  display: grid;
  gap: 12px;
}

.shortcut-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(214, 208, 198, 0.9);
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.shortcut-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.shortcut-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shortcut-card strong {
  font-size: 1.02rem;
  line-height: 1.15;
}

.shortcut-card small {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--tag-bg);
}

.button:focus-visible,
.tool-nav button:focus-visible,
textarea:focus-visible,
input:focus-visible,
.site-nav a:focus-visible,
.footer-links a:focus-visible {
  outline: 3px solid rgba(200, 93, 58, 0.2);
  outline-offset: 2px;
}

.section-gap {
  padding: 28px 0;
}

.dashboard-band {
  padding-top: 18px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-heading p,
.mini-hero p,
.prose-section p,
.prose-section li,
.tool-summary p,
.feature-card p,
.quick-card p,
.info-card p,
.tool-card .desc,
.example-copy,
.tool-page-layout p {
  color: var(--text-muted);
}

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

.cluster-grid,
.flow-grid {
  display: grid;
  gap: 16px;
}

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

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

.feature-card,
.quick-card,
.info-card,
.related-card,
.note-card,
.tool-page-layout,
.faq-list article,
.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.feature-card,
.quick-card,
.info-card,
.related-card,
.faq-list article,
.flow-card {
  padding: 20px;
}

.feature-card h3,
.quick-card h3,
.info-card h3,
.related-card h3,
.faq-list h3,
.tool-card h2,
.tool-page-layout h2,
.tool-page-layout h3 {
  margin: 0 0 8px;
  line-height: 1.15;
}

.feature-card h3 a,
.quick-card h3 a,
.related-card h3 a {
  color: var(--text);
}

.feature-card h3 a:hover,
.quick-card h3 a:hover,
.related-card h3 a:hover {
  color: var(--accent);
}

.cluster {
  padding: 22px;
}

.cluster h3,
.flow-card h3 {
  margin: 0 0 8px;
  line-height: 1.12;
}

.cluster-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.cluster-links a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

.cluster-links a::after {
  content: ">";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.cluster-links a:hover {
  text-decoration: none;
  border-color: var(--border-focus);
}

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

.quick-label,
.card-label {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.selected-files {
  margin-top: 10px;
}

.selected-files-label {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

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

.selected-files-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--border);
}

.selected-files-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.selected-files-remove {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.selected-files-remove:hover {
  text-decoration: underline;
}

.feature-card p + p,
.quick-card p + p {
  margin-top: 10px;
}

.feature-card strong,
.quick-card strong,
.tool-example strong,
.example-copy strong {
  color: var(--text);
}

.example-copy {
  margin: -2px 0 16px;
}

.tool-visual {
  margin: 4px 0 20px;
  padding: 18px 16px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tool-visual__title {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.tool-visual__media {
  max-width: min(100%, 680px);
  margin: 0 auto;
}

.tool-visual__media img {
  display: block; /* removes inline baseline gap */
  width: 100%;
  height: auto;
  /* SVGs are 640×200 — enforce aspect ratio so browsers that don't
     auto-size SVGs still render the correct height */
  aspect-ratio: 640 / 200;
}

/* Duplex SVG is 640×210 — override the shared aspect ratio */
.tool-visual__media img[src*="duplex-scan-explainer"] {
  aspect-ratio: 640 / 210;
}

.tool-visual__caption {
  margin: 14px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

.tool-header .tool-visual {
  margin-top: 14px;
}

.feature-card .tool-visual {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  margin: 10px 0 14px;
  overflow: hidden;
}

.feature-card .tool-visual img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

@media (max-width: 520px) {
  .tool-visual {
    padding: 14px 12px 12px;
  }

  .tool-visual__title {
    text-align: center;
  }
}

.flow-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.flow-list li + li {
  margin-top: 8px;
}

.flow-list a {
  font-weight: 700;
}

.tool-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.tool-nav button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tool-nav button:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

.tool-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tool-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.tool-card.active,
.tool-card.tool-single {
  display: block;
}

.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tool-link {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  font-size: 0.95rem;
  font-weight: 700;
}

.tool-example {
  margin: 8px 0 0;
  max-width: 56ch;
  color: var(--text-muted);
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.options-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.options-row input[type="checkbox"],
.options-row input[type="radio"] {
  accent-color: var(--accent);
}

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

.editor-col label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
  resize: vertical;
}

input[type="text"],
input[type="file"],
select {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input[type="file"] {
  padding: 10px 12px;
}

.tool-card.tool-single + .tool-card.tool-single {
  margin-top: 18px;
}

textarea[readonly] {
  background: #faf8f4;
}

.file-stack {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.file-help,
.small-note {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.stats {
  margin-top: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.more-tools-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.more-tools-cta p {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.more-tools-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.more-tools-links a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}

.more-tools-links a:hover {
  border-color: var(--border-focus);
  background: rgba(255,255,255,0.9);
  text-decoration: none;
}

.two-column {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

.info-stack {
  display: grid;
  gap: 16px;
}

.prose-section {
  padding-bottom: 56px;
}

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

/* ── Privacy strip ── */
.privacy-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 0;
  background: var(--accent-bg);
  border: 1px solid #f0c9b8;
  border-radius: var(--radius-lg);
}

.privacy-strip__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.privacy-strip p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ── Nav group labels ── */
.nav-group-label {
  grid-column: 1 / -1;
  margin: 8px 0 2px;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-group-label:first-child {
  margin-top: 0;
}

/* ── Footer columns ── */
.footer-cols {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.footer-col-label {
  margin: 0 0 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-col a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 44px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 1.05rem;
}

.footer-inner p {
  margin: 0;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tool-page-section {
  padding: 34px 0 56px;
}

.tool-page-layout {
  padding: 24px;
}

.tool-page-layout ul {
  padding-left: 18px;
}

.tool-page-layout li + li {
  margin-top: 8px;
}

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

.status-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.status-note strong {
  color: var(--success);
}

@media (max-width: 920px) {
  .card-grid,
  .quick-grid,
  .link-grid,
  .cluster-grid,
  .related-grid,
  .flow-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .tool-header,
  .footer-inner,
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .nav-tools-menu {
    position: static;
    margin-top: 10px;
    min-width: 0;
    width: min(100%, 420px);
  }
}

@media (max-width: 720px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .button,
  .hero-actions .button {
    width: 100%;
  }

  .tool-nav button {
    flex: 1 1 auto;
    font-size: 0.92rem;
    padding: 8px 14px;
  }

  .hero-card,
  .mini-hero,
  .hero-panel,
  .cluster,
  .flow-card,
  .tool-card,
  .tool-page-layout {
    padding: 20px;
  }

  .hero-block {
    padding-top: 28px;
  }
}
