/* ImgFlowTools — "Nebula Glass" design system v2 (2026-11-21 full redesign).
   Original structure + visuals created for ImgFlowTools: floating glass nav,
   split hero with a working quick tool, list-row tool cards, and a two-column
   rail-and-stage tool workspace. Deep-space dark glass, violet-to-cyan
   aurora; light-glass variant via the theme toggle. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 900;
  font-display: optional;
  src: url("/assets/fonts/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink-900: #eef1ff;
  --ink-700: #c6cbe8;
  --ink-500: #9298bd;
  --ink-300: #62688c;
  --ink-100: rgba(255, 255, 255, 0.09);
  --paper-0: rgba(255, 255, 255, 0.045);
  --paper-50: #060913;
  --paper-100: rgba(255, 255, 255, 0.07);
  --brand-600: #7c3aed;
  --brand-500: #a78bfa;
  --brand-100: rgba(139, 92, 246, 0.16);
  --accent-500: #22d3ee;
  --accent-100: rgba(34, 211, 238, 0.12);
  --ok-500: #34d399;
  --warn-500: #fbbf24;
  --aurora:
    radial-gradient(900px 480px at 12% -8%, rgba(124, 58, 237, 0.32), transparent 60%),
    radial-gradient(820px 460px at 88% -4%, rgba(6, 182, 212, 0.24), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(217, 70, 239, 0.10), transparent 60%);
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(2, 4, 12, 0.45);
  --shadow-lg: 0 24px 60px rgba(124, 58, 237, 0.28);
  --container: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="light"] {
  --ink-900: #171233;
  --ink-700: #3d3663;
  --ink-500: #6a6390;
  --ink-300: #a49ec4;
  --ink-100: rgba(23, 18, 51, 0.12);
  --paper-0: rgba(255, 255, 255, 0.72);
  --paper-50: #eceefb;
  --paper-100: rgba(23, 18, 51, 0.06);
  --brand-100: rgba(124, 58, 237, 0.12);
  --accent-100: rgba(6, 182, 212, 0.14);
  --aurora:
    radial-gradient(900px 480px at 12% -8%, rgba(124, 58, 237, 0.20), transparent 60%),
    radial-gradient(820px 460px at 88% -4%, rgba(6, 182, 212, 0.18), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(217, 70, 239, 0.08), transparent 60%);
  --shadow-sm: 0 1px 2px rgba(23, 18, 51, 0.07), 0 1px 1px rgba(23, 18, 51, 0.05);
  --shadow-md: 0 10px 30px rgba(23, 18, 51, 0.10);
  --shadow-lg: 0 24px 60px rgba(124, 58, 237, 0.20);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(139, 92, 246, 0.45); }
body {
  margin: 0;
  background-color: var(--paper-50);
  background-image: var(--aurora);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink-900);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #111827; color: #fff; padding: .6rem 1rem; z-index: 1000; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Floating glass nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0 6px;
  background: transparent;
}
.nx-navpill {
  display: flex; align-items: center; gap: 22px;
  padding: 10px 12px 10px 20px;
  background: color-mix(in srgb, var(--paper-50) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--ink-100); border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled .nx-navpill { box-shadow: var(--shadow-md); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink-900); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
}
.main-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.main-nav a { color: var(--ink-700); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--brand-500); text-decoration: none; }
.main-nav .btn-primary { padding: 9px 18px; font-size: 0.9rem; min-height: 44px; }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--ink-100); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; color: var(--ink-700);
}
.nav-toggle { display: none; }
@media (max-width: 920px) {
  .main-nav {
    position: fixed; inset: 76px 16px auto 16px; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--paper-50); border: 1px solid var(--ink-100);
    border-radius: 20px; padding: 14px; box-shadow: var(--shadow-md);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
  }
  .main-nav.open { transform: translateY(0); opacity: 1; visibility: visible; transition: transform .22s ease, opacity .22s ease; }
  .main-nav a { padding: 9px 10px; border-radius: 12px; }
  .main-nav a:hover { background: var(--paper-0); }
  .main-nav .btn-primary { margin-top: 8px; text-align: center; }
  .main-nav .theme-toggle { align-self: flex-start; margin: 6px 0 2px 10px; }
  .nav-toggle { display: flex; margin-left: auto; }
  .nx-navpill { gap: 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500) 55%, var(--accent-500));
  color: #fff; box-shadow: 0 12px 28px -8px rgba(124, 58, 237, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -10px rgba(124, 58, 237, 0.7); }
.btn-primary:disabled { background: var(--paper-100); border-color: var(--ink-300); color: var(--ink-500); box-shadow: none; cursor: not-allowed; transform: none; opacity: .85; }
.btn-ghost { background: var(--paper-0); color: var(--ink-900); border-color: var(--ink-100); }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-500); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-accent { background: var(--accent-500); color: #03222b; }
.btn-small { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }

/* ---------- Hero: split layout + quick tool ---------- */
.hero { position: relative; padding: 44px 0 26px; overflow: visible; }
.nx-hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 30px; align-items: start; }
@media (max-width: 920px) { .nx-hero-grid { grid-template-columns: 1fr; } }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--brand-100); color: var(--brand-500); border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--brand-500) 25%, transparent);
  animation: fadeUp .6s var(--ease) both;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0 0 16px; letter-spacing: -0.03em;
  font-weight: 900; line-height: 1.08; animation: fadeUp .7s var(--ease) .05s both;
}
.hero h1 .gradient-text {
  background: linear-gradient(100deg, var(--brand-500), var(--accent-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: 1.15rem; color: var(--ink-500); max-width: 540px; margin: 0 0 26px; animation: fadeUp .7s var(--ease) .12s both; }
.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; animation: fadeUp .7s var(--ease) .18s both; }
.trust-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 26px 0 0; animation: fadeUp .7s var(--ease) .24s both; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  background: var(--paper-0); border: 1px solid var(--ink-100); color: var(--ink-700); border-radius: 999px;
  font-size: 0.82rem; font-weight: 700;
}
.chip svg { color: var(--ok-500); flex-shrink: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .hero-badge, .hero h1, .hero p.lede, .hero-cta-row, .trust-row { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Quick tool panel (homepage hero) */
.nx-quicktool {
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: fadeUp .7s var(--ease) .15s both;
}
.nx-quick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.nx-quick-head h2 { font-size: 1rem; margin: 0; letter-spacing: -0.01em; }
.nx-quick-head a { font-size: 0.85rem; font-weight: 700; white-space: nowrap; padding: 6px 12px; border: 1.5px solid var(--ink-100); border-radius: 999px; background: var(--paper-0); }
.nx-quick-head a:hover { border-color: var(--brand-500); color: var(--brand-500); text-decoration: none; }
.nx-quicktool .dropzone { padding: 30px 16px; }
.nx-quicktool .tool-controls { margin: 20px 0 0; align-items: flex-start; }
.nx-quicktool .preview-row { margin: 20px 0 0; }
.nx-quicktool .preview-box { min-height: 104px; }
.nx-quicktool .preview-box img, .nx-quicktool .preview-box canvas { max-height: 150px; }
.nx-quicktool .status-line { margin: 12px 0 0; }
.nx-quicktool .file-meta { margin: 6px 0 0; }
.nx-quicktool .action-row { margin-top: 20px; }
.nx-quicktool .action-row .btn { width: 100%; }

/* ---------- Search + filter ---------- */
.search-bar { max-width: 480px; margin: 0 auto 22px; position: relative; }
.search-bar input {
  width: 100%; padding: 13px 16px 13px 42px; border-radius: 999px;
  border: 1.5px solid var(--ink-300); font-size: 1rem; background: var(--paper-100); color: var(--ink-900);
}
.search-bar svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-500); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 30px; }
.filter-chip {
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--ink-100);
  background: var(--paper-0); color: var(--ink-700); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s var(--ease);
}
.filter-chip:hover { border-color: var(--brand-500); color: var(--brand-500); transform: translateY(-1px); }
.filter-chip[aria-pressed="true"] {
  background: var(--brand-600);
  color: #fff; border-color: var(--brand-600); box-shadow: none;
}

/* ---------- Tool list rows ---------- */
.tool-grid { display: flex; flex-direction: column; gap: 10px; max-width: 880px; margin: 14px auto 56px; }
.tool-card {
  display: grid; grid-template-columns: 46px 1fr auto; grid-template-areas: "icon title arrow" "icon desc arrow";
  column-gap: 16px; align-items: center;
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 15px 20px; position: relative; overflow: hidden;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s ease;
}
.tool-card::after {
  content: "\2192"; grid-area: arrow; font-size: 1.45rem; font-weight: 700; color: var(--ink-500);
  transition: transform .22s var(--ease), color .22s ease;
}
.tool-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; border-color: color-mix(in srgb, var(--brand-500) 40%, var(--ink-100)); }
.tool-card:hover::after { transform: translateX(4px); color: var(--brand-500); }
.tool-card .icon {
  grid-area: icon; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-100), var(--accent-100));
  color: var(--brand-500); display: flex; align-items: center; justify-content: center;
}
.tool-card h3, .tool-card h2 { grid-area: title; margin: 0; font-size: 1rem; color: var(--ink-900); align-self: end; }
.tool-card p { grid-area: desc; margin: 2px 0 0; font-size: 0.85rem; color: var(--ink-500); align-self: start; }
.tool-card .soon-badge {
  display: inline-block; margin-left: 8px; font-size: 0.72rem; font-weight: 700; vertical-align: 2px;
  color: var(--warn-500); background: rgba(251, 191, 36, 0.14); padding: 3px 9px; border-radius: 999px;
}

/* ---------- Homepage tool grid — part-2 redesign (scoped to the homepage
   #tool-grid section so category hub pages keep the classic list) ---------- */
#tool-grid .tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 12px; max-width: none; margin: 14px auto 30px;
}
#tool-grid .tool-card {
  column-gap: 14px; padding: 14px 16px;
  transition: border-color .18s ease, background .18s ease, transform .18s var(--ease);
}
#tool-grid .tool-card:hover {
  border-color: rgba(139, 92, 246, .5); background: var(--paper-100); box-shadow: none;
}
#tool-grid .tool-card .icon { position: relative; }
#tool-grid .tile-badge {
  position: absolute; right: -5px; bottom: -6px;
  background: var(--paper-50); border: 1px solid var(--ink-100); color: var(--ink-700);
  font-size: 8px; font-weight: 800; letter-spacing: .02em;
  padding: 1.5px 4px; border-radius: 6px; line-height: 1.25;
}
#tool-grid .tool-card h3, #tool-grid .tool-card h2 { font-size: .98rem; font-weight: 700; line-height: 1.25; align-self: center; }
#tool-grid .tool-card p {
  font-size: .83rem; line-height: 1.45; margin: 0; align-self: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Sections ---------- */
section { padding: 8px 0; }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 52px 0 10px; font-weight: 800; letter-spacing: -0.01em; text-align: center; }
.section-sub { color: var(--ink-500); text-align: center; max-width: 560px; margin: 0 auto 8px; }
.lede-sm { color: var(--ink-500); max-width: 720px; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 28px 0 56px; }
.step-card {
  text-align: left; padding: 22px; border-radius: var(--radius-md);
  background: var(--paper-0); border: 1px solid var(--ink-100);
}
.step-num {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--brand-100), var(--accent-100)); color: var(--brand-500);
  font-weight: 900; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
}
.step-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--ink-500); font-size: 0.9rem; }
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 28px 0 56px; }
.benefit-card {
  padding: 26px 22px; border-radius: var(--radius-md); background: var(--paper-0);
  border: 1px solid var(--ink-100); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.benefit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.benefit-card .icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  background: var(--accent-100); color: var(--accent-500);
  display: flex; align-items: center; justify-content: center;
}
.benefit-card h3 { margin: 0 0 6px; font-size: 1rem; }
.benefit-card p { margin: 0; color: var(--ink-500); font-size: 0.9rem; }
.home-faq { max-width: 760px; margin: 0 auto 56px; }
.home-faq .faq-item { margin-bottom: 5px; }
.cta-band {
  text-align: center; padding: 56px 24px; border-radius: var(--radius-xl); margin: 10px 0 56px;
  background: linear-gradient(135deg, #150b2e, #0b1030 55%, #04222b);
  border: 1px solid var(--ink-100); color: #fff;
}
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 10px; }
.cta-band p { color: #a7a9cc; margin: 0 0 24px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Tool hero ---------- */
.tool-hero { padding: 30px 0 6px; }
.breadcrumb { font-size: 0.85rem; color: var(--ink-500); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb span[aria-current] { color: var(--ink-900); font-weight: 600; }
.tool-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 850; }
.tool-hero .subhead { color: var(--ink-500); margin: 0 0 20px; max-width: 680px; font-size: 1rem; }

/* ---------- Workspace: rail + stage ---------- */
.workspace {
  display: grid; grid-template-columns: 302px minmax(0, 1fr); gap: 18px; align-items: start;
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-md); margin-bottom: 36px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.nx-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nx-stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
}
.nx-rail .dropzone { padding: 30px 16px; }
.nx-rail .tool-controls { flex-direction: column; align-items: stretch; margin: 0; gap: 14px; }
.nx-rail .control { min-width: 0; }
.nx-rail .action-row { margin-top: 0; }
.nx-rail .action-row .btn { width: 100%; }
.nx-rail .limits-box { margin: 0; }
.nx-stage .preview-row { margin: 0; }
.nx-stage .status-line { margin: 0; }
.nx-stage .file-meta { margin: 0; }
.nx-stage .hint-line { margin: 0; text-align: center; }
.nx-stage .crop-stage, .nx-stage .frame-wrap { align-self: center; }
.nx-stage .pdf-file-list { margin: 0; }

.dropzone {
  border: 2px dashed color-mix(in srgb, var(--brand-500) 45%, transparent); border-radius: var(--radius-md);
  padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone.dragover { border-color: var(--brand-500); background: var(--brand-100); }
.dropzone svg { color: var(--brand-500); margin-bottom: 10px; }
.dropzone .hint { color: var(--ink-500); font-size: 0.85rem; margin-top: 6px; }
.dropzone input[type="file"] { display: none; }

.tool-controls { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin: 20px 0; }
.control { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.control label { font-size: 0.82rem; font-weight: 700; color: var(--ink-700); }
.control input[type="number"], .control select {
  padding: 9px 11px; border-radius: 12px; border: 1.5px solid var(--ink-100); font-size: 0.95rem;
  background: var(--paper-0); color: var(--ink-900); width: 100%;
}
.control input[type="range"] { accent-color: var(--brand-600); width: 100%; }
.control .value-tag { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand-500); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-700); }

.pdf-file-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.pdf-file-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--ink-100); border-radius: 12px; background: var(--paper-0);
}
.pdf-file-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.pdf-file-label { flex: 1; font-size: 0.85rem; color: var(--ink-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 680px) { .preview-row { grid-template-columns: 1fr; } }
.preview-box {
  border: 1px solid var(--ink-100); border-radius: var(--radius-md); overflow: hidden;
  background: repeating-conic-gradient(var(--paper-100) 0% 25%, var(--paper-0) 0% 50%) 50% / 16px 16px;
  min-height: 180px; display: flex; align-items: center; justify-content: center; position: relative;
}
.preview-box img, .preview-box canvas { max-height: 420px; }
.preview-label {
  position: absolute; top: 8px; left: 8px; background: rgba(4, 8, 16, 0.88); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; z-index: 2;
}

.crop-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; }
.crop-stage canvas { display: block; max-width: 100%; }
.crop-box {
  position: absolute; border: 2px solid var(--accent-500); touch-action: none;
  box-shadow: 0 0 0 9999px rgba(3, 6, 14, 0.55); cursor: move;
}
.crop-handle {
  position: absolute; width: 16px; height: 16px; background: var(--accent-500);
  border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; touch-action: none;
}
@media (max-width: 680px) {
  .crop-handle { width: 26px; height: 26px; }
  .crop-handle[data-handle="nw"] { left: -13px !important; top: -13px !important; }
  .crop-handle[data-handle="ne"] { right: -13px !important; top: -13px !important; }
  .crop-handle[data-handle="sw"] { left: -13px !important; bottom: -13px !important; }
  .crop-handle[data-handle="se"] { right: -13px !important; bottom: -13px !important; }
}

.zoom-control { max-width: none; margin: 0; }
.zoom-value { font-size: 0.82rem; color: var(--ink-500); margin-left: 8px; }
.frame-wrap { display: flex; justify-content: center; margin: 10px 0; }
.photo-frame {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  background: #0a0f1e; border-radius: var(--radius-md);
  border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm);
}
.photo-frame:active { cursor: grabbing; }
.photo-frame img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.photo-frame-guide {
  position: absolute; inset: 8%; border: 2px dashed rgba(255, 255, 255, 0.65);
  border-radius: 50% / 42%; pointer-events: none;
}
.hint-line { font-size: 0.85rem; color: var(--ink-500); margin: 10px 0; }
.file-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-500); margin: 10px 0; }
.file-meta b { color: var(--ink-900); }
.size-savings { color: var(--ok-500); font-weight: 700; }
.status-line { font-size: 0.9rem; margin: 10px 0; min-height: 1.4em; }
.status-line.error { color: #f87171; }
.status-line.ok { color: var(--ok-500); }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Content blocks ---------- */
.content-block { max-width: 780px; }
.content-block h2 { font-size: 1.32rem; margin: 42px 0 12px; letter-spacing: -0.01em; }
.content-block h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.content-block p, .content-block li { color: var(--ink-700); }
.content-block ul { padding-left: 1.3em; }
.content-block ol {
  list-style: none; counter-reset: step; padding: 0; margin: 16px 0;
  display: grid; gap: 10px;
}
.content-block ol li {
  counter-increment: step; position: relative;
  background: var(--paper-0); border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 14px 16px 14px 58px;
}
.content-block ol li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px;
  width: 30px; height: 30px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-100), var(--accent-100)); color: var(--brand-500);
  font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
}
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ink-100); }
.spec-table th { color: var(--ink-500); font-weight: 700; }

.faq-item {
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  background: var(--paper-0); padding: 15px 18px; margin-bottom: 10px;
}
.faq-item summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand-500); font-size: 1.2rem; }
.faq-item[open ] summary::after { content: "\2212"; }
.faq-item p { margin: 10px 0 0; color: var(--ink-700); }

.related-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 48px; }
.related-chip {
  padding: 8px 14px; border: 1px solid var(--ink-100); border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-700); background: var(--paper-0);
}
.related-chip:hover { border-color: var(--brand-500); color: var(--brand-500); text-decoration: none; }

.limits-box {
  background: var(--accent-100); border: 1px solid color-mix(in srgb, var(--accent-500) 38%, transparent);
  border-radius: var(--radius-md); padding: 16px 18px; font-size: 0.9rem; color: var(--ink-700); margin: 18px 0;
}
.limits-box b { color: var(--ink-900); }

/* ---------- Generic pages / blog ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.prose { max-width: 760px; padding-bottom: 48px; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { color: var(--ink-700); }

/* ---------- Footer ---------- */
.site-footer { background: #04060d; color: #c6cbe8; margin-top: 64px; padding: 44px 0 26px; border-top: 1px solid rgba(255, 255, 255, 0.07); overflow: hidden; }
.site-footer a { color: #c6cbe8; }
.site-footer a:hover { color: #fff; }
.nx-foot-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.nx-foot-brand .brand { color: #fff; }
.nx-foot-brand p { margin: 0; color: #9298bd; font-size: 0.9rem; }
.nx-foot-brand .footer-badge { margin-left: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 28px; }
.footer-grid h4, .footer-grid h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: #62688c; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; font-size: 0.9rem; }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.82rem; color: #62688c; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.nx-wordmark {
  font-size: clamp(3rem, 11.5vw, 8.2rem); font-weight: 900; letter-spacing: -0.03em; line-height: 0.95;
  text-align: center; margin-top: 30px; user-select: none; white-space: nowrap;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.28), rgba(34, 211, 238, 0.05));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="light"] .site-footer { background: #0a0f24; }
