/*
Theme Name: ImageSprint
Theme URI: https://dev-image-compressor.pantheonsite.io/
Author: ImageSprint
Description: Professional multi-tool WordPress theme for image compression, resizing, cropping, JPG conversion, rotate & flip, watermark, photo collage, color adjust, color picker and AI background removal. Browser-based processing. Dark premium UI with sticky header and tool search.
Version: 3.5.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: imagesprint
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   CSS Custom Properties — Dark Premium Palette
   ========================================================================== */
:root {
  --bg: #0B0B12;
  --bg-elevated: #12121C;
  --surface: #151522;
  --surface-2: #1C1C2A;
  --surface-3: #242436;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #F7F7FC;
  --text-secondary: #B6B6C9;
  --muted: #7A7A92;
  --purple: #7657FF;
  --purple-bright: #8B6FFF;
  --blue: #36B7FF;
  --magenta: #F23DD7;
  --cyan: #27C5E8;
  --white: #FFFFFF;
  --success: #34D399;
  --error: #F87171;
  --warning: #FBBF24;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(118, 87, 255, 0.25);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-full: 999px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient: linear-gradient(135deg, var(--purple) 0%, var(--blue) 50%, var(--magenta) 100%);
  --gradient-btn: linear-gradient(135deg, #7657FF 0%, #F23DD7 100%);
  --gradient-soft: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(118, 87, 255, 0.22), transparent 70%);
  --gradient-hero: radial-gradient(ellipse 100% 80% at 50% 20%, rgba(118, 87, 255, 0.28), rgba(54, 183, 255, 0.08) 40%, transparent 70%);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button, input, select, textarea { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--purple-bright);
  margin-bottom: 12px;
}
.muted { color: var(--muted); }
.section-header { text-align: center; margin-bottom: 40px; max-width: 640px; margin-inline: auto; }
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 12px; font-weight: 700; letter-spacing: -0.02em; }
.section-header p { color: var(--text-secondary); margin: 0; font-size: 1.05rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-weight: 650;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition), background var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(118, 87, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(118, 87, 255, 0.45);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--purple);
  color: var(--white);
}
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

/* ==========================================================================
   Header — Minimal (Home · All Tools · Search) + Sticky
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 11, 18, 0.92);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  background: rgba(11, 11, 18, 0.97);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.brand:hover { opacity: 0.9; }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-btn);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition);
}
.brand:hover .brand-mark {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(118, 87, 255, 0.4);
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}
.nav > a {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition), transform 0.15s ease;
  white-space: nowrap;
}
.nav > a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav > a:active {
  transform: scale(0.97);
}
.nav > a[aria-current="page"] {
  color: var(--text);
  background: rgba(118, 87, 255, 0.12);
}
.nav > a:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Header Search */
.header-search {
  position: relative;
  margin-left: 8px;
  flex: 0 1 220px;
  max-width: 240px;
}
.tool-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237A7A92' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.tool-search-input::placeholder { color: var(--muted); }
.tool-search-input:hover { border-color: var(--line-strong); }
.tool-search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(118, 87, 255, 0.2);
  background-color: var(--surface-2);
}
.tool-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 60;
  padding: 6px;
}
.tool-search-results[hidden] { display: none !important; }
.tool-search-results a,
.tool-search-results .search-no-results {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.tool-search-results a:hover,
.tool-search-results a:focus {
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}
.tool-search-results a[aria-selected="true"] {
  background: rgba(118, 87, 255, 0.15);
  color: var(--text);
}
.tool-search-results .search-icon {
  width: 22px;
  text-align: center;
  opacity: 0.75;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.tool-search-results .search-no-results {
  color: var(--muted);
  cursor: default;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  transition: background var(--transition), border-color var(--transition);
}
.menu-toggle:hover { background: var(--surface-3); border-color: var(--line-strong); }
.menu-icon-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 72px 0 64px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  text-align: center;
  max-width: 780px;
  margin-inline: auto;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 18px;
}
.hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  margin: 0 0 28px;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-badges li {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-secondary);
}

/* Decorative floating cards (hero ambiance) */
.hero-decor {
  position: absolute;
  width: 140px;
  height: 160px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0.85;
}
.hero-decor-1 { left: 4%; top: 18%; transform: rotate(-8deg); background: linear-gradient(145deg, #2a1a4a, #1a2a4a); }
.hero-decor-2 { right: 5%; top: 22%; transform: rotate(10deg); background: linear-gradient(145deg, #1a2a3a, #2a1a3a); }
@media (max-width: 900px) {
  .hero-decor { display: none; }
}

/* ==========================================================================
   Sections & Cards
   ========================================================================== */
.section { padding: 64px 0; }
.tools-showcase { background: transparent; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.tools-grid-7, .tools-grid-8 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(118, 87, 255, 0.45);
  box-shadow: 0 16px 48px rgba(118, 87, 255, 0.18);
  background: var(--surface-2);
}
.tool-card:hover .tool-card-icon {
  transform: scale(1.06);
  border-color: rgba(118, 87, 255, 0.35);
}
.tool-card .tool-card-icon {
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.tool-card-featured {
  border-color: rgba(118, 87, 255, 0.45);
  background: linear-gradient(160deg, rgba(118, 87, 255, 0.12), rgba(54, 183, 255, 0.06));
  box-shadow: 0 12px 40px rgba(118, 87, 255, 0.18);
}
.tool-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 1.35rem;
  border: 1px solid var(--line);
}
.tool-card-featured .tool-card-icon {
  background: var(--gradient-btn);
  border: none;
  color: #fff;
}
.tool-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tool-card p {
  margin: 0;
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}
.tool-card .btn { align-self: flex-start; margin-top: 4px; }

/* Feature / How it works */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.feature-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-secondary); font-size: 0.92rem; }

/* Content cards / FAQ */
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px;
}
.content-card h2 { margin-top: 0; font-size: 1.3rem; }
.content-card p, .content-card li { color: var(--text-secondary); }
.faq-list { list-style: none; padding: 0; margin: 0; }
.faq-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.faq-list li:last-child { border-bottom: none; }
.faq-list strong { display: block; margin-bottom: 4px; color: var(--text); }

/* ==========================================================================
   Tool workspace
   ========================================================================== */
.tool-page-hero {
  padding: 40px 0 12px;
  text-align: center;
}
.tool-page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 10px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.tool-description {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.02rem;
}
.tool-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0 40px;
  box-shadow: var(--shadow-sm);
}
.tool-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.tool-top h2 { margin: 0 0 4px; font-size: 1.25rem; }
.tool-sub { margin: 0; color: var(--text-secondary); font-size: 0.92rem; }
.privacy-note {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  background: var(--bg-elevated);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.drag-over {
  border-color: var(--purple);
  background: rgba(118, 87, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(118, 87, 255, 0.12);
}
.drop-zone.has-files {
  border-style: solid;
  border-color: var(--line);
  padding: 16px;
}
.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}
.drop-zone-empty h3 { margin: 0 0 6px; font-size: 1.15rem; }
.drop-zone-empty p { margin: 0 0 18px; color: var(--text-secondary); font-size: 0.92rem; }
.drop-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.drop-preview-item {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.drop-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.drop-zone-actions { margin-top: 12px; }

/* Controls */
.tool-controls {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input[type="number"],
.field input[type="text"],
.field input[type="color"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(118, 87, 255, 0.2);
}
.field input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-row input[type="range"] { flex: 1; accent-color: var(--purple); }
.range-row strong { min-width: 42px; text-align: right; font-size: 0.9rem; }
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.rotate-actions { flex-wrap: wrap; gap: 8px; }
.rotate-actions .btn { min-width: 100px; }

/* Status */
.tool-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}
.tool-status.show { display: block; }
.tool-status.info { background: rgba(54, 183, 255, 0.12); color: var(--blue); border: 1px solid rgba(54, 183, 255, 0.25); }
.tool-status.success { background: rgba(52, 211, 153, 0.12); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.25); }
.tool-status.error { background: rgba(248, 113, 113, 0.12); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.25); }

/* Selected files / results */
.selected-files { margin-top: 20px; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-heading h3 { margin: 0; font-size: 1.05rem; }
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.file-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.file-preview {
  aspect-ratio: 1;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-meta { padding: 12px; }
.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-details { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Crop stage */
.crop-layout { margin-top: 14px; }
.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
}
.crop-stage img { max-width: 100%; display: block; }
.crop-box {
  position: absolute;
  border: 2px solid var(--purple);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--purple);
  border-radius: 2px;
}
.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.empty-note { font-size: 0.85rem; color: var(--muted); margin: 8px 0; }

/* Expand / rotate preview */
.expand-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
}
.expand-canvas { max-width: 100%; max-height: 50vh; border-radius: 8px; }

/* Background Remover */
.bg-remover-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 700px) {
  .bg-remover-preview { grid-template-columns: 1fr; }
}
.bg-preview-panel {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}
.bg-preview-panel h4 {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 650;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
}
.bg-preview-stage {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, #2a2a3a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a3a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a3a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a3a 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-color: #0e0e16;
}
.bg-preview-stage img, .bg-preview-stage canvas {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.bg-progress {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.bg-progress .progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  margin-top: 8px;
  overflow: hidden;
}
.bg-progress .progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gradient-btn);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.model-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Processing spinner */
.processing {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding: 48px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 36px;
}
.footer-brand-col { max-width: 280px; }
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1.3fr repeat(2, 1fr); }
  .footer-brand-col { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { margin-bottom: 12px; }
.footer-intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 8px;
  line-height: 1.55;
}
.footer-col h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--purple-bright);
  transform: translateX(2px);
}
.footer-col a {
  transition: color var(--transition), transform 0.15s ease;
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   Blog / generic pages
   ========================================================================== */
.site-main {
  min-height: 50vh;
  /* Ensure content is not hidden under sticky header when using anchor links */
  scroll-padding-top: 80px;
}
html { scroll-padding-top: 80px; }
.post-list { display: grid; gap: 20px; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.post-card h2 { margin: 0 0 8px; font-size: 1.25rem; }
.post-card h2 a:hover { color: var(--purple-bright); }
.post-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.entry-content { color: var(--text-secondary); line-height: 1.75; }
.entry-content a { color: var(--purple-bright); text-decoration: underline; }
.entry-content h2, .entry-content h3 { color: var(--text); }

/* Contact form */
.contact-form .field { margin-bottom: 14px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--text);
}
.contact-form textarea { min-height: 140px; resize: vertical; }

/* 404 */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}
.error-404 h1 { font-size: 3rem; margin-bottom: 12px; }

/* ==========================================================================
   Animations
   ========================================================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 20px;
    gap: 4px;
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .nav.is-open { display: flex; }
  .nav > a {
    padding: 12px 14px;
  }
  .header-search {
    margin-left: 0;
    margin-top: 8px;
    flex: none;
    max-width: none;
    width: 100%;
  }
  .tool-search-results {
    min-width: 100%;
    left: 0;
    right: 0;
  }
  .header-inner { position: relative; }
  .tool-shell { padding: 18px; }
  .hero { padding: 48px 0 40px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .expand-preview-stage { max-height: 50vh; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .drop-preview-item { animation: none; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Color Adjuster (Lightroom-inspired) ===== */
.color-adjuster-wrap { max-width: 1200px; }
.ca-shell { padding: 20px !important; }
.ca-workspace {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  margin-top: 16px;
  min-height: 420px;
}
@media (max-width: 800px) {
  .ca-workspace { grid-template-columns: 1fr; }
}
.ca-canvas-area {
  background: #0a0a10;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ca-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.ca-preview-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 320px;
  overflow: auto;
  background: #0a0a10;
}
.ca-canvas {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 4px;
  display: block;
  background: transparent;
  image-rendering: auto;
}
.ca-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-y: auto;
  max-height: 70vh;
}
.ca-panel-title {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ca-slider-group {
  margin-bottom: 12px;
}
.ca-slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ca-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--purple);
}
.ca-presets {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.ca-export {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 8px;
}
.ca-export label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.ca-export select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

/* ===== Color Picker ===== */
.cp-workspace {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  margin-top: 16px;
}
@media (max-width: 700px) {
  .cp-workspace { grid-template-columns: 1fr; }
}
.cp-canvas-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.cp-canvas { border-radius: 6px; max-height: 480px; }
.cp-results {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.cp-swatch {
  width: 100%;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  margin-bottom: 14px;
}
.cp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cp-row label {
  width: 36px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.cp-row code {
  flex: 1;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-history h4 {
  margin: 16px 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.cp-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-hist-item {
  position: relative;
  display: inline-flex;
}
.cp-hist-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
}
.cp-hist-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
