/* PhotoLab24 — design system. Без сборки, чистый CSS. */

:root {
  --color-bg: #f7f7fb;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f0fb;
  --color-border: #e6e4f2;
  --color-text: #1c1b2e;
  --color-text-muted: #6b6880;
  --color-primary: #1a2340;
  --color-primary-dark: #10182c;
  --color-primary-light: #e7e9f3;
  --color-accent: #f4600a;
  --color-accent-light: #ffe4d2;
  --color-success: #17a673;
  --color-success-light: #e3f7ef;
  --color-danger: #e0433c;
  --color-danger-light: #fde6e5;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(28, 27, 46, 0.06);
  --shadow-md: 0 6px 20px rgba(28, 27, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(28, 27, 46, 0.12);

  --container-w: 1180px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--color-text); flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark .logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.main-nav a {
  padding: 9px 14px; border-radius: var(--radius-pill); font-size: 14.5px; font-weight: 600;
  color: var(--color-text-muted); white-space: nowrap;
}
.main-nav a:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.header-cta { flex-shrink: 0; display: flex; gap: 10px; align-items: center; }
.header-cta .nav-toggle { display: none; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-cta .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 700; font-size: 15px;
  border: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 8px 20px rgba(26,35,64,.28); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-accent { background: var(--color-accent); color: #fff; box-shadow: 0 8px 20px rgba(255,106,61,.28); }
.btn-outline { background: #fff; color: var(--color-text); border: 1.5px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 40px;
  background: radial-gradient(1200px 500px at 15% -10%, #e8eaf5 0%, transparent 60%),
              radial-gradient(900px 400px at 100% 0%, #ffe4d2 0%, transparent 55%);
}
.hero-inner { text-align: center; max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--color-primary-light); color: var(--color-primary-dark); font-weight: 700; font-size: 13px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; }
.hero .lead { font-size: 18px; color: var(--color-text-muted); max-width: 600px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats b { display: block; font-size: 26px; }
.hero-stats span { font-size: 13px; color: var(--color-text-muted); }

/* ---------- Search ---------- */
.tool-search { max-width: 560px; margin: 28px auto 0; position: relative; }
.tool-search input {
  width: 100%; padding: 15px 20px 15px 46px; border-radius: var(--radius-pill); border: 1.5px solid var(--color-border);
  font-size: 15px; background: #fff; box-shadow: var(--shadow-sm);
}
.tool-search input:focus { outline: none; border-color: var(--color-primary); }
.tool-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); opacity: .45; }

/* ---------- Sections & categories ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--color-text-muted); }
.cat-icon { font-size: 22px; margin-right: 10px; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

.tool-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative; overflow: hidden;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tool-card .icon-badge {
  width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--color-primary-light); color: var(--color-primary-dark);
}
.tools-grid.cat-orange .icon-badge { background: var(--color-accent-light); color: #b5471f; }
.tools-grid.cat-navy .icon-badge { background: var(--color-primary-light); color: var(--color-primary-dark); }
.tools-grid.cat-teal .icon-badge { background: var(--color-success-light); color: #0f7a54; }
.tools-grid.cat-red .icon-badge { background: var(--color-danger-light); color: #b23530; }
.tool-card h3 { font-size: 17px; margin: 4px 0 0; }
.tool-card p { color: var(--color-text-muted); font-size: 13.5px; margin: 0; flex: 1; }
.tool-card .tag {
  position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--color-accent-light); color: #b5471f;
}
.tool-card .tag.soon { background: var(--color-surface-alt); color: var(--color-text-muted); }
.tool-card .go { font-size: 13px; font-weight: 700; color: var(--color-primary); display: flex; align-items: center; gap: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: #17162a; color: #b9b7cf; padding: 56px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-grid a { display: block; padding: 5px 0; font-size: 14px; color: #b9b7cf; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { color: #918fac; font-size: 13.5px; max-width: 320px; }
.footer-bottom { border-top: 1px solid #2b2a41; margin-top: 36px; padding-top: 22px; font-size: 13px; color: #7f7d9a; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 13.5px; color: var(--color-text-muted); margin: 22px 0; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs span { margin: 0 6px; }

/* ---------- Tool page layout ---------- */
.tool-header { padding: 8px 0 28px; text-align: center; }
.tool-header h1 { font-size: clamp(26px, 4vw, 36px); }
.tool-header p { color: var(--color-text-muted); max-width: 620px; margin: 0 auto; }
.tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .tool-layout { grid-template-columns: 1fr; } }

.workspace {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.side-rail { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 20px; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed #cbd0e6; border-radius: var(--radius-lg); background: var(--color-surface-alt);
  padding: 48px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--color-primary); background: var(--color-primary-light); }
.dropzone .dz-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone h3 { margin: 0 0 6px; font-size: 18px; }
.dropzone p { color: var(--color-text-muted); font-size: 13.5px; margin: 0; }
.dropzone input[type=file] { display: none; }

/* ---------- Controls ---------- */
.field { margin-bottom: 18px; }
.field label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.field label span.val { color: var(--color-primary); font-weight: 800; }
input[type=range] { width: 100%; accent-color: var(--color-primary); }
input[type=number], input[type=text], select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-size: 14px; background: #fff;
}
input[type=number]:focus, input[type=text]:focus, select:focus { outline: none; border-color: var(--color-primary); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--color-border); background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--color-text-muted);
}
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip:hover { border-color: var(--color-primary); }

/* ---------- Preview / results ---------- */
.preview-box { border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; min-height: 260px; position: relative; }
.preview-box img, .preview-box canvas { max-width: 100%; max-height: 480px; }
.stat-row { display: flex; gap: 14px; margin: 16px 0; flex-wrap: wrap; }
.stat-pill { flex: 1; min-width: 130px; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 14px 16px; }
.stat-pill b { display: block; font-size: 20px; }
.stat-pill span { font-size: 12.5px; color: var(--color-text-muted); }
.stat-pill.good b { color: var(--color-success); }
.progress-bar { height: 8px; border-radius: 999px; background: var(--color-surface-alt); overflow: hidden; margin: 10px 0; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--color-primary), var(--color-primary-2)); width: 0%; transition: width .2s; }

.file-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.file-row { display: flex; align-items: center; gap: 12px; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 10px 14px; }
.file-row img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.file-row .info { flex: 1; min-width: 0; }
.file-row .info b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .info span { font-size: 12px; color: var(--color-text-muted); }
.file-row button { background: none; border: none; color: var(--color-text-muted); font-size: 18px; }
.file-row button:hover { color: var(--color-danger); }

/* ---------- Free crop tool ---------- */
.free-crop-stage { display: flex; justify-content: center; padding: 24px; background: #16152a; border-radius: var(--radius-md); }
.free-crop-inner { position: relative; touch-action: none; overflow: hidden; border-radius: 4px; }
.free-crop-inner img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-rect {
  position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 2000px rgba(10, 12, 24, .55);
  cursor: move; touch-action: none;
}
.crop-dims {
  position: absolute; top: 8px; left: 8px; background: rgba(16, 24, 44, .85); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}
.crop-handle {
  position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--color-accent);
  border-radius: 50%; z-index: 2;
}
.crop-handle[data-handle="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }
.crop-handle[data-handle="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.crop-handle[data-handle="n"] { top: -8px; left: calc(50% - 7px); cursor: ns-resize; }
.crop-handle[data-handle="s"] { bottom: -8px; left: calc(50% - 7px); cursor: ns-resize; }
.crop-handle[data-handle="e"] { right: -8px; top: calc(50% - 7px); cursor: ew-resize; }
.crop-handle[data-handle="w"] { left: -8px; top: calc(50% - 7px); cursor: ew-resize; }

/* ---------- Trust / how-it-works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 22px; }
.step b { display: flex; width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 15px; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }

.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 18px 0; }
.faq-item summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--color-primary); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 10px; color: var(--color-text-muted); }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill);
  background: #fff; border: 1px solid var(--color-border); font-size: 12.5px; font-weight: 700; color: var(--color-text-muted);
}

/* ---------- Before/after slider ---------- */
.ba-slider { position: relative; width: 100%; max-height: 520px; overflow: hidden; border-radius: var(--radius-md); user-select: none; touch-action: none; }
.ba-slider img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.ba-slider .ba-after { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; }
.ba-slider .ba-after img { width: var(--ba-w, 100vw); max-width: none; height: 100%; object-fit: cover; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; cursor: ew-resize;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}
.ba-handle::after {
  content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px;
  background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); font-size: 16px;
}
.ba-label { position: absolute; top: 12px; padding: 5px 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; border-radius: var(--radius-pill); }
.ba-label.left { left: 12px; } .ba-label.right { right: 12px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1c1b2e; color: #fff; padding: 12px 22px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--color-danger); }

/* ---------- misc utils ---------- */
.text-center { text-align: center; }
.muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.hidden { display: none !important; }
.canvas-stage { position: relative; width: 100%; background: var(--color-surface-alt); border-radius: var(--radius-md); overflow: hidden; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- Crop tool (pan & zoom) ---------- */
.crop-stage { display: flex; justify-content: center; padding: 24px; background: #16152a; border-radius: var(--radius-md); }
.crop-frame {
  position: relative; overflow: hidden; border-radius: var(--radius-md);
  cursor: grab; touch-action: none; background: #111;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-frame::after { content: ""; position: absolute; inset: 0; border: 2px solid #fff; border-radius: var(--radius-md); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15) inset; }

.aspect-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.aspect-chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface); font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--color-text-muted); transition: all .15s ease;
}
.aspect-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.aspect-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Collage tool ---------- */
.collage-stage {
  position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1; margin: 0 auto;
  border-radius: var(--radius-md); overflow: hidden; background: #fff;
}
.collage-cell { position: absolute; overflow: hidden; background: var(--color-surface-alt); }
.collage-cell img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; cursor: grab; }
.collage-cell:active img { cursor: grabbing; }
.collage-cell-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-muted); font-size: 12.5px; font-weight: 600;
  border: 1.5px dashed var(--color-border); border-radius: 8px;
}
.collage-cell-empty:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cell-remove-btn {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; z-index: 2;
}
.collage-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 8px; border: 1.5px solid var(--color-border);
  cursor: pointer; overflow: hidden; background: var(--color-surface-alt);
}
.collage-thumb:hover { border-color: var(--color-primary); }
.collage-thumb.active { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(26,35,64,.25); }
.collage-thumb-cell { position: absolute; background: var(--color-border); border: 1px solid #fff; box-sizing: border-box; }
.collage-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

/* ---------- Polaroid collage ---------- */
.polaroid-board {
  position: relative; width: 100%; aspect-ratio: 4 / 3; margin: 0 auto;
  border-radius: var(--radius-md); overflow: hidden; background: #eef0f6;
}
.polaroid-card {
  position: absolute; box-sizing: border-box; background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: grab; user-select: none;
}
.polaroid-card:active { cursor: grabbing; }
.polaroid-photo { position: relative; overflow: hidden; background: var(--color-surface-alt); cursor: grab; }
.polaroid-photo img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }

/* ---------- Text overlay tool ---------- */
.text-preview-box { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.text-preview-box img { max-width: 100%; max-height: 480px; display: block; border-radius: var(--radius-md); }
.text-layer {
  position: absolute; transform: translate(-50%, -50%); white-space: pre; cursor: grab;
  user-select: none; -webkit-user-drag: none; line-height: 1.2; padding: 4px 8px;
}
.text-layer:active { cursor: grabbing; }

/* ---------- Frame tool ---------- */
.frame-preview-box { text-align: center; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 20px; }
.frame-preview-box canvas { max-width: 100%; max-height: 420px; border-radius: 4px; }
.frame-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin: 16px 0; }
.frame-thumb {
  border-radius: 8px; border: 1.5px solid var(--color-border); cursor: pointer; overflow: hidden;
  background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; padding: 4px;
}
.frame-thumb canvas { width: 100%; height: auto; display: block; }
.frame-thumb:hover { border-color: var(--color-primary); }
.frame-thumb.active { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(26,35,64,.25); }

.color-swatch { width: 100%; height: 90px; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.color-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.color-item { text-align: center; }
.color-item .sw { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--color-border); margin-bottom: 6px; cursor: pointer; }
.color-item code { font-size: 11px; }

/* ---------- Color picker tool ---------- */
.picker-box { text-align: center; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 20px; }
.picker-box canvas { max-width: 100%; max-height: 480px; border-radius: 4px; cursor: crosshair; }
.color-readout { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.color-readout .color-swatch { width: 90px; height: 90px; flex: none; }
.color-readout-values { flex: 1; min-width: 0; }
.color-readout-values .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; }
.color-readout-values .row b { font-variant-numeric: tabular-nums; }

/* ---------- Before/after compare tool ---------- */
.compare-box { margin-top: 20px; }
.compare-stage {
  position: relative; width: 100%; max-width: 720px; margin: 0 auto; overflow: hidden;
  border-radius: var(--radius-md); background: var(--color-surface-alt); user-select: none; touch-action: none;
}
.compare-img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare-clip { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; width: 50%; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; cursor: ew-resize; }
.compare-handle-line { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.35); }
.compare-handle-btn {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 42px; height: 42px;
  border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); font-size: 16px;
}
.compare-label {
  position: absolute; top: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  font-weight: 700; letter-spacing: .02em; padding: 5px 12px; border-radius: 20px; pointer-events: none;
}
.compare-label.left { left: 12px; }
.compare-label.right { right: 12px; }

/* ---------- Background removal tool ---------- */
.checker-bg {
  background-image: linear-gradient(45deg, #d8d6ea 25%, transparent 25%), linear-gradient(-45deg, #d8d6ea 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8d6ea 75%), linear-gradient(-45deg, transparent 75%, #d8d6ea 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #f4f3fb;
}
.bg-progress-track { width: 100%; height: 8px; border-radius: 4px; background: var(--color-surface-alt); overflow: hidden; margin-top: 10px; }
.bg-progress-fill { height: 100%; width: 0%; background: var(--color-primary); transition: width .2s ease; }
.bg-progress-label { font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }

/* ---------- Legal / static content pages ---------- */
.legal-content { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; color: var(--color-text-muted); font-size: 15px; line-height: 1.7; }
.legal-content h2 { color: var(--color-text); font-size: 20px; margin-top: 32px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content ul { margin: 0 0 1em; padding-left: 22px; }
.legal-content li { margin-bottom: 6px; }
.legal-content p { margin: 0 0 1em; }
.legal-content .updated { font-size: 13px; color: var(--color-text-muted); margin-bottom: 24px; }

/* ================================================================
   REDESIGN — logo, motion, polish (added on top of the base system)
   ================================================================ */

:root {
  --color-primary-2: #3a4680;
  --shadow-glow: 0 10px 30px rgba(26, 35, 64, .25);
}

/* ---------- Logo ---------- */
.brand-mark { position: relative; animation: logoFloat 3.2s ease-in-out infinite; }
.brand-mark .logo-img {
  animation: apertureSpin 18s linear infinite;
  transform-origin: center;
  filter: drop-shadow(0 3px 10px rgba(244, 96, 10, .35));
  transition: filter .25s ease;
}
.brand:hover .brand-mark .logo-img { animation-duration: 2.4s; filter: drop-shadow(0 5px 16px rgba(244, 96, 10, .55)); }
.brand:hover .brand-mark { animation-duration: 1.4s; }

@keyframes apertureSpin { to { transform: rotate(360deg); } }
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) {
  .brand-mark, .brand-mark .logo-img { animation: none !important; }
}

/* ---------- Header polish ---------- */
.site-header { transition: box-shadow .25s ease, background .25s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(28, 27, 46, .08); background: rgba(255,255,255,.92); }
.main-nav a { position: relative; transition: background .15s ease, color .15s ease; }
.main-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); transform: scaleX(0); transition: transform .2s ease;
}
.main-nav a:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
  position: relative; overflow: hidden;
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(26,35,64,.4); transform: translateY(-1px); }
.btn-accent:hover { box-shadow: 0 10px 26px rgba(255,106,61,.4); transform: translateY(-1px); }
.btn-outline:hover { transform: translateY(-1px); }

/* ---------- Hero motion ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: 0;
  animation: heroFloat 14s ease-in-out infinite;
}
.hero::before { width: 380px; height: 380px; background: #ccd2e8; top: -140px; left: -80px; }
.hero::after { width: 320px; height: 320px; background: #ffd2ac; top: -60px; right: -60px; animation-delay: -6s; }
.hero-inner { position: relative; z-index: 1; }
.hero-logo-decor {
  position: absolute; top: -70px; right: -70px; width: 420px; height: 420px;
  opacity: .09; z-index: 0; pointer-events: none; animation: apertureSpin 60s linear infinite;
}
.hero-logo-decor img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 900px) { .hero-logo-decor { width: 280px; height: 280px; } }
@media (max-width: 600px) { .hero-logo-decor { display: none; } }
@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, 26px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}

.hero h1 {
  background: linear-gradient(100deg, var(--color-text) 30%, var(--color-primary) 65%, var(--color-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Entrance animation ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero-inner > * { animation: fadeUp .6s ease both; }
.hero-inner .eyebrow { animation-delay: .02s; }
.hero-inner h1 { animation-delay: .06s; }
.hero-inner .lead { animation-delay: .1s; }
.hero-inner .hero-actions { animation-delay: .14s; }
.hero-inner .tool-search { animation-delay: .18s; }
.hero-inner .hero-stats { animation-delay: .22s; }

.tools-grid .tool-card { animation: fadeUp .5s ease both; }
.tools-grid .tool-card:nth-child(1) { animation-delay: .02s; }
.tools-grid .tool-card:nth-child(2) { animation-delay: .06s; }
.tools-grid .tool-card:nth-child(3) { animation-delay: .1s; }
.tools-grid .tool-card:nth-child(4) { animation-delay: .14s; }
.tools-grid .tool-card:nth-child(5) { animation-delay: .18s; }
.tools-grid .tool-card:nth-child(6) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) {
  .hero-inner > *, .tools-grid .tool-card { animation: none; }
}

/* ---------- Tool cards ---------- */
.tool-card { border-radius: var(--radius-lg); }
.tool-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover .icon-badge { transform: scale(1.08) rotate(-4deg); background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2)); color: #fff; }
.icon-badge { transition: transform .25s ease, background .25s ease, color .25s ease; }
.tool-card .go { transition: gap .15s ease; }
.tool-card:hover .go { gap: 8px; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none;
}
.mobile-menu.open { visibility: visible; pointer-events: auto; }
.mobile-menu-backdrop {
  position: absolute; inset: 0; background: rgba(20, 18, 40, .45); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s ease;
}
.mobile-menu.open .mobile-menu-backdrop { opacity: 1; }
.mobile-menu-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); background: #fff;
  padding: 20px 22px 28px; box-shadow: -14px 0 40px rgba(20,18,40,.18);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.32,.72,0,1); overflow-y: auto;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-nav-list { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-list a {
  display: block; padding: 14px 8px; font-weight: 700; font-size: 16.5px;
  border-bottom: 1px solid var(--color-border); border-radius: 8px; transition: background .15s ease, padding-left .15s ease;
}
.mobile-nav-list a:hover { background: var(--color-primary-light); padding-left: 14px; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2)); color: #fff; border: none;
  font-size: 18px; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 60;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { filter: brightness(1.08); transform: translateY(-2px) scale(1.03); }

/* ---------- Footer polish ---------- */
.site-footer { position: relative; }
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-2), var(--color-accent));
}
