/* ==========================================================================
   Invogeen — shared stylesheet
   Design system, components and layout for all pages.
   All colours are CSS custom properties. Never hard-code a colour below.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces & text (light theme) */
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #64748B;

  /* Brand */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF2FF;
  --primary-ink: #4338CA;      /* AA-safe primary for small text on light bg */
  --accent: #F97316;
  --accent-soft: #FFF7ED;
  --accent-ink: #C2410C;       /* AA-safe accent for small text on light bg */

  /* Feedback */
  --success: #15803D;
  --success-soft: #F0FDF4;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --warning: #B45309;
  --warning-soft: #FFFBEB;

  /* Header / overlay */
  --header-bg: rgba(255, 255, 255, 0.78);
  --overlay: rgba(15, 23, 42, 0.45);
  --ring: rgba(79, 70, 229, 0.35);

  /* Radii */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -2px rgba(15, 23, 42, 0.06), 0 12px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 18px 50px -12px rgba(15, 23, 42, 0.22);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* Layout */
  --container: 1200px;
  --header-h: 64px;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0A0F1C;
  --bg-soft: #111827;
  --surface: #161E2E;
  --surface-2: #1D2637;
  --border: #27303F;
  --border-strong: #3A4559;
  --text: #F1F5F9;
  --text-muted: #94A3B8;

  --primary: #818CF8;
  --primary-hover: #A5B4FC;
  --primary-soft: #1E2439;
  --primary-ink: #A5B4FC;
  --accent: #FB923C;
  --accent-soft: #2A1D12;
  --accent-ink: #FDBA74;

  --success: #4ADE80;
  --success-soft: #122017;
  --danger: #F87171;
  --danger-soft: #241316;
  --warning: #FBBF24;
  --warning-soft: #241C0D;

  --header-bg: rgba(10, 15, 28, 0.8);
  --overlay: rgba(2, 6, 16, 0.65);
  --ring: rgba(129, 140, 248, 0.45);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -2px rgba(0, 0, 0, 0.35), 0 12px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 50px -12px rgba(0, 0, 0, 0.65);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 200ms ease, color 200ms ease;
}

body.is-locked { overflow: hidden; }

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

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

a {
  color: var(--primary-ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); }
h3 { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); }
h4 { font-size: 1.0625rem; }

p { text-wrap: pretty; }

ul, ol { padding-left: 1.25rem; }
li + li { margin-top: var(--s-2); }

code, pre, kbd { font-family: var(--mono); font-size: 0.9375em; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-8) 0;
}

::selection {
  background: var(--primary);
  color: #FFFFFF;
}

/* Visible focus for keyboard users only */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* The hidden attribute must beat any display rule set elsewhere. */
[hidden] { display: none !important; }

.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: -100px;
  left: var(--s-4);
  z-index: 200;
  padding: var(--s-3) var(--s-4);
  background: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: top 150ms ease;
}
.skip-link:focus-visible {
  top: var(--s-3);
  text-decoration: none;
  outline-color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-4);
}

.section { padding-block: var(--s-16); }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: var(--s-12); }

.section-head {
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--s-12);
  text-align: center;
}
.section-head p {
  margin-top: var(--s-3);
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--s-3);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.prose { max-width: 72ch; }
.prose p + p { margin-top: var(--s-4); }
.prose h2, .prose h3 { margin-top: var(--s-8); margin-bottom: var(--s-3); }
.prose ul, .prose ol { margin-top: var(--s-4); }
.prose a { text-decoration: underline; }

.stack > * + * { margin-top: var(--s-4); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

@media (min-width: 768px) {
  .container { padding-inline: var(--s-6); }
  .section { padding-block: var(--s-24); }
  .section--tight { padding-block: var(--s-16); }
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-3) var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease,
              transform 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

[data-theme="dark"] .btn { color: #0A0F1C; }

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
}
[data-theme="dark"] .btn--ghost { color: var(--text); }

.btn--soft {
  background: var(--primary-soft);
  color: var(--primary-ink);
  border-color: var(--border);
}
.btn--soft:hover { background: var(--surface-2); }
[data-theme="dark"] .btn--soft { color: var(--primary-ink); }

.btn--danger { background: var(--danger); }
.btn--danger:hover { filter: brightness(0.92); background: var(--danger); }

.btn--sm { min-height: 36px; padding: var(--s-2) var(--s-4); font-size: 0.9375rem; }
.btn--lg { min-height: 52px; padding: var(--s-4) var(--s-8); font-size: 1.0625rem; }
.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   5. HEADER + NAV + MEGA MENU
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }

.nav-desktop { display: none; }

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list li + li { margin-top: 0; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--primary-ink); }
.nav-link .chev {
  width: 14px; height: 14px;
  transition: transform 180ms ease;
}
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* Mega menu */
.has-mega { position: relative; }

.mega {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 110;
  width: min(1100px, calc(100vw - 32px));
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 180ms;
}
.has-mega.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-6);
}

.mega-col h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.mega-col > p {
  margin: var(--s-1) 0 var(--s-3);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.mega-col ul {
  margin: 0; padding: 0;
  list-style: none;
}
.mega-col li + li { margin-top: 2px; }

.mega-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.3;
}
.mega-link:hover { background: var(--surface-2); text-decoration: none; }
.mega-link svg {
  width: 18px; height: 18px;
  flex: none;
  color: var(--primary);
}

.mega-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}
.mega-foot span { color: var(--text-muted); }
.mega-foot a { font-weight: 600; }

/* Mobile drawer */
.nav-toggle { display: inline-flex; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms ease, visibility 200ms ease;
}
.drawer.is-open { visibility: visible; opacity: 1; }

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  border: 0;
  width: 100%;
  cursor: pointer;
}

.drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(420px, 90vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 220ms ease-out;
}
.drawer.is-open .drawer-panel { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: var(--header-h);
  padding-inline: var(--s-4);
  border-bottom: 1px solid var(--border);
  flex: none;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-4) var(--s-4) var(--s-12);
}

.drawer-link {
  display: block;
  padding: var(--s-3) var(--s-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
}
.drawer-link:hover { background: var(--surface-2); text-decoration: none; }

.drawer-sep {
  height: 1px;
  margin: var(--s-4) 0;
  background: var(--border);
}

.accordion { border-bottom: 1px solid var(--border); }
.accordion:first-of-type { border-top: 1px solid var(--border); }

.accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-4) var(--s-2);
  border: 0;
  background: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.accordion-btn .chev {
  width: 18px; height: 18px;
  flex: none;
  color: var(--text-muted);
  transition: transform 180ms ease;
}
.accordion-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.accordion-panel {
  display: none;
  padding: 0 var(--s-2) var(--s-4);
}
.accordion-panel.is-open { display: block; }
.accordion-panel ul { margin: 0; padding: 0; list-style: none; }
.accordion-panel li + li { margin-top: 2px; }
.accordion-panel a {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 400;
}
.accordion-panel a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.accordion-panel a svg { width: 18px; height: 18px; flex: none; color: var(--primary); }

@media (min-width: 1024px) {
  .nav-desktop { display: block; }
  .nav-toggle { display: none; }
}

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 85vh;
  padding-block: var(--s-16);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero-grid-overlay {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 78%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  will-change: transform;
}
[data-theme="dark"] .blob { opacity: 0.3; }

.blob--1 {
  width: 46vw; height: 46vw;
  min-width: 320px; min-height: 320px;
  top: -12%; left: -8%;
  background: var(--primary);
  animation: drift1 18s ease-in-out infinite alternate;
}
.blob--2 {
  width: 38vw; height: 38vw;
  min-width: 280px; min-height: 280px;
  top: 20%; right: -10%;
  background: var(--accent);
  animation: drift2 24s ease-in-out infinite alternate;
}
.blob--3 {
  width: 42vw; height: 42vw;
  min-width: 300px; min-height: 300px;
  bottom: -20%; left: 28%;
  background: var(--primary);
  animation: drift3 30s ease-in-out infinite alternate;
}

@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(8vw, 6vh, 0) scale(1.12); }
}
@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-7vw, 9vh, 0) scale(0.95); }
}
@keyframes drift3 {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to   { transform: translate3d(5vw, -8vh, 0) scale(1.1); }
}

.hero-inner {
  max-width: 820px;
  margin-inline: auto;
}

.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .hl { color: var(--accent); }

.hero-sub {
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: var(--s-8);
  font-size: 1.125rem;
  color: var(--text-muted);
}

.rotator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-muted);
}
.rotator-window {
  position: relative;
  display: inline-block;
  width: 15ch;
  height: 1.8em;
  overflow: hidden;
  text-align: left;
}
.rotator-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  color: var(--primary-ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms ease;
}
.rotator-word.is-active { opacity: 1; transform: translateY(0); }

.hero .btn-row { justify-content: center; }

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-12);
  padding: 0;
  list-style: none;
}
.stat-chips li + li { margin-top: 0; }
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  font-size: 0.9375rem;
  font-weight: 600;
}
.stat-chip svg { width: 16px; height: 16px; color: var(--primary); flex: none; }

/* Staggered entrance */
.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.d-0 { animation-delay: 0ms; }
.d-1 { animation-delay: 80ms; }
.d-2 { animation-delay: 160ms; }
.d-3 { animation-delay: 240ms; }
.d-4 { animation-delay: 320ms; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Page header (non-home pages) */
.page-hero {
  padding-block: var(--s-12) var(--s-8);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.page-hero h1 { margin-bottom: var(--s-3); }
.page-hero .lede {
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* --------------------------------------------------------------------------
   7. CARDS & GRIDS
   -------------------------------------------------------------------------- */
.card {
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid { gap: var(--s-6); }
  .grid--3, .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Tool card */
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.tool-card h3 { font-size: 1.0625rem; }
.tool-card p {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.tool-card .more {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-ink);
}
.tool-card a.stretch {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  z-index: 1;
}
.tool-card a.stretch:hover { text-decoration: none; }
.tool-card a.stretch:focus-visible { outline-offset: -3px; }

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-bottom: var(--s-2);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-ink);
  flex: none;
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-icon--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* Category card */
.cat-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cat-card > p { font-size: 0.9375rem; color: var(--text-muted); }
.cat-card ul { margin: 0; padding: 0; list-style: none; }
.cat-card li + li { margin-top: var(--s-1); }
.cat-card li a {
  display: block;
  padding: var(--s-1) 0;
  font-size: 0.9375rem;
  color: var(--text);
}
.cat-card li a:hover { color: var(--primary-ink); }
.cat-card .cat-more {
  margin-top: auto;
  padding-top: var(--s-3);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Feature / step blocks */
.feature {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.feature h3 { font-size: 1.0625rem; }
.feature p { font-size: 0.9375rem; color: var(--text-muted); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin-bottom: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--primary-ink);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* CTA band */
.cta-band {
  padding: var(--s-12) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
}
.cta-band p {
  max-width: 54ch;
  margin: var(--s-3) auto var(--s-6);
  color: var(--text-muted);
}
.cta-band .btn-row { justify-content: center; }

/* --------------------------------------------------------------------------
   8. FAQ (details/summary)
   -------------------------------------------------------------------------- */
.faq {
  max-width: 820px;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-6);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 10px; height: 10px;
  flex: none;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { background: var(--surface-2); }
.faq .faq-body {
  padding: 0 var(--s-6) var(--s-6);
  font-size: 1rem;
  color: var(--text-muted);
}
.faq .faq-body p + p { margin-top: var(--s-3); }

/* --------------------------------------------------------------------------
   9. BREADCRUMB
   -------------------------------------------------------------------------- */
.crumb {
  padding-block: var(--s-4);
  font-size: 0.875rem;
}
.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0; padding: 0;
  list-style: none;
}
.crumb li { display: flex; align-items: center; gap: var(--s-2); }
.crumb li + li { margin-top: 0; }
.crumb li + li::before {
  content: "›";
  color: var(--text-muted);
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text); }
.crumb [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   10. TOOL UI SHELL
   -------------------------------------------------------------------------- */
.tool-layout { display: block; }

.tool-main { min-width: 0; }

.tool-wrap {
  margin-block: var(--s-6) var(--s-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tool-wrap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.tool-wrap-head h2 {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.tool-wrap-head .hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.tool-body { padding: var(--s-6); }

.tool-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-6);
  padding: var(--s-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.tab {
  flex: 1 1 auto;
  min-height: 38px;
  padding: var(--s-2) var(--s-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab-panel[hidden] { display: none; }

/* Forms */
.field { margin-bottom: var(--s-4); }
.field:last-child { margin-bottom: 0; }

.field label,
.field-label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.field .help {
  margin-top: var(--s-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.textarea {
  min-height: 180px;
  line-height: 1.6;
  resize: vertical;
}
.textarea--mono { font-family: var(--mono); font-size: 0.9375rem; }
.select {
  appearance: none;
  padding-right: var(--s-8);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field-row {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .field-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: 0.9375rem;
  cursor: pointer;
}
.check input {
  width: 20px; height: 20px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--primary);
  cursor: pointer;
}
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.chip {
  min-height: 36px;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.chip:hover { color: var(--text); border-color: var(--text-muted); }
.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}
[data-theme="dark"] .chip[aria-pressed="true"] { color: #0A0F1C; }

.range {
  width: 100%;
  height: 28px;
  accent-color: var(--primary);
  cursor: pointer;
}
.range-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.range-row .range { flex: 1; }
.range-val {
  min-width: 68px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-muted);
}

/* Drop zone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 190px;
  padding: var(--s-8) var(--s-6);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone svg { width: 36px; height: 36px; color: var(--text-muted); }
.dropzone strong { font-size: 1rem; }
.dropzone span { font-size: 0.875rem; color: var(--text-muted); }

/* Result area */
.result {
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.result:empty { display: none; }
.result-label {
  margin-bottom: var(--s-1);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.result-big {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.result-formula {
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.out-box {
  width: 100%;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 460px;
  overflow-y: auto;
}

.msg {
  display: none;
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.msg.is-on { display: block; }
.msg--error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.msg--ok { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.msg--warn { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.msg--info { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }

.err-text {
  display: block;
  margin-top: var(--s-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 1.2em;
}

/* Stats grid inside tools */
.stat-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-box {
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}
.stat-box .n {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.stat-box .l {
  display: block;
  margin-top: var(--s-1);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Data table */
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.table caption {
  margin-bottom: var(--s-3);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: left;
}
.table th, .table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.table th {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-soft);
  white-space: nowrap;
}
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-total td { font-weight: 700; background: var(--bg-soft); }

/* Canvas / preview stage */
.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--border) 25%, transparent 25%, transparent 75%, var(--border) 75%),
    linear-gradient(45deg, var(--border) 25%, transparent 25%, transparent 75%, var(--border) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  overflow: auto;
}
.stage canvas, .stage img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.stage--plain {
  background-image: none;
  background: var(--bg-soft);
}

.pad-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .pad-grid--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pad-grid--sidebar { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
}

/* Thumbnail list (reorderable) */
.thumbs {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  margin: 0; padding: 0;
  list-style: none;
}
.thumbs li { margin: 0; }
.thumb {
  position: relative;
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: grab;
}
.thumb.is-dragging { opacity: 0.4; }
.thumb.is-target { border-color: var(--primary); }
.thumb img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.thumb .name {
  display: block;
  margin-top: var(--s-2);
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb-x {
  position: absolute;
  top: -8px; right: -8px;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.thumb-x:hover { background: var(--danger-soft); }

/* Spinner */
.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.spinner.is-on { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.busy {
  display: none;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.busy.is-on { display: flex; }

/* Toast */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: var(--s-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: var(--s-3) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-on { opacity: 1; transform: translateY(0); }
.toast--ok { border-color: var(--success); color: var(--success); }
.toast--err { border-color: var(--danger); color: var(--danger); }

/* --------------------------------------------------------------------------
   11. AD SLOTS
   -------------------------------------------------------------------------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-block: var(--s-12);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}
.ad-slot::before {
  content: "Advertisement";
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
}
.ad-slot:not(:empty)::before { content: none; }
.ad-slot--leader { min-height: 120px; }
.ad-slot--inline { min-height: 280px; }
.ad-slot--footer { min-height: 120px; }
.ad-slot--rail {
  display: none;
  min-height: 600px;
  margin-block: 0;
}
@media (min-width: 768px) {
  .ad-slot--leader { min-height: 100px; }
  .ad-slot--inline { min-height: 250px; }
}

.tool-rail { display: none; }

@media (min-width: 1280px) {
  .tool-layout {
    display: grid;
    gap: var(--s-8);
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .tool-rail { display: block; position: sticky; top: calc(var(--header-h) + 24px); }
  .ad-slot--rail { display: flex; }
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--s-24);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.footer-grid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: 1fr;
  padding-block: var(--s-16) var(--s-12);
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-12); }
}

.footer-brand p {
  margin-top: var(--s-4);
  max-width: 34ch;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.footer-brand .tagline {
  margin-top: var(--s-3);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-ink);
}

.footer-col h2 {
  margin-bottom: var(--s-4);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li + li { margin-top: var(--s-2); }
.footer-col a {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.footer-col a:hover { color: var(--text); }

.footer-bar {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-block: var(--s-6);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}
@media (min-width: 768px) {
  .footer-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
  }
}

/* --------------------------------------------------------------------------
   13. DIRECTORY / FILTER PAGE
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.filter-bar .search-wrap {
  flex: 1 1 240px;
  min-width: 0;
}
.cat-block { scroll-margin-top: calc(var(--header-h) + 24px); }
.cat-block + .cat-block { margin-top: var(--s-16); }
.cat-block > h2 { margin-bottom: var(--s-2); }
.cat-block > p { margin-bottom: var(--s-6); color: var(--text-muted); }
.cat-block[hidden] { display: none; }
.tool-card[hidden] { display: none; }

.empty-state {
  display: none;
  padding: var(--s-12);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
}
.empty-state.is-on { display: block; }

/* 404 */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding-block: var(--s-16);
  text-align: center;
}
.notfound .code {
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   14. REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .blob { animation: none; }
  .fade-up { opacity: 1; transform: none; animation: none; }
  .rotator-word { transition: none; }
  .drawer-panel { transition: none; }
}

/* --------------------------------------------------------------------------
   15. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .ad-slot, .drawer, .toast-wrap,
  .tool-foot, .crumb, .skip-link { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  .tool-wrap { border: 0; box-shadow: none; }
}

/* --------------------------------------------------------------------------
   16. CROP BOX (image cropper tool)
   -------------------------------------------------------------------------- */
.crop-area {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  touch-action: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.crop-area canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #FFFFFF;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  cursor: move;
}
.crop-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent 33.33%, rgba(255,255,255,0.4) 33.33%, rgba(255,255,255,0.4) 33.56%, transparent 33.56%,
                    transparent 66.66%, rgba(255,255,255,0.4) 66.66%, rgba(255,255,255,0.4) 66.89%, transparent 66.89%),
    linear-gradient(to bottom, transparent 33.33%, rgba(255,255,255,0.4) 33.33%, rgba(255,255,255,0.4) 33.56%, transparent 33.56%,
                    transparent 66.66%, rgba(255,255,255,0.4) 66.66%, rgba(255,255,255,0.4) 66.89%, transparent 66.89%);
}
.crop-h {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background: #FFFFFF;
  z-index: 2;
}
.crop-h[data-h="nw"] { top: 0;    left: 0;    cursor: nwse-resize; }
.crop-h[data-h="n"]  { top: 0;    left: 50%;  cursor: ns-resize; }
.crop-h[data-h="ne"] { top: 0;    left: 100%; cursor: nesw-resize; }
.crop-h[data-h="e"]  { top: 50%;  left: 100%; cursor: ew-resize; }
.crop-h[data-h="se"] { top: 100%; left: 100%; cursor: nwse-resize; }
.crop-h[data-h="s"]  { top: 100%; left: 50%;  cursor: ns-resize; }
.crop-h[data-h="sw"] { top: 100%; left: 0;    cursor: nesw-resize; }
.crop-h[data-h="w"]  { top: 50%;  left: 0;    cursor: ew-resize; }
