/* ==========================================================================
   MintCut — global stylesheet
   Mobile-first, light/dark via [data-theme] on <html>
   ========================================================================== */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eceef5;
  --border: #dfe2ec;
  --text: #191c26;
  --text-muted: #575e70;
  --accent: #8ffff6;
  --accent-hover: #63ede1;
  --accent-contrast: #063a35;
  --accent-soft: rgba(143, 255, 246, 0.22);
  --accent-ink: #0a8f81;
  --accent-ink-hover: #076b60;
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.08);
  --shadow: 0 1px 3px rgba(16, 18, 27, 0.06), 0 8px 24px rgba(16, 18, 27, 0.06);
  --radius: 12px;
  --radius-lg: 16px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0e1015;
  --surface: #171a22;
  --surface-2: #1f2330;
  --border: #2b3042;
  --text: #edeff6;
  --text-muted: #a2a9bd;
  --accent: #8ffff6;
  --accent-hover: #b6fff9;
  --accent-contrast: #06201d;
  --accent-soft: rgba(143, 255, 246, 0.16);
  --accent-ink: #8ffff6;
  --accent-ink-hover: #b6fff9;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent-ink); }
a:hover { color: var(--accent-ink-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-icon { width: 1.5rem; height: 1.5rem; flex: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle svg { width: 1.125rem; height: 1.125rem; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --------------------------------------------------------------------------
   Hero + tool directory (homepage)
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}
.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 38rem;
  margin: 0 auto;
}

.tool-search {
  max-width: 28rem;
  margin: 1.5rem auto 0;
  position: relative;
}
.tool-search svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  color: var(--text-muted);
  pointer-events: none;
}
.tool-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.625rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.tool-search input::placeholder { color: var(--text-muted); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 1.5rem 0 2rem;
  list-style: none;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent-ink); }
.tool-card h2, .tool-card h3 { margin: 0; font-size: 1.0625rem; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.tool-card a {
  color: var(--text);
  text-decoration: none;
}
/* Stretch the card link over the whole card */
.tool-card a::after { content: ""; position: absolute; inset: 0; }
.tool-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tool-card-icon svg { width: 1.375rem; height: 1.375rem; }

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge--soon { position: absolute; top: 0.875rem; right: 0.875rem; }

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* --------------------------------------------------------------------------
   Ad slots — fixed sizes reserved to avoid layout shift (CLS)
   -------------------------------------------------------------------------- */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem auto;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow: hidden;
}
.ad-slot--leaderboard { width: 100%; max-width: 728px; height: 100px; }
.ad-slot--box { width: 300px; height: 250px; }
@media (min-width: 48rem) {
  .ad-slot--leaderboard { height: 90px; }
}

/* --------------------------------------------------------------------------
   Tool page layout
   -------------------------------------------------------------------------- */

.tool-header { text-align: center; margin: 1rem 0 1.5rem; }
.tool-header h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.tool-header p { color: var(--text-muted); max-width: 40rem; margin: 0 auto; }

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 48rem) {
  .tool-panel { padding: 1.75rem; }
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  text-align: center;
  padding: 2.25rem 1.25rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
}
.dropzone[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.dropzone svg { width: 2.5rem; height: 2.5rem; color: var(--accent-ink); }
.dropzone p { margin: 0; }
.dz-browse { color: var(--accent-ink); font-weight: 600; text-decoration: underline; }
.dz-hint { font-size: 0.85rem; color: var(--text-muted); }

/* Settings row (sliders, selects) */
.tool-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: end;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.setting { display: flex; flex-direction: column; gap: 0.375rem; min-width: 10rem; flex: 1; }
.setting > label { font-size: 0.875rem; font-weight: 600; }
.setting-note { flex-basis: 100%; margin: 0; font-size: 0.8125rem; color: var(--text-muted); }

.range-wrap { display: flex; align-items: center; gap: 0.75rem; }
.range-value {
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-ink);
}
input[type="range"] {
  flex: 1;
  accent-color: var(--accent-ink);
  height: 1.5rem;
}

select, .text-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
}
.radio-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.radio-pill:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent-ink);
  color: var(--accent-contrast);
}
.radio-pill:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border-radius: 8px; }
.btn--icon {
  padding: 0.375rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn--icon:hover { background: var(--surface-2); color: var(--text); }
.btn--icon svg { width: 1rem; height: 1rem; }

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Progress bar */
.progress-wrap { margin-top: 1.25rem; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.progress {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* Error messages */
.tool-errors {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
  font-size: 0.9rem;
}
.tool-errors ul { margin: 0; padding-left: 1.25rem; }
.tool-errors li + li { margin-top: 0.25rem; }

/* Results / file list */
.file-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.file-item.is-dragging { opacity: 0.5; }
.file-item.drag-over-top { box-shadow: 0 -3px 0 0 var(--accent); }
.file-item.drag-over-bottom { box-shadow: 0 3px 0 0 var(--accent); }
.file-item[draggable="true"] { cursor: grab; }

.file-thumb {
  width: 3rem;
  height: 3rem;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.file-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.file-icon svg { width: 1.25rem; height: 1.25rem; }

.file-meta { flex: 1; min-width: 0; }
.file-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sizes { font-size: 0.8125rem; color: var(--text-muted); }
.file-sizes .arrow { margin-inline: 0.25rem; }

.size-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.0625rem 0.4375rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
}
.size-badge--neutral { background: var(--surface-2); color: var(--text-muted); }

.file-controls { display: flex; align-items: center; gap: 0.25rem; flex: none; }

.drag-handle {
  color: var(--text-muted);
  flex: none;
  display: flex;
  cursor: grab;
}
.drag-handle svg { width: 1.125rem; height: 1.125rem; }

/* Status line ("Loading PDF engine…") */
.tool-status {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Coming soon notice */
.soon-notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 0.9375rem;
}
.soon-notice p { margin: 0; }

/* --------------------------------------------------------------------------
   SEO content block
   -------------------------------------------------------------------------- */

.seo-content {
  max-width: 44rem;
  margin: 2.5rem auto;
}
.seo-content h2 {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
}
.seo-content h3 { font-size: 1.0625rem; margin: 1.25rem 0 0.5rem; }
.seo-content p, .seo-content li { color: var(--text-muted); }
.seo-content ol li, .seo-content ul li { margin-bottom: 0.375rem; }
.seo-content strong { color: var(--text); }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.5rem;
  padding: 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.875rem 1rem;
  list-style-position: inside;
}
.faq summary:hover { color: var(--accent-ink); }
.faq details p {
  margin: 0;
  padding: 0 1rem 0.875rem;
}

/* --------------------------------------------------------------------------
   Static pages (about, privacy, terms, contact)
   -------------------------------------------------------------------------- */

.page-content {
  max-width: 44rem;
  margin: 1.5rem auto 3rem;
}
.page-content h1 { font-size: clamp(1.625rem, 4.5vw, 2.25rem); letter-spacing: -0.02em; }
.page-content h2 { font-size: 1.375rem; margin-top: 2rem; }
.page-content p, .page-content li { color: var(--text-muted); }
.page-content strong { color: var(--text); }
.page-updated { font-size: 0.875rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 1.5rem;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 48rem) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand p { color: var(--text-muted); margin: 0.5rem 0 0; max-width: 26rem; }
.footer-col h2 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text); text-decoration: none; }
.footer-col a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Privacy banner
   -------------------------------------------------------------------------- */

.privacy-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: calc(100% - 2rem);
  max-width: 34rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}
.privacy-banner[hidden] { display: none; }
.privacy-banner svg { width: 1.25rem; height: 1.25rem; flex: none; color: var(--success); }
.privacy-banner p { margin: 0; flex: 1; }
.privacy-banner button {
  flex: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 0;
}
.privacy-banner button:hover { color: var(--text); background: var(--surface-2); }
.privacy-banner button svg { color: currentColor; width: 1rem; height: 1rem; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

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

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}


/* Brand logo (raster, theme-swapped) */
img.brand-icon { width: auto; height: 1.7rem; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: inline-block; }
