/* ============================================================
   base.css — shared building blocks in a neumorphic (soft UI)
   style. Surfaces share the canvas color and are shaped by dual
   shadows: raised = extruded card/button; inset = pressed well
   (drop zones, inputs, sliders). Uses variables from tokens.css.
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ---- Header (flat, sits on the canvas — no border/blur) ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo span { color: var(--accent); }
.header-nav a { color: var(--text-muted); font-size: var(--text-sm); margin-left: var(--space-5); }
.header-nav a:hover { color: var(--text); }

/* ---- Hero (calm, minimal text) ---- */
.hero { text-align: center; padding: var(--space-8) var(--space-5) var(--space-6); }
.hero h1,
.hero .privacy-badge { animation: fade-up 0.7s var(--ease) both; }
.hero h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero .privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  animation-delay: 0.15s;
}
.hero .privacy-badge svg { color: var(--accent); }

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

/* ---- Section heading ---- */
.category-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  margin: var(--space-7) 0 var(--space-5);
}

/* ---- Tool grid + cards (raised) ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition);
}
a.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
a.tool-card:active { transform: translateY(0); box-shadow: var(--shadow-inset); }
.tool-card.is-soon { opacity: 0.55; }
.tool-card.is-soon:hover { transform: none; box-shadow: var(--shadow-md); }

.tool-card .icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  transition: box-shadow var(--transition);
}
.tool-card .icon svg { width: 24px; height: 24px; }
a.tool-card:hover .icon { box-shadow: var(--shadow-md); }
.tool-card h3 { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.tool-card p { font-size: var(--text-sm); color: var(--text-muted); }
.tool-card .soon-badge {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-faint);
  padding: 3px var(--space-3);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pressed);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
}
.btn:hover { box-shadow: var(--shadow-md); }
.btn:active { box-shadow: var(--shadow-inset); transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: var(--shadow-pressed); }
.btn-primary { color: #fff; background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { color: var(--text); }

/* ---- Footer ---- */
.site-footer {
  margin-top: var(--space-9);
  padding: var(--space-6) 0;
  color: var(--text-faint);
  font-size: var(--text-sm);
  text-align: center;
}

/* ============================================================
   TOOLS — drop zone, tool workspace, controls, unlock CTA.
   ============================================================ */

/* ---- Drop zone (inset well — invites a drop) ---- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset);
  transition: color var(--transition), transform var(--transition);
}
.dropzone:hover { color: var(--accent); }
.dropzone.is-dragover { color: var(--accent); transform: scale(1.005); }
.dropzone.is-dragover .dz-icon { transform: translateY(-3px); }
.dz-icon { width: 46px; height: 46px; color: var(--accent); transition: transform var(--transition); }
.dz-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); }
.dz-sub { color: var(--text-faint); font-size: var(--text-sm); }

.hero .dropzone { max-width: 560px; margin: var(--space-6) auto 0; }

/* ---- Tool page layout ---- */
.tool { padding: var(--space-5) 0 var(--space-8); }
.tool-narrow { max-width: 600px; margin-inline: auto; }
.tool-head { text-align: center; margin-bottom: var(--space-6); }
.tool-head h1 { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }

.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 720px) { .tool-workspace { grid-template-columns: 1fr; } }

/* Preview sits in an inset well */
.preview {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset);
}
.preview img { max-height: 60vh; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }

/* Controls panel is raised */
.controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Before/after size readout */
.stat-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat small { color: var(--text-faint); font-size: var(--text-xs); }
.stat b { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.stat-arrow { color: var(--text-faint); }
.stat-saved b { color: #2bb673; }
.stat-saved.is-none b { color: var(--text-muted); }

/* Labelled control */
.field { display: flex; flex-direction: column; gap: var(--space-3); }
.field-label { display: flex; justify-content: space-between; font-size: var(--text-sm); color: var(--text-muted); }
.field-label b { color: var(--text); font-weight: var(--weight-semibold); }

/* Range slider — inset track, raised knob */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: none;
}
input[type="range"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Select — inset field */
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inset);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inset);
}

/* ---- QR tool controls ---- */
.qr-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--text-md);
  color: var(--text);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inset);
}
.qr-input:focus { outline: none; }
.qr-colors { display: flex; gap: var(--space-4); }
.color-field { flex: 1; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 42px;
  padding: 6px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: var(--radius-sm); }
input[type="color"]::-moz-color-swatch { border: none; border-radius: var(--radius-sm); }
.qr-logo-row { display: flex; gap: var(--space-3); }
.qr-logo-row .btn { flex: 1; }
.qr-preview canvas { max-width: 100%; height: auto; border-radius: var(--radius-md); }

/* ---- Screenshot Studio ---- */
.ss-workspace { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-6); align-items: start; }
@media (max-width: 820px) { .ss-workspace { grid-template-columns: 1fr; } }
.ss-stage { display: grid; place-items: center; min-height: 320px; padding: var(--space-5); }
.ss-stage canvas { max-width: 100%; max-height: 68vh; height: auto; border-radius: var(--radius-md); cursor: crosshair; }
.ss-controls { max-height: 68vh; overflow-y: auto; overflow-x: hidden; padding: var(--space-5); }
/* 4 annotate tools as a 2x2 grid so nothing overflows the narrow column */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.tool-grid button {
  padding: 10px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition), color var(--transition);
}
.tool-grid button:hover { color: var(--text); }
.tool-grid button.on { color: var(--accent); box-shadow: var(--shadow-inset); }
.grad-swatches { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.grad-swatch { width: 34px; height: 34px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: var(--shadow-sm); }
.grad-swatch.on { box-shadow: var(--shadow-inset); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-sm); color: var(--text-muted); cursor: pointer; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.warn-note { font-size: var(--text-xs); color: #b26a00; line-height: 1.4; }
.redact-hint { font-size: var(--text-xs); color: var(--text-faint); text-align: center; }

/* On-device saved gallery */
.gallery-wrap { margin-top: var(--space-8); }
.gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.gallery-head span { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.gallery-head button { font-size: var(--text-sm); color: var(--text-muted); background: none; border: none; cursor: pointer; }
.gallery-head button:hover { color: var(--text); }
.gallery { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.gallery-item { position: relative; width: 124px; }
.gallery-item img {
  width: 124px; height: 92px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.gallery-del {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1;
}
.gallery-del:hover { color: #e5484d; }
.gallery-note { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--text-faint); }

.actions { display: flex; gap: var(--space-3); }
.actions .btn { flex: 1; }

/* ---- Unlock CTA (only monetization surface — at the result step) ---- */
.unlock-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  text-align: center;
}
.unlock-cta-btn {
  gap: var(--space-2);
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.unlock-cta-btn:hover { color: var(--accent); box-shadow: var(--shadow-md); }
.unlock-cta-note { font-size: var(--text-xs); color: var(--text-faint); }

/* ---- Segmented control — inset track, raised active pill ---- */
.segmented {
  display: flex;
  gap: var(--space-2);
  padding: 6px;
  margin-bottom: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-inset);
}
.segmented button {
  flex: 1;
  padding: 10px 6px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--transition), box-shadow var(--transition);
}
.segmented button:hover { color: var(--text); }
.segmented button.on { color: var(--accent); background: var(--surface); box-shadow: var(--shadow-sm); }

.sharpen-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
}

/* ---- Result list (raised rows) ---- */
.result-list { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.result-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.3s var(--ease) both;
}
.result-thumb {
  width: 46px; height: 46px;
  flex: none;
  object-fit: cover;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pressed);
}
.result-info { min-width: 0; flex: 1; }
.result-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-sub { margin-top: 2px; font-size: var(--text-xs); color: var(--text-muted); }
.result-sub .ok { color: #2bb673; }
.result-sub .err { color: #e5484d; }
.result-sub .warn { color: #f5a623; }
.result-actions .btn { padding: 8px 16px; font-size: var(--text-sm); }

.toolbar { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
.toolbar .btn { flex: 1; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ---- Small screens ---- */
@media (max-width: 600px) {
  .hero { padding-top: var(--space-6); }
  .hero h1 { font-size: 2.25rem; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ================= Programmatic-SEO content + footer index ================= */
.seo { max-width: 760px; margin: var(--space-8) auto 0; }
.seo .crumbs { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-5); }
.seo .crumbs a { color: var(--text-muted); text-decoration: none; }
.seo .crumbs a:hover { color: var(--accent); }
.seo .crumbs .sep { margin: 0 6px; opacity: .5; }
.seo-intro p { color: var(--text); line-height: 1.7; margin: 0 0 var(--space-4); }
.seo h2 { font-size: var(--text-lg); margin: var(--space-7) 0 var(--space-4); }
.seo-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.seo-steps li { line-height: 1.6; }
.seo-faq details { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 2px var(--space-4); margin-bottom: 10px; }
.seo-faq summary { cursor: pointer; font-weight: var(--weight-semibold); padding: var(--space-3) 0; list-style: none; }
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::before { content: "+"; color: var(--accent); font-weight: 700; margin-right: 10px; }
.seo-faq details[open] summary::before { content: "\2013"; }
.seo-faq p { margin: 0 0 var(--space-4); color: var(--text-muted); line-height: 1.65; }
.seo-related { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-related a { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--accent);
  background: var(--surface); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 8px 14px; text-decoration: none; }
.seo-related a:hover { box-shadow: var(--shadow-md); }

.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-5);
  text-align: left; margin-bottom: var(--space-6); }
.footer-col h3 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: var(--text-sm); }
.footer-col a:hover { color: var(--accent); }
.footer-legal { color: var(--text-muted); font-size: var(--text-sm); margin: 0; }
.footer-legal a { color: var(--text-muted); }

/* ---- Data tools: multi-sheet Excel picker ---- */
.sheet-pick { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); }
.sheet-pick select { padding: 8px 12px; font: inherit; color: var(--text); background: var(--bg); border: none; border-radius: 10px; box-shadow: var(--shadow-inset); }
