/* Free Online Tools for Images and PDFs — shared styles */

/* Golden Wattle Modern: --brand is the Deep Eucalyptus Teal (#004D40),
   matching the Southern Cross mark; --accent is the vibrant wattle gold
   (#FFD700), reserved for badges, gradients and text on dark backgrounds
   (it fails contrast as body text on the light --bg, so it's never used
   for that here). */
:root {
  --bg: #f9f9f7;
  --bg-alt: #f4f4f2;
  --text: #1c1b1b;
  --text-muted: #5a6b64;
  --border: #dde5e2;
  --brand: #004D40;
  --brand-dark: #00332B;
  --brand-contrast: #ffffff;
  --accent: #FFD700;
  --success: #16a34a;
  --danger: #ba1a1a;
  --card-shadow: 0 1px 2px rgba(0, 77, 64, 0.05), 0 8px 24px rgba(0, 77, 64, 0.08);
  --radius: 10px;
  --max-width: 1080px;
  --footer-gradient: linear-gradient(90deg, #FFD700 0%, #004D40 100%);
  --band-bg: #1B1C1C;
  --band-bg-alt: #262727;
  --band-text: #f2f2f2;
  --band-text-muted: #b9bdbc;
  --band-border: #3a3b3b;
}

/* Dark mode: opt-in only, via the toggle in the header (adds
   data-theme="dark" to <html> and remembers the choice in localStorage).
   The site does not follow the OS/browser preference automatically. */
:root[data-theme="dark"] {
  --bg: #1B1C1C;
  --bg-alt: #262727;
  --text: #f2f2f2;
  --text-muted: #b9bdbc;
  --border: #3a3b3b;
  --brand: #4ECDC4;
  --brand-dark: #7EE8DA;
  --brand-contrast: #052e26;
  --accent: #FFD700;
  --success: #4ade80;
  --danger: #ffb4a6;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain texture, pure CSS/SVG — no image request, no third party. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

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

.logo-img { height: 28px; width: auto; display: block; }
.footer-logo-img { height: 22px; width: auto; display: block; }

/* Header sits on var(--bg), which flips dark in dark mode — the logo SVG
   is a static image (no CSS var inheritance), so swap the whole asset
   instead of trying to recolor it. Footer's background never changes
   with the theme, so it doesn't need this. */
.logo-img-dark { display: none; }
:root[data-theme="dark"] .logo-img-light { display: none; }
:root[data-theme="dark"] .logo-img-dark { display: block; }

.logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.95rem;
}

.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover { border-color: var(--brand); }
.icon-btn .material-symbols-outlined { font-size: 1.2rem; }

.header-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.header-support-btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.header-support-btn .material-symbols-outlined { font-size: 1.1rem; }

.nav-toggle { display: none; }

/* Below 600px, collapse the header CTA to an icon-only button to match
   the theme-toggle/hamburger buttons and avoid header overflow. */
@media (max-width: 600px) {
  .header-support-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
  }
  .header-support-btn-label { display: none; }
}

/* Mobile nav: collapsed behind a hamburger below 760px */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child { border-bottom: none; }
}

/* Skip link: hidden until keyboard-focused */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-contrast);
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { background: var(--brand-dark); }

/* Scroll progress bar (blog articles) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--brand);
  z-index: 60;
  transition: width 0.1s linear;
}

/* Copy-link button */
.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.copy-link-btn:hover { border-color: var(--brand); color: var(--text); }
.copy-link-btn .material-symbols-outlined { font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .back-to-top, .skip-link, .scroll-progress { transition: none; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 32px;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: blob-float-a 12s ease-in-out infinite alternate;
}

.hero::after {
  width: 460px;
  height: 460px;
  bottom: -220px;
  right: -140px;
  background: radial-gradient(circle, var(--brand) 0%, transparent 70%);
  animation: blob-float-b 14s ease-in-out infinite alternate;
}

@keyframes blob-float-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.15); }
}

@keyframes blob-float-b {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-30px, -20px) scale(1.1); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .container > * {
  animation: fade-in-up 0.7s ease-out both;
}

.hero .container > *:nth-child(1) { animation-delay: 0.05s; }
.hero .container > *:nth-child(2) { animation-delay: 0.15s; }
.hero .container > *:nth-child(3) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after, .hero .container > * { animation: none; }
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.gradient-text {
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--brand);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.tagline-badge {
  display: inline-block;
  margin-top: 20px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 77, 64, 0.1);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.pillar-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.pillar-card .glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-alt);
  color: var(--brand);
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.pillar-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--text); }
.pillar-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* Trust signals */
.trust-signals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 8px 0 40px;
}

.trust-signals .signal {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-signals .signal .glyph {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-alt);
}

.trust-signals .signal .label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.trust-signals .signal .label strong { color: var(--text); }
.trust-signals .signal .label span { color: var(--text-muted); }

/* Tool grid */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tool-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.tool-card:hover {
  box-shadow: 0 16px 32px -8px rgba(0, 77, 64, 0.22), 0 4px 12px rgba(0, 77, 64, 0.12);
  border-color: var(--brand);
  text-decoration: none;
  transform: translateY(-4px) scale(1.015);
}

/* Scroll-reveal: cards fade in as they enter the viewport. Scoped under a
   JS-added class so cards stay fully visible if JS never runs. */
.reveal-ready .tool-grid .tool-card {
  opacity: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, opacity 0.5s ease;
}
.reveal-ready .tool-grid .tool-card.in-view { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .tool-grid .tool-card { transition: none; }
}

/* Blog index: featured hero */
.blog-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 55%, #7a1d0f 100%);
  color: #fff9f2;
  padding: 56px 40px;
  margin: 8px 0 56px;
}

.blog-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -70px;
  bottom: -90px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 70%);
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 249, 242, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}

.blog-hero h2 {
  font-size: clamp(1.7rem, 4.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 18ch;
  text-wrap: balance;
}

.blog-hero h2 a { color: inherit; }
.blog-hero h2 a:hover { text-decoration: none; opacity: 0.9; }

.blog-hero p {
  color: rgba(255, 249, 242, 0.88);
  font-size: 1.02rem;
  max-width: 48ch;
  margin: 0 0 28px;
}

.blog-hero .actions-row { align-items: center; }
.blog-hero .btn { background: #fff9f2; color: var(--brand-dark); box-shadow: none; }
.blog-hero .btn:hover { background: #ffffff; }

.blog-hero .meta-readtime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 249, 242, 0.75);
}

/* Blog index: section header */
.blog-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin: 0 0 32px;
}

.blog-section-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Blog index: card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.blog-card {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(0, 77, 64, 0.18), 0 4px 12px rgba(0, 77, 64, 0.1);
  border-color: var(--brand);
  text-decoration: none;
}

.blog-card .visual {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  color: rgba(255, 255, 255, 0.95);
}

.blog-card .visual .material-symbols-outlined { transition: transform 0.35s ease; }
.blog-card:hover .visual .material-symbols-outlined { transform: scale(1.15) rotate(-3deg); }

.blog-card .body { padding: 20px; }
.blog-card .blog-meta { margin-bottom: 10px; }
.blog-card h3 { margin: 0 0 8px; font-size: 1.06rem; line-height: 1.35; color: var(--text); text-wrap: balance; }
.blog-card:hover h3 { color: var(--brand); }

.blog-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-grid .blog-card:nth-child(6n+1) .visual { background: linear-gradient(135deg, #004D40, #00332B); }
.blog-grid .blog-card:nth-child(6n+2) .visual { background: linear-gradient(135deg, #FFD700, #FFCC00); color: #1B1C1C; }
.blog-grid .blog-card:nth-child(6n+3) .visual { background: linear-gradient(135deg, #337066, #004D40); }
.blog-grid .blog-card:nth-child(6n+4) .visual { background: linear-gradient(135deg, #3A3B3B, #1B1C1C); }
.blog-grid .blog-card:nth-child(6n+5) .visual { background: linear-gradient(135deg, #FFCC00, #C9A200); color: #1B1C1C; }
.blog-grid .blog-card:nth-child(6n+6) .visual { background: linear-gradient(135deg, #00332B, #1B1C1C); }

.blog-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.blog-meta .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tool-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--brand);
  font-size: 1.35rem;
  margin-bottom: 12px;
  transition: transform 0.2s ease;
}

.tool-card:hover .icon { transform: scale(1.12) rotate(-4deg); }

/* Cycle a warm accent per card so the grid doesn't read as monochrome. */
.tool-grid .tool-card:nth-child(6n+1) .icon { background: rgba(0, 77, 64, 0.12); color: #004D40; }
.tool-grid .tool-card:nth-child(6n+2) .icon { background: rgba(255, 215, 0, 0.28); color: #8a6d00; }
.tool-grid .tool-card:nth-child(6n+3) .icon { background: rgba(51, 112, 102, 0.18); color: #337066; }
.tool-grid .tool-card:nth-child(6n+4) .icon { background: rgba(27, 28, 28, 0.1); color: #1B1C1C; }
.tool-grid .tool-card:nth-child(6n+5) .icon { background: rgba(255, 204, 0, 0.22); color: #7a5f00; }
.tool-grid .tool-card:nth-child(6n+6) .icon { background: rgba(0, 51, 43, 0.14); color: #00332B; }

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--text);
}

.tool-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Compact "Related tools" cards: same box/hover/icon-cycling as .tool-card, smaller footprint. */
.related-tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.related-tool-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.related-tool-card:hover {
  transform: translateY(-2px);
}

.related-tool-card .icon {
  width: 32px;
  height: 32px;
  font-size: 1.05rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

.related-tool-card h3 {
  margin: 0;
  font-size: 0.88rem;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--brand); }

.breadcrumbs .sep {
  margin: 0 6px;
  color: var(--border);
}

.breadcrumbs .current { color: var(--text); }

/* Tool page layout */
.tool-page-header {
  padding: 40px 0 8px;
  text-align: center;
}

.tool-page-header h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tool-page-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.tool-workspace {
  max-width: 720px;
  margin: 28px auto 64px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-alt);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-alt));
}

.dropzone .dz-icon { font-size: 2.2rem; margin-bottom: 8px; }
.dropzone .dz-title { font-weight: 600; margin-bottom: 4px; }
.dropzone .dz-sub { color: var(--text-muted); font-size: 0.88rem; }

.dropzone input[type="file"] { display: none; }

.file-list {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9rem;
}

.file-list li .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list li .meta { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; }

.file-list li button.remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
}
.file-list li button.remove:hover { color: var(--danger); }

.page-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.page-thumb {
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  position: relative;
  user-select: none;
}

.page-thumb.selected { border-color: var(--brand); }
.page-thumb.marked-delete { opacity: 0.35; border-color: var(--danger); }

.page-thumb img { display: block; width: 100%; }

.thumb-img-wrap {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-alt);
}

.thumb-img-wrap canvas,
.thumb-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  transition: transform 0.15s ease;
}

.page-thumb.dragging { opacity: 0.4; }
.page-thumb[draggable="true"] { cursor: grab; }

.page-thumb .page-num {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
}

.page-thumb .thumb-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.page-thumb .thumb-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 2px 4px;
}
.page-thumb .thumb-actions button:hover { color: var(--text); }

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin: 20px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.field label { color: var(--text-muted); font-weight: 600; }

.field input[type="number"],
.field input[type="text"],
.field select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  min-width: 100px;
}

.field input[type="range"] { width: 180px; }

.radio-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 20px 25px -5px rgba(0, 77, 64, 0.18), 0 8px 10px -6px rgba(0, 77, 64, 0.16);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--brand-dark);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 24px 32px -8px rgba(0, 77, 64, 0.32), 0 10px 14px -6px rgba(0, 77, 64, 0.22);
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--border); }

.btn.small { padding: 7px 14px; font-size: 0.85rem; }

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.status-box {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: none;
}
.status-box.visible { display: block; }
.status-box.error { border-color: var(--danger); color: var(--danger); }
.status-box.success { border-color: var(--success); }

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width 0.15s ease;
}

.results {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  display: none;
}
.results.visible { display: block; }

.results .result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.results .result-item:last-child { border-bottom: none; }

.results .result-item img.preview {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.results .result-item .info { flex: 1; font-size: 0.9rem; }
.results .result-item .savings { color: var(--success); font-size: 0.82rem; }

.help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

[contenteditable][data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.ai-flag {
  background: rgba(255, 215, 0, 0.35);
  border-radius: 3px;
  padding: 0 2px;
  cursor: help;
}

.finding-group {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.finding-group h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.finding-group .hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.finding-chip {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  margin: 0 6px 6px 0;
}

.note-box {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* How it works / related tools */
.info-section {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.info-section h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.info-section p {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

.faq-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--text-muted); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0; padding: 0 18px 16px; color: var(--text-muted); text-align: left; }

/* Compare PDFs: diff view */
.diff-view {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg-alt);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

.diff-line { display: block; padding: 1px 6px; border-radius: 3px; }
.diff-line.added { background: rgba(22, 163, 74, 0.16); color: var(--success); }
.diff-line.removed { background: rgba(186, 26, 26, 0.14); color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff-line.same { color: var(--text-muted); }

.diff-summary {
  display: flex;
  gap: 20px;
  margin: 16px 0;
  font-size: 0.88rem;
}

.diff-summary .added-count { color: var(--success); font-weight: 700; }
.diff-summary .removed-count { color: var(--danger); font-weight: 700; }

.cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.cta-box p { margin: 0; text-align: left; font-weight: 600; }

.byline {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: -8px 0 20px;
}

.info-section ol, .info-section ul {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding-left: 20px;
}

.info-section li { margin-bottom: 6px; }

/* Dark contrast band — a single full-width section styled with our own
   dark tokens (see --band-* above), used sparingly for visual rhythm. */
.dark-band {
  --bg: var(--band-bg);
  --bg-alt: var(--band-bg-alt);
  --text: var(--band-text);
  --text-muted: var(--band-text-muted);
  --border: var(--band-border);
  background: var(--band-bg);
  color: var(--band-text);
  padding: 56px 0;
  margin: 48px 0 0;
}

.dark-band a { color: var(--accent); }
.dark-band .info-section { border-top: none; margin-top: 0; padding-top: 0; }

.dark-band-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.dark-band-grid .info-section {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 760px) {
  .dark-band-grid { grid-template-columns: 1fr; }
}

.terminal-box {
  background: #17130f;
  border: 1px solid var(--band-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  margin: 0;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 760px) {
  .terminal-box { max-width: 100%; }
}

.terminal-chrome {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #221c17;
  border-bottom: 1px solid var(--band-border);
}

.terminal-chrome .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-chrome .dot.red { background: #ff5f56; }
.terminal-chrome .dot.yellow { background: #ffbd2e; }
.terminal-chrome .dot.green { background: #27c93f; }

.terminal-lines {
  margin: 0;
  padding: 20px 22px;
  min-height: 108px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--accent);
  white-space: pre-wrap;
  text-align: left;
}

.cursor {
  display: inline-block;
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

/* Footer */
.site-footer {
  background: var(--footer-gradient);
  padding: 32px 0;
  margin-top: 40px;
  color: #fff9f2;
  font-size: 0.85rem;
}

/* Used when the footer directly follows a .dark-band, so there's no gap
   of body-background color between the two. */
.site-footer.flush { margin-top: 0; }

.site-footer a { color: #fff9f2; opacity: 0.9; }
.site-footer a:hover { opacity: 1; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
}

.footer-col h5 {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff9f2;
}

.footer-col a {
  display: block;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.footer-col a.footer-view-all {
  font-weight: 700;
  opacity: 0.95;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff9f2;
  margin-bottom: 10px;
}

.footer-brand .footer-logo .material-symbols-outlined { font-size: 1.1rem; }

.footer-brand p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  max-width: 30ch;
}

.footer-support-cta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-support-cta p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  max-width: 30ch;
}

.footer-support-cta .btn {
  background: #fff9f2;
  color: var(--brand-dark);
}

.footer-support-cta .btn:hover { background: #ffffff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 249, 242, 0.25);
  padding-top: 20px;
  font-size: 0.8rem;
  line-height: 1.6;
  opacity: 0.85;
}

.footer-bottom .attribution {
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; }
}

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

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

/* Crop & rotate tool */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.crop-stage {
  position: relative;
  max-width: 100%;
  margin: 20px 0;
  touch-action: none;
  background:
    linear-gradient(45deg, #80808022 25%, transparent 25%, transparent 75%, #80808022 75%),
    linear-gradient(45deg, #80808022 25%, transparent 25%, transparent 75%, #80808022 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.crop-stage canvas { display: block; width: 100%; height: auto; }

.preview-stage {
  position: relative;
  max-width: 100%;
  margin: 20px 0;
  background:
    linear-gradient(45deg, #80808022 25%, transparent 25%, transparent 75%, #80808022 75%),
    linear-gradient(45deg, #80808022 25%, transparent 25%, transparent 75%, #80808022 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.preview-stage canvas { display: block; width: 100%; height: auto; }

.crop-box {
  position: absolute;
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.crop-handle.nw { top: 0; left: 0; cursor: nwse-resize; }
.crop-handle.ne { top: 0; left: 100%; cursor: nesw-resize; }
.crop-handle.sw { top: 100%; left: 0; cursor: nesw-resize; }
.crop-handle.se { top: 100%; left: 100%; cursor: nwse-resize; }

@media (max-width: 600px) {
  .hero { padding: 36px 0 24px; }
  .dropzone { padding: 32px 16px; }
}

/* Print */
@media print {
  .site-header, .site-footer, .back-to-top, .skip-link, .scroll-progress,
  .dropzone, .actions-row, .btn, .copy-link-btn, .status-box,
  .hero-ctas, .terminal-box {
    display: none !important;
  }

  body { background: #fff; color: #000; }

  a { color: #000; text-decoration: underline; }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }

  .container { max-width: 100%; }
  .search-overlay { display: none !important; }
}

/* Site search modal */
body.search-open { overflow: hidden; }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(0, 0, 0, 0.5);
}

.search-overlay.open { display: flex; }

.search-panel {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-input-row .material-symbols-outlined { color: var(--text-muted); font-size: 1.3rem; }

.search-input-row input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
}

.search-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.search-close-btn:hover { background: var(--bg-alt); color: var(--text); }

.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 8px;
  color: var(--text);
}

.search-result:hover, .search-result.active {
  background: color-mix(in srgb, var(--brand) 10%, var(--bg-alt));
  text-decoration: none;
}

.search-result-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.search-result-title { font-weight: 600; font-size: 0.95rem; }

.search-result-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-muted);
  white-space: nowrap;
}

.search-tag-pdf-tool { background: color-mix(in srgb, var(--brand) 15%, var(--bg-alt)); color: var(--brand); }
.search-tag-blog { background: color-mix(in srgb, #8a5cf6 15%, var(--bg-alt)); color: #8a5cf6; }

.search-empty {
  padding: 24px 16px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
