/* ==========================================================================
   PixelCrop — shared design system
   Mobile-first, light/dark themes, CSS-3D effects, reduced-motion safe
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1180px;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 68px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070c0f;
  --bg-2: #0a1116;
  --surface: #0c141a;
  --surface-2: #101b23;
  --card: #0d1720;
  --border: #1b2a33;
  --border-strong: #2a3d49;
  --text: #e6f1ee;
  --muted: #93a8a2;
  --primary: #10b981;
  --primary-2: #14b8a6;
  --primary-text: #34d399;
  --primary-soft: rgba(16, 185, 129, 0.13);
  --ring: rgba(52, 211, 153, 0.65);
  --btn-text: #04120c;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(52, 211, 153, 0.45);
  --ok-text: #a7f3d0;
  --err-bg: rgba(239, 68, 68, 0.12);
  --err-border: rgba(248, 113, 113, 0.45);
  --err-text: #fecaca;
  --header-bg: rgba(7, 12, 15, 0.82);
  --checker-a: #0b1319;
  --checker-b: #0e1820;
  --dim: rgba(3, 9, 12, 0.62);
  --shadow: 0 24px 55px -22px rgba(0, 0, 0, 0.65);
  --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, 0.5);
  --hero-glow-1: rgba(16, 185, 129, 0.16);
  --hero-glow-2: rgba(20, 184, 166, 0.1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f9f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef5f2;
  --card: #ffffff;
  --border: #dde9e4;
  --border-strong: #c3d6cf;
  --text: #0c1a16;
  --muted: #55706a;
  --primary: #059669;
  --primary-2: #0d9488;
  --primary-text: #047857;
  --primary-soft: rgba(5, 150, 105, 0.1);
  --ring: rgba(5, 150, 105, 0.55);
  --btn-text: #ffffff;
  --ok-bg: rgba(5, 150, 105, 0.08);
  --ok-border: rgba(5, 150, 105, 0.35);
  --ok-text: #065f46;
  --err-bg: rgba(220, 38, 38, 0.07);
  --err-border: rgba(220, 38, 38, 0.35);
  --err-text: #991b1b;
  --header-bg: rgba(255, 255, 255, 0.85);
  --checker-a: #e8efec;
  --checker-b: #f2f7f5;
  --dim: rgba(8, 20, 16, 0.55);
  --shadow: 0 24px 50px -24px rgba(4, 31, 24, 0.28);
  --shadow-soft: 0 10px 26px -14px rgba(4, 31, 24, 0.2);
  --hero-glow-1: rgba(16, 185, 129, 0.14);
  --hero-glow-2: rgba(13, 148, 136, 0.1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Keep hash targets and focused elements clear of the sticky header */
html { scroll-padding-top: calc(var(--header-h) + 14px); }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { flex: 1 0 auto; width: 100%; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--primary-text); }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance;
}

p { text-wrap: pretty; }

[hidden] { display: none !important; }

::selection { background: var(--primary); color: var(--btn-text); }

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

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 100;
  background: var(--primary); color: var(--btn-text);
  padding: 0.7rem 1.1rem; border-radius: 10px;
  font-weight: 700; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.75rem);
}

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.75rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary-text);
  background: var(--primary-soft);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  padding: 0.35rem 0.8rem; border-radius: 999px;
  margin-bottom: 1.1rem;
}

.icon {
  width: 1.15em; height: 1.15em; flex: 0 0 auto;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons / chips / badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.65rem 1.2rem;
  font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--btn-text);
  box-shadow: 0 10px 26px -12px rgba(16, 185, 129, 0.65);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 16px 32px -12px rgba(16, 185, 129, 0.7);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-text);
  background: var(--primary-soft);
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: color-mix(in oklab, var(--primary) 30%, transparent);
}
.btn-soft:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }

.btn-danger {
  background: transparent;
  border-color: var(--err-border);
  color: var(--err-text);
}
.btn-danger:hover:not(:disabled) { background: var(--err-bg); }

.btn:active:not(:disabled) { transform: translateY(0) scale(0.97); }
.btn-lg { padding: 0.9rem 1.7rem; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 38px; padding: 0.4rem 0.85rem; font-size: 0.88rem; border-radius: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 40px; padding: 0.35rem 0.9rem;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--muted);
  font-weight: 650; font-size: 0.87rem;
  cursor: pointer; text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--primary); transform: translateY(-1px); }
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-text);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.3rem 0.7rem; border-radius: 999px;
}
.badge-live { background: var(--primary-soft); color: var(--primary-text); border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent); }
.badge-soon { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 12px 34px -22px rgba(0, 0, 0, 0.45);
}

.header-inner {
  display: flex; align-items: center; gap: 0.9rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.14rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
  margin-right: auto;
}
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; }
.brand-accent { color: var(--primary-text); }

.main-nav ul {
  display: flex; align-items: center; gap: 0.2rem;
  list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  display: block; padding: 0.55rem 0.8rem;
  border-radius: 10px; text-decoration: none;
  color: var(--muted); font-weight: 650; font-size: 0.93rem;
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--text); background: var(--primary-soft); }
.main-nav a.active { color: var(--primary-text); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle, .nav-toggle {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--primary); color: var(--primary-text); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }
.nav-toggle .bars { position: relative; width: 18px; height: 14px; }
.nav-toggle .bars span {
  position: absolute; left: 0; width: 100%; height: 2px;
  border-radius: 2px; background: currentColor;
  transition: transform 0.25s, opacity 0.2s, top 0.25s;
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 6px; }
.nav-toggle .bars span:nth-child(3) { top: 12px; }
body.nav-open .nav-toggle .bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
body.nav-open .nav-toggle .bars span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.8rem clamp(1rem, 4vw, 1.75rem) 1.1rem;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
  }
  body.nav-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .main-nav a { padding: 0.8rem 0.9rem; font-size: 1rem; }
}

@media (min-width: 1024px) {
  .header-actions { margin-left: 0.4rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.4rem 0 1.6rem;
}
.footer-grid { display: grid; gap: 2.4rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 2rem; } }

.footer-brand .brand { margin-bottom: 0.9rem; }
.footer-blurb { color: var(--muted); font-size: 0.94rem; max-width: 34ch; }
.footer-privacy-line {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.1rem; font-size: 0.84rem; font-weight: 650;
  color: var(--primary-text); background: var(--primary-soft);
  border: 1px solid color-mix(in oklab, var(--primary) 28%, transparent);
  padding: 0.45rem 0.8rem; border-radius: 999px;
}
.footer-col h3, .footer-col h2 {
  font-size: 0.8rem; font-weight: 750;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-links a {
  color: var(--muted); text-decoration: none; font-size: 0.94rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary-text); }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  justify-content: space-between; align-items: center;
  margin-top: 2.6rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.87rem;
}
.footer-note { display: inline-flex; align-items: center; gap: 0.45rem; }

/* ---------- Sections / cards / grids ---------- */
.section { padding: 4.2rem 0; }
.section-tight { padding: 2.8rem 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 660px; margin-bottom: 2.6rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.65rem, 3.2vw, 2.25rem); }
.section-head .lead { margin-top: 0.85rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
a.card { text-decoration: none; color: inherit; display: block; }
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.card h3, .card .card-h { font-size: 1.08rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

.card-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
  margin-bottom: 1.05rem;
  transition: transform 0.25s ease;
}
.card-icon .icon { width: 22px; height: 22px; }
.card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }

.card-link-more {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.8rem; font-weight: 700; font-size: 0.9rem;
  color: var(--primary-text); text-decoration: none;
}
.card-link-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Steps */
.steps { display: grid; gap: 1.25rem; counter-reset: step; }
@media (min-width: 900px) { .steps.steps-3 { grid-template-columns: repeat(3, 1fr); } .steps.steps-4 { grid-template-columns: repeat(4, 1fr); } }
.step {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.step:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-soft); }
.step-num {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--btn-text); font-weight: 800; font-size: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.6);
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.step p { color: var(--muted); font-size: 0.94rem; }

/* Format cards */
.format-card { text-align: center; }
.format-ext { font-size: 1.45rem; font-weight: 800; color: var(--primary-text); letter-spacing: 0.02em; }
.format-mime { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

/* Tool cards */
.tool-card { display: flex; flex-direction: column; gap: 0.9rem; }
.tool-card .tool-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tool-card h3 a { color: inherit; text-decoration: none; }
.tool-card h3 a:hover { color: var(--primary-text); }
.tool-card p { flex: 1 0 auto; }

/* Check list */
.check-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.check-list li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--muted); font-size: 0.95rem; }
.check-list .icon { color: var(--primary-text); margin-top: 0.2em; }
.check-list strong { color: var(--text); }

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 480px; }
th, td { padding: 0.8rem 1.05rem; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-2);
  font-size: 0.76rem; font-weight: 750;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--primary-soft); }
td .td-strong { font-weight: 700; color: var(--primary-text); }

/* FAQ */
.faq-group + .faq-group { margin-top: 2.6rem; }
.faq-group h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item + .faq-item { margin-top: 0.75rem; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer; font-weight: 700; font-size: 0.99rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: 0 0 auto;
  width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}
.faq-item[open] summary::after { transform: rotate(225deg); }
.faq-a { padding: 0 1.25rem 1.2rem; color: var(--muted); line-height: 1.72; font-size: 0.95rem; }
.faq-a a { font-weight: 650; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: 24px;
  border: 1px solid color-mix(in oklab, var(--primary) 32%, var(--border));
  background:
    radial-gradient(80% 140% at 15% 0%, var(--hero-glow-1), transparent 60%),
    radial-gradient(70% 120% at 90% 100%, var(--hero-glow-2), transparent 60%),
    var(--card);
  padding: clamp(2.2rem, 5vw, 3.4rem) clamp(1.4rem, 4vw, 3rem);
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); }
.cta-band p { color: var(--muted); max-width: 56ch; margin: 0.8rem auto 1.6rem; }
.cta-band .btn-row { justify-content: center; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Breadcrumbs + page hero */
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  list-style: none; padding: 0; margin: 0 0 1.1rem;
  font-size: 0.86rem; color: var(--muted);
}
.breadcrumbs li { display: flex; align-items: center; gap: 0.35rem; }
.breadcrumbs li + li::before { content: "/"; opacity: 0.45; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 650; }

.page-hero {
  padding: 3rem 0 2.4rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(65% 130% at 50% 0%, var(--hero-glow-1), transparent 72%);
}
.page-hero h1 { font-size: clamp(1.95rem, 4.6vw, 2.85rem); letter-spacing: -0.025em; }
.page-hero .lead { max-width: 62ch; margin-top: 0.9rem; }

/* Prose (content pages) */
.prose { max-width: 78ch; }
.prose h2 { font-size: 1.5rem; margin: 2.7rem 0 0.9rem; letter-spacing: -0.015em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.14rem; margin: 1.9rem 0 0.55rem; }
.prose p { margin: 0.85rem 0; line-height: 1.78; color: var(--text); }
.prose p, .prose li { overflow-wrap: break-word; }
.prose ul, .prose ol { margin: 0.85rem 0 0.85rem 1.3rem; display: grid; gap: 0.5rem; line-height: 1.7; }
.prose li::marker { color: var(--primary-text); font-weight: 700; }
.prose a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--text); }
.prose .table-wrap { margin: 1.2rem 0; }
.prose blockquote {
  margin: 1.2rem 0; padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 4.4rem);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px);
}
.hero-bg::before {
  width: 560px; height: 560px; top: -220px; right: -120px;
  background: var(--hero-glow-1);
}
.hero-bg::after {
  width: 460px; height: 460px; bottom: -240px; left: -160px;
  background: var(--hero-glow-2);
}
.hero-inner {
  position: relative;
  display: grid; gap: 3rem; align-items: center;
}
@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: 1.04fr 0.96fr; gap: 2rem; }
}
.hero h1 {
  font-size: clamp(2.25rem, 5.6vw, 3.55rem);
  line-height: 1.07; letter-spacing: -0.03em;
}
.grad-text {
  background: linear-gradient(115deg, var(--primary-text), #5eead4 85%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub { margin-top: 1.1rem; max-width: 56ch; }
.hero .btn-row { margin-top: 1.8rem; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  margin-top: 1.7rem; padding: 0; list-style: none;
}
.hero-trust li {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--muted); font-size: 0.88rem; font-weight: 600;
}
.hero-trust .icon { color: var(--primary-text); }

/* 3D crop scene — visual story: image → smart crop → cropped image */
.hero-visual { perspective: 1400px; display: grid; place-items: center; }
.crop-scene {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 560 / 470;
  transform-style: preserve-3d;
  transition: transform 0.35s ease-out;
  will-change: transform;
}
.scene-float {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  animation: sceneBob 11s ease-in-out infinite;
}
@keyframes sceneBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.scene-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-backplate {
  position: absolute; left: 3.5%; top: -2%;
  width: 78%; aspect-ratio: 4 / 3;
  border-radius: 18px;
  transform: rotateX(8deg) rotateY(-13deg) translateZ(-48px);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(13, 148, 136, 0.06) 52%, rgba(4, 47, 39, 0.4));
  border: 1px solid rgba(94, 234, 212, 0.22);
  box-shadow: 0 26px 54px -30px rgba(0, 0, 0, 0.55);
}
.scene-label {
  position: absolute; left: 12px; bottom: 10px;
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(3, 16, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d7fff4;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.07em; text-transform: uppercase;
  pointer-events: none;
}
.scene-main {
  position: absolute; left: 0; top: 2%;
  width: 78%; aspect-ratio: 4 / 3;
  border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 34px 70px -26px rgba(0, 0, 0, 0.6);
  transform: rotateX(8deg) rotateY(-13deg);
}
.scene-result {
  position: absolute; right: 0; bottom: 5%;
  width: 46%; aspect-ratio: 1 / 1;
  transform: rotateX(8deg) rotateY(-13deg) translateZ(56px);
}
.sr-inner {
  position: absolute; inset: 0;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--card);
  box-shadow:
    0 30px 60px -22px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: resultFly 9s infinite;
}
@keyframes resultFly {
  0%, 54% { opacity: 0; transform: translate(-60%, -52%) scale(0.58); animation-timing-function: cubic-bezier(0.3, 0.9, 0.32, 1.04); }
  68% { opacity: 1; transform: translate(0, 0) scale(1); }
  92% { opacity: 1; transform: translate(0, 0) scale(1); }
  99%, 100% { opacity: 0; transform: translate(1.5%, 2%) scale(0.97); }
}
.sr-img {
  position: absolute; display: block;
  width: 240%; height: auto; max-width: none;
  left: -90%; top: -39.95%;
}
.sr-badge {
  position: absolute; left: -10px; bottom: -12px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--btn-text);
  font-size: 0.78rem; font-weight: 800;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(4px) scale(0.92);
  animation: srBadgeCycle 9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.sr-badge .icon { width: 0.95em; height: 0.95em; }
@keyframes srBadgeCycle {
  0%, 62% { opacity: 0; transform: translateY(4px) scale(0.92); }
  71%, 90% { opacity: 1; transform: translateY(0) scale(1); }
  97%, 100% { opacity: 0; transform: translateY(3px) scale(0.95); }
}
.scene-shadow {
  position: absolute; left: 6%; right: 4%; bottom: -4%;
  height: 11%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.55), transparent 72%);
  filter: blur(6px);
  animation: shadowPulse 9s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 54% { transform: scaleX(0.94); opacity: 0.65; }
  70% { transform: scaleX(1.05); opacity: 0.95; }
  92%, 100% { transform: scaleX(1); opacity: 0.85; }
}
.scene-scan {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(94, 234, 212, 0.26) 50%, transparent 68%);
  background-size: 240% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  animation: scanSweep 9s linear infinite;
  pointer-events: none;
}
@keyframes scanSweep {
  0%, 34% { opacity: 0; background-position: 130% 0; }
  38% { opacity: 0.9; }
  52% { opacity: 0.55; background-position: -30% 0; }
  57%, 100% { opacity: 0; background-position: -30% 0; }
}

/* Animated crop frame on the hero photo */
.hero-frame {
  position: absolute;
  inset: 8% 12% 16% 9%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(2, 8, 10, 0.5);
  opacity: 0;
  animation: frameCycle 9s infinite;
}
@keyframes frameCycle {
  0% { opacity: 0; inset: 8% 12% 16% 9%; }
  5% { opacity: 1; inset: 8% 12% 16% 9%; animation-timing-function: cubic-bezier(0.6, 0.05, 0.3, 1); }
  32%, 93% { opacity: 1; inset: 22.2% 20.8% 22.2% 37.5%; }
  99%, 100% { opacity: 0; inset: 8% 12% 16% 9%; }
}
/* Subtle breathing glow on the locked crop boundary */
.hero-frame::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 10px;
  border: 2px solid rgba(94, 234, 212, 0.9);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.5), inset 0 0 10px rgba(94, 234, 212, 0.26);
  opacity: 0;
  animation: hfGlowCycle 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hfGlowCycle {
  0%, 33% { opacity: 0; }
  40% { opacity: 0.85; }
  52% { opacity: 0.35; }
  64% { opacity: 0.7; }
  76% { opacity: 0.3; }
  88% { opacity: 0.55; }
  96%, 100% { opacity: 0; }
}
.hf-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: calc(100% / 3) calc(100% / 3);
  opacity: 0;
  animation: hfGridCycle 9s linear infinite;
}
@keyframes hfGridCycle {
  0%, 30% { opacity: 0; }
  36%, 90% { opacity: 0.8; }
  96%, 100% { opacity: 0; }
}
.hf-handle {
  position: absolute; width: 12px; height: 12px;
  background: #ffffff; border-radius: 3px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: scale(0);
  animation: hfHandleCycle 9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.hf-tl { top: -7px; left: -7px; }
.hf-tr { top: -7px; right: -7px; }
.hf-bl { bottom: -7px; left: -7px; }
.hf-br { bottom: -7px; right: -7px; }
@keyframes hfHandleCycle {
  0%, 31% { opacity: 0; transform: scale(0); }
  40%, 91% { opacity: 1; transform: scale(1); }
  96%, 100% { opacity: 0; transform: scale(0); }
}
.hf-tag {
  position: absolute; top: -38px; left: -2px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 9px;
  background: var(--primary);
  color: var(--btn-text);
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(6px);
  animation: hfTagCycle 9s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
.hf-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
@keyframes hfTagCycle {
  0%, 36% { opacity: 0; transform: translateY(6px); }
  44%, 90% { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(4px); }
}
.hf-size {
  top: auto; bottom: 8px; left: auto; right: 8px;
  background: rgba(4, 10, 14, 0.82);
  color: #ffffff;
}
.hf-size::before { display: none; }

/* Static frame variant (homepage preview mock) */
.hero-frame.static { animation: none; opacity: 1; inset: 13% 22% 11% 31%; }
.hero-frame.static .hf-grid,
.hero-frame.static .hf-handle { animation: none; opacity: 1; transform: none; }
.hero-frame.static .hf-tag { animation: none; opacity: 1; transform: none; }

[data-theme="light"] .scene-main {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 34px 70px -30px rgba(4, 31, 24, 0.4);
}
[data-theme="light"] .sr-inner {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 30px 60px -26px rgba(4, 31, 24, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
[data-theme="light"] .scene-shadow {
  background: radial-gradient(50% 50% at 50% 50%, rgba(4, 31, 24, 0.32), transparent 72%);
}
[data-theme="light"] .scene-backplate {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(13, 148, 136, 0.05) 52%, rgba(4, 47, 39, 0.16));
  border-color: rgba(13, 148, 136, 0.22);
  box-shadow: 0 26px 54px -32px rgba(4, 31, 24, 0.4);
}
[data-theme="light"] .scene-label {
  background: rgba(4, 31, 24, 0.68);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
  .scene-main { transform: rotateX(6deg) rotateY(-9deg); }
  .scene-backplate { transform: rotateX(6deg) rotateY(-9deg) translateZ(-30px); }
  .scene-result { transform: rotateX(6deg) rotateY(-9deg) translateZ(34px); }
  .fc-2 { left: -1%; }
  .fc-3 { bottom: 16%; left: 0; }
  .hero-frame { border-width: 1.5px; }
}
.float-chip {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
  font-weight: 750; font-size: 0.84rem; color: var(--text);
  animation: floaty 6.5s ease-in-out infinite;
}
.float-chip .icon { color: var(--primary-text); width: 1em; height: 1em; }
.fc-1 { top: -3%; right: 2%; animation-delay: 0s; }
.fc-2 { top: 40%; left: -3%; animation-delay: 1.4s; }
.fc-3 { bottom: 2%; left: 5%; animation-delay: 2.6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-13px); }
}

/* Logo strip / formats row */
.formats-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* Tool preview mock */
.preview-shell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.preview-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.preview-bar i:first-child { background: var(--primary); }
.preview-body {
  display: grid; gap: 1.1rem; padding: clamp(1.2rem, 3.5vw, 2.2rem);
}
@media (min-width: 820px) { .preview-body { grid-template-columns: 1.25fr 0.75fr; align-items: center; } }
.preview-canvas {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.preview-canvas .scene-photo { position: absolute; inset: 0; height: 100%; }
.preview-canvas .hero-frame { animation: none; opacity: 1; inset: 13% 22% 11% 31%; }
.preview-canvas .hf-grid,
.preview-canvas .hf-handle { animation: none; opacity: 1; transform: none; }
.preview-side { display: grid; gap: 0.65rem; }
.preview-row {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.55rem 0.8rem;
  font-size: 0.88rem; color: var(--muted); font-weight: 600;
}
.preview-row .icon { color: var(--primary-text); }

/* ---------- Reveal animations ---------- */
/* Hidden state only applies when JS is running (html.js) — no-JS users see everything. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
html.js [data-reveal].in-view { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  /* Hero scene: freeze on the finished "cropped" state */
  .hero-frame { animation: none; opacity: 1; inset: 22.2% 20.8% 22.2% 37.5%; }
  .hero-frame::after { animation: none; opacity: 0; }
  .hf-grid, .hf-handle, .hf-tag { animation: none; opacity: 1; transform: none; }
  .scene-scan { animation: none; opacity: 0; }
  .sr-inner { animation: none; opacity: 1; transform: none; }
  .sr-badge { animation: none; opacity: 1; transform: none; }
  .scene-float { animation: none; }
  .float-chip { animation: none; }
}

/* ==========================================================================
   CROP TOOL
   ========================================================================== */
.tool-shell {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(1.1rem, 3vw, 1.9rem);
  box-shadow: var(--shadow-soft);
}

.tool-message {
  display: flex; align-items: flex-start; gap: 0.7rem;
  border-radius: var(--radius);
  border: 1px solid;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.94rem; font-weight: 600;
  animation: msgIn 0.3s ease;
}
.tool-message .icon { margin-top: 0.15em; }
.tool-message.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.tool-message.err { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } }

/* Upload */
.dropzone {
  position: relative;
  display: grid; place-items: center; gap: 0.35rem;
  text-align: center;
  padding: clamp(2.2rem, 6vw, 3.6rem) 1.4rem;
  border: 2px dashed var(--border-strong);
  border-radius: 18px;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.008);
  box-shadow: 0 0 0 6px var(--primary-soft), var(--shadow);
}
.dz-glow {
  position: absolute; inset: -60%;
  background: conic-gradient(from 0deg, transparent 0deg 320deg, var(--primary-soft) 342deg, transparent 360deg);
  animation: dzSpin 7s linear infinite;
  pointer-events: none;
  opacity: 0.8;
}
@keyframes dzSpin { to { transform: rotate(360deg); } }
.dz-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
  margin-bottom: 0.7rem;
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  position: relative;
}
.dz-icon .icon { width: 26px; height: 26px; }
.dz-title { position: relative; font-size: 1.14rem; font-weight: 750; }
.dz-browse { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.dz-sub { position: relative; color: var(--muted); font-size: 0.89rem; }
.dz-actions { position: relative; margin-top: 1rem; }
.dz-hint {
  position: relative; margin-top: 1rem;
  font-size: 0.78rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.35rem 0.8rem;
}

/* Editor */
.editor-top {
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.file-meta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--muted); font-weight: 600;
  max-width: 100%;
  min-width: 0;
}
.file-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aspect-chips {
  display: flex; gap: 0.45rem;
  overflow-x: auto; padding: 2px;
  scrollbar-width: none;
  max-width: 100%;
}
.aspect-chips::-webkit-scrollbar { display: none; }

.crop-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(64svh, 560px);
  margin-inline: auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  background:
    repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) 0 0 / 24px 24px;
}
@media (max-width: 639px) { .crop-viewport { aspect-ratio: auto; height: min(72svh, 470px); } }
.crop-viewport.dragging { cursor: grabbing; }
.crop-viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.crop-box {
  position: absolute;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 100vmax var(--dim);
  cursor: move;
  outline: none;
  touch-action: none;
}
.crop-box::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: calc(100% / 3) calc(100% / 3);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s;
}
.crop-box:hover::before, .crop-box:focus-visible::before { opacity: 0.8; }
.crop-box:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.crop-handle {
  position: absolute;
  width: 26px; height: 26px;
  background: transparent; border: 0; padding: 0;
  cursor: inherit;
  touch-action: none;
}
.crop-handle::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  translate: -50% -50%;
  width: 13px; height: 13px;
  background: #ffffff; border-radius: 3.5px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, background 0.15s ease;
}
.crop-handle:hover::after, .crop-handle:focus-visible::after { transform: scale(1.25); background: var(--primary); }
.crop-handle:focus-visible { outline: none; }
.crop-handle[data-dir="nw"] { left: -13px; top: -13px; cursor: nwse-resize; }
.crop-handle[data-dir="n"]  { left: calc(50% - 13px); top: -13px; cursor: ns-resize; }
.crop-handle[data-dir="ne"] { right: -13px; top: -13px; cursor: nesw-resize; }
.crop-handle[data-dir="e"]  { right: -13px; top: calc(50% - 13px); cursor: ew-resize; }
.crop-handle[data-dir="se"] { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop-handle[data-dir="s"]  { left: calc(50% - 13px); bottom: -13px; cursor: ns-resize; }
.crop-handle[data-dir="sw"] { left: -13px; bottom: -13px; cursor: nesw-resize; }
.crop-handle[data-dir="w"]  { left: -13px; top: calc(50% - 13px); cursor: ew-resize; }
.crop-handle[data-dir="n"]::after, .crop-handle[data-dir="s"]::after { width: 20px; height: 5px; }
.crop-handle[data-dir="e"]::after, .crop-handle[data-dir="w"]::after { width: 5px; height: 20px; }

.crop-size {
  position: absolute; right: 7px; bottom: 7px;
  background: rgba(4, 10, 14, 0.78);
  color: #ffffff;
  font-size: 0.74rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.28rem 0.55rem; border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.7rem 1rem;
  align-items: center; justify-content: space-between;
  margin-top: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
.tb-group { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.tb-label { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-right: 0.15rem; }
.tb-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}
.tb-btn:hover { border-color: var(--primary); color: var(--primary-text); transform: translateY(-1px); }
.tb-btn:active { transform: scale(0.94); }
.tb-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.zoom-range {
  width: clamp(110px, 26vw, 190px);
  accent-color: var(--primary);
  cursor: pointer;
}
.zoom-val {
  min-width: 46px; text-align: center;
  font-size: 0.8rem; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums;
}

.editor-actions {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-top: 1.2rem; justify-content: flex-end;
}
.editor-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .editor-actions .btn { flex: 0 0 auto; } }

/* Result */
.result-grid { display: grid; gap: 1.6rem; }
@media (min-width: 900px) { .result-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; } }
.result-figure {
  margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) 0 0 / 24px 24px;
  padding: 0.8rem;
  display: grid; place-items: center;
  min-height: 240px;
}
.result-figure img {
  max-width: 100%; max-height: 480px;
  border-radius: 8px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.55);
  animation: resultIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes resultIn { from { opacity: 0; transform: scale(0.965); } }
.result-side h2 { font-size: 1.35rem; }
.result-meta { display: grid; gap: 0.45rem; margin: 1.1rem 0; font-size: 0.92rem; }
.result-meta > div {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px dashed var(--border); padding-bottom: 0.45rem;
}
.result-meta dt { color: var(--muted); }
.result-meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.export-controls {
  display: grid; gap: 0.9rem;
  margin-bottom: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.export-controls label { display: grid; gap: 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.export-controls select {
  min-height: 42px; padding: 0.4rem 0.7rem;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  cursor: pointer;
}
.quality-row { display: flex; align-items: center; gap: 0.7rem; }
.quality-row input { flex: 1; accent-color: var(--primary); }
.quality-val { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.result-actions { display: grid; gap: 0.6rem; }
.result-actions .btn-row { display: grid; gap: 0.6rem; }
@media (min-width: 480px) { .result-actions .btn-row { grid-template-columns: 1fr 1fr; } }
.result-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.9rem; }

/* Loading indicator */
.load-bar {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: loadSlide 1.1s ease-in-out infinite;
  z-index: 5;
}
@keyframes loadSlide {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}
