/* =========================================================
   THEME TOKENS
   ========================================================= */
:root {
  color-scheme: dark;

  --max-width: 1120px;
  --header-width: 1180px;

  --bg-main: linear-gradient(135deg, #050814 0%, #07111f 52%, #101b38 100%);

  --surface: rgba(8, 12, 26, 0.88);
  --surface-strong: rgba(8, 11, 23, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.075);

  --card-bg: rgba(9, 13, 28, 0.86);
  --card-bg-strong: rgba(10, 16, 34, 0.76);

  --text-main: #f7f9ff;
  --text-soft: #dee7f4;
  --text-muted: #aab7cf;

  --accent: #8b0000;
  --accent-bright: #ff4f64;
  --accent-blue: #86b0ff;

  --imagix: #a66cff;
  --imagix-soft: rgba(166, 108, 255, 0.13);
  --imagix-border: rgba(166, 108, 255, 0.32);
  --imagix-strong: #c7a3ff;
  --imagix-blue: #43d7ff;

  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 79, 100, 0.32);

  --sidebar-bg: rgba(7, 10, 22, 0.96);
  --sidebar-divider: rgba(255, 255, 255, 0.12);

  --btn-text: #ffffff;

  --product-bg: rgba(10, 16, 34, 0.72);
  --product-overlay:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0) 58%);

  --input-bg: rgba(255, 255, 255, 0.055);

  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 22px 46px rgba(0, 0, 0, 0.34);
  --shadow-featured: 0 26px 68px rgba(0, 0, 0, 0.36);
  --shadow-atmosphere: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 42px rgba(0, 0, 0, 0.26);

  --focus-ring: rgba(166, 108, 255, 0.92);

  --hero-halo:
    radial-gradient(circle at 50% 38%, rgba(166, 108, 255, 0.15), transparent 26%),
    radial-gradient(circle at 61% 50%, rgba(67, 215, 255, 0.11), transparent 29%);

  --hero-title-gradient: linear-gradient(
    90deg,
    #c7a3ff 0%,
    #a66cff 38%,
    #43d7ff 72%,
    #86b0ff 100%
  );

  --cursor-aura:
    radial-gradient(circle, rgba(166, 108, 255, 0.28) 0%, rgba(67, 215, 255, 0.17) 44%, transparent 72%);
}

body[data-theme="light"] {
  color-scheme: light;

  --bg-main: linear-gradient(135deg, #fffefd 0%, #fff7fb 52%, #f3edf8 100%);

  --surface: rgba(255, 249, 252, 0.92);
  --surface-strong: rgba(255, 252, 254, 0.94);
  --surface-soft: rgba(67, 48, 86, 0.055);
  --surface-hover: rgba(67, 48, 86, 0.075);

  --card-bg: rgba(255, 252, 254, 0.9);
  --card-bg-strong: rgba(255, 252, 254, 0.78);

  --text-main: #181923;
  --text-soft: #2a2d40;
  --text-muted: #676a7b;

  --accent: #9f2449;
  --accent-bright: #d95882;
  --accent-blue: #8d80ff;

  --imagix: #6f3ec7;
  --imagix-soft: rgba(166, 108, 255, 0.14);
  --imagix-border: rgba(111, 62, 199, 0.28);
  --imagix-strong: #6f3ec7;
  --imagix-blue: #287ea0;

  --border: rgba(42, 30, 59, 0.11);
  --border-strong: rgba(217, 88, 130, 0.28);

  --sidebar-bg: rgba(255, 249, 252, 0.97);
  --sidebar-divider: rgba(42, 30, 59, 0.12);

  --btn-text: #181923;

  --product-bg: rgba(255, 252, 254, 0.78);
  --product-overlay:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 56%);

  --input-bg: rgba(67, 48, 86, 0.055);

  --shadow-soft: 0 12px 24px rgba(50, 32, 65, 0.09);
  --shadow-card: 0 22px 44px rgba(50, 32, 65, 0.13);
  --shadow-featured: 0 26px 58px rgba(50, 32, 65, 0.15);
  --shadow-atmosphere: 0 0 0 1px rgba(255, 255, 255, 0.34), 0 18px 40px rgba(50, 32, 65, 0.08);

  --focus-ring: rgba(111, 62, 199, 0.86);

  --hero-halo:
    radial-gradient(circle at 50% 38%, rgba(166, 108, 255, 0.14), transparent 25%),
    radial-gradient(circle at 61% 50%, rgba(67, 215, 255, 0.11), transparent 30%);

  --hero-title-gradient: linear-gradient(
    90deg,
    #171722 0%,
    #6f3ec7 54%,
    #287ea0 100%
  );

  --cursor-aura:
    radial-gradient(circle, rgba(166, 108, 255, 0.2) 0%, rgba(67, 215, 255, 0.13) 46%, transparent 72%);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.35s ease, color 0.25s ease;
  overflow-x: hidden;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

main#main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden],
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   SKIP LINK
   ========================================================= */
.skip-link {
  position: absolute;
  top: -52px;
  left: 16px;
  z-index: 3000;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1300;
  padding: 14px 16px 0;
}

.header-shell {
  width: min(var(--header-width), calc(100vw - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, var(--surface-soft), transparent),
    var(--surface);
  box-shadow: var(--shadow-atmosphere);
  overflow: hidden;
  flex: 0 0 auto;
}

.brand__mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand__title {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand__sub {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav > a,
.desktop-products-toggle {
  height: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  appearance: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.desktop-nav > a:hover,
.desktop-nav > a:focus-visible,
.desktop-products-toggle:hover,
.desktop-products-toggle:focus-visible {
  transform: translateY(-1px);
  background: var(--surface-soft);
  border-color: var(--border);
}

.desktop-nav > a.active,
.desktop-nav > a[aria-current="page"],
.desktop-products-toggle.is-active {
  border-color: var(--imagix-border);
  background: var(--surface-soft);
  font-weight: 500;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.22s ease;
}

.desktop-products-toggle[aria-expanded="true"] .toggle-icon,
.submenu-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 230px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
}

.dropdown-panel a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus-visible {
  transform: translateX(4px);
  background: var(--surface-soft);
  color: var(--text-main);
}

.dropdown-panel a.active,
.dropdown-panel a[aria-current="page"] {
  color: var(--imagix-strong);
  background: var(--imagix-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    var(--surface-strong);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  background: var(--surface-soft);
  border-color: var(--imagix-border);
}

.theme-toggle__icon {
  line-height: 1;
}

.hamburger {
  display: none;
}

.hamburger__lines {
  position: relative;
  display: block;
  width: 20px;
  height: 16px;
}

.hamburger__line {
  position: absolute;
  left: 0;
  width: 20px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.18s ease, top 0.22s ease;
}

.hamburger__line--top { top: 0; }
.hamburger__line--middle { top: 6.75px; }
.hamburger__line--bottom { top: 13.5px; }

.hamburger.active .hamburger__line--top {
  top: 6.75px;
  transform: rotate(45deg);
}

.hamburger.active .hamburger__line--middle {
  opacity: 0;
  transform: scaleX(0.72);
}

.hamburger.active .hamburger__line--bottom {
  top: 6.75px;
  transform: rotate(-45deg);
}

/* =========================================================
   MOBILE SIDEBAR
   ========================================================= */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(4, 6, 12, 0.52);
  backdrop-filter: blur(4px);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  width: min(340px, 88vw);
  padding: 92px 24px 28px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  transform: translateX(-104%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s ease, visibility 0.28s ease;
}

.sidebar.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.sidebar > ul {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.sidebar li {
  border-bottom: 1px solid var(--sidebar-divider);
}

.sidebar li.has-submenu {
  border-bottom: none;
  margin-bottom: -0.2rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar a:hover,
.sidebar a:focus-visible {
  color: var(--imagix-strong);
  transform: translateX(4px);
}

.sidebar a.active,
.sidebar a[aria-current="page"] {
  color: var(--imagix-strong);
  transform: translateX(4px);
  position: relative;
}

.sidebar a.active::before,
.sidebar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 6px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--imagix), var(--imagix-blue));
  transform: translateY(-50%);
  box-shadow: 0 0 14px rgba(166, 108, 255, 0.22);
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  border-bottom: 1px solid var(--sidebar-divider);
}

.menu-link {
  flex: 1;
  min-height: 50px;
  padding: 0;
}

.submenu-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--imagix-border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.submenu-toggle:hover,
.submenu-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--imagix);
  background: var(--surface-soft);
}

.submenu {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 1rem;
  padding-left: 0.3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--sidebar-divider);
}

.submenu li {
  margin-right: 20px;
}

.submenu a {
  min-height: 38px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* =========================================================
   PRODUCT HERO
   ========================================================= */
.product-hero {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 92px 16px 46px;
  text-align: center;
  isolation: isolate;
}

.product-hero::before {
  content: "";
  position: absolute;
  inset: 48px 14% auto;
  height: 230px;
  background: var(--hero-halo);
  filter: blur(48px);
  opacity: 0.78;
  z-index: -1;
}

.product-eyebrow {
  margin-bottom: 0.9rem;
  color: var(--imagix-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.product-hero h1 {
  display: inline-block;
  padding-bottom: 0.08em;
  font-size: clamp(2.7rem, 5vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
  font-weight: 800;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  max-width: 48ch;
  margin: 1rem auto 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-soft);
}

/* =========================================================
   IMAGIX TOOL
   ========================================================= */
.imagix-section {
  width: min(var(--max-width), calc(100vw - 40px));
  margin: 0 auto;
  padding: 14px 0 78px;
}

.imagix-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    var(--product-overlay),
    linear-gradient(135deg, var(--imagix-soft), transparent 44%),
    var(--product-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 2.1rem;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.imagix-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(166, 108, 255, 0.08), transparent 64%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 58%);
  opacity: 0.62;
  pointer-events: none;
}

.imagix-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--imagix), var(--imagix-blue));
  pointer-events: none;
}

.imagix-card:hover,
.imagix-card:focus-within {
  transform: translateY(-5px);
  border-color: var(--imagix-border);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px rgba(166, 108, 255, 0.08);
}

.imagix-card__intro,
.imagix-card__grid {
  position: relative;
  z-index: 2;
}

.imagix-card__intro {
  max-width: 70ch;
  margin-bottom: 1.6rem;
}

.product-kicker {
  margin-bottom: 0.65rem;
  color: var(--imagix-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.imagix-card h2 {
  margin-bottom: 0.55rem;
  color: var(--text-main);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.imagix-card p {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.imagix-card__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.82fr);
  align-items: start;
  gap: 2rem;
}

.imagix-workspace {
  display: grid;
  gap: 1.05rem;
}

/* =========================================================
   UPLOAD
   ========================================================= */
.upload {
  display: grid;
  gap: 0.8rem;
}

.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 1rem;
  border: 1px dashed var(--imagix-border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    var(--input-bg);
  cursor: pointer;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag {
  transform: translateY(-2px);
  border-color: var(--imagix);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0)),
    var(--surface-soft);
  box-shadow: 0 0 0 4px rgba(166, 108, 255, 0.08);
  outline: none;
}

.dropzone__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--imagix-border);
  border-radius: 16px;
  background: var(--surface-soft);
  font-size: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dropzone__title {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dropzone__sub {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.meta {
  text-align: left;
}

/* =========================================================
   FORM / TOOL PANELS
   ========================================================= */
.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.tool-btn {
  min-height: 42px;
  padding: 0.58rem 0.68rem;
  border: 1px solid var(--imagix-border);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.026);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.tool-btn:hover,
.tool-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--imagix);
  background: var(--surface-soft);
}

.tool-btn.active {
  border-color: var(--imagix);
  background:
    linear-gradient(135deg, rgba(166, 108, 255, 0.26), rgba(67, 215, 255, 0.12));
  box-shadow: 0 10px 24px rgba(166, 108, 255, 0.12);
}

.panels {
  text-align: left;
}

.panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.026);
}

.row {
  display: grid;
  gap: 0.85rem;
}

.row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row-3 {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 0.25rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
}

label span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    var(--input-bg);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.72;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--imagix-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 4px rgba(166, 108, 255, 0.1);
}

input[type="range"] {
  min-height: 38px;
  padding-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--imagix);
}

.range-wrap {
  display: grid;
  gap: 0.35rem;
}

label.check {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    var(--input-bg);
  user-select: none;
}

label.check input {
  width: auto;
  min-height: auto;
  accent-color: var(--imagix);
}

label.check span {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Fix resize panel layout */
.panel[data-panel="resize"] .row-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.panel[data-panel="resize"] label[for="resizeW"] {
  grid-column: 1;
  grid-row: 1;
}

.panel[data-panel="resize"] #resizeW {
  grid-column: 1;
  grid-row: 2;
}

.panel[data-panel="resize"] label[for="resizeH"] {
  grid-column: 2;
  grid-row: 1;
}

.panel[data-panel="resize"] #resizeH {
  grid-column: 2;
  grid-row: 2;
}

.panel[data-panel="resize"] label.check {
  grid-column: 1 / -1;
  grid-row: 3;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.actions-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.78em 1.55em;
  border-radius: 999px;
  border: 1px solid var(--product-button-border, var(--imagix-border));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    var(--product-button-bg, linear-gradient(135deg, rgba(166, 108, 255, 0.15), rgba(67, 215, 255, 0.075)));
  color: var(--btn-text);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease,
    opacity 0.24s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0 30%,
    rgba(255, 255, 255, 0.18) 45%,
    transparent 62%
  );
  transform: translateX(-110%);
  transition: transform 0.36s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px) scale(1.018);
  border-color: var(--product-button-border-hover, rgba(181, 132, 255, 0.66));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025)),
    var(--product-button-hover, linear-gradient(135deg, rgba(166, 108, 255, 0.82), rgba(67, 215, 255, 0.55)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    var(--product-button-shadow, 0 14px 30px rgba(166, 108, 255, 0.17));
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateX(110%);
}

.btn--secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.035);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.46;
  cursor: not-allowed;
  filter: grayscale(0.25);
  transform: none !important;
  box-shadow: none !important;
}

.btn[disabled]::before,
.btn[aria-disabled="true"]::before {
  display: none;
}

.btn[disabled]:hover,
.btn[aria-disabled="true"]:hover {
  border-color: var(--imagix-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.035);
}

body[data-theme="light"] .btn {
  color: #181923;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(50, 32, 65, 0.06);
}

/* =========================================================
   PREVIEW
   ========================================================= */
.preview-wrap {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.85rem;
}

.preview-frame {
  width: min(100%, 380px);
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
    var(--surface);
  box-shadow: var(--shadow-atmosphere);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.preview-frame:hover,
.preview-frame:focus-within {
  transform: translateY(-2px);
  border-color: var(--imagix-border);
  box-shadow:
    var(--shadow-atmosphere),
    0 0 22px rgba(166, 108, 255, 0.1);
}

.preview-img {
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 14px;
}

.download-under {
  min-width: 180px;
}

.mini {
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.hint {
  max-width: 46ch;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

.panel .hint {
  text-align: left;
}

/* =========================================================
   SUPPORT LINKS
   ========================================================= */
.tool-links,
.seo-note {
  max-width: 720px;
  margin-inline: auto;
  color: var(--text-muted);
  text-align: center;
}

.tool-links {
  margin-top: 1.3rem;
  font-size: 0.88rem;
  line-height: 1.8;
}

.tool-links a {
  color: var(--imagix-strong);
  font-weight: 600;
  transition: color 0.2s ease;
}

.tool-links a:hover,
.tool-links a:focus-visible {
  color: var(--text-main);
}

.seo-note {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.back-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

.back-btn {
  min-width: 190px;
}

/* =========================================================
   IMAGE MODAL
   ========================================================= */
.img-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.img-modal.open {
  display: block;
}

.img-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(8px);
}

.img-modal__panel {
  position: relative;
  max-width: min(92vw, 880px);
  margin: 7vh auto 0;
  padding: 18px;
  border: 1px solid var(--imagix-border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface-strong);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.48);
}

.img-modal__close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3100;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--imagix-border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.img-modal__close:hover,
.img-modal__close:focus-visible {
  transform: translateY(-1px) scale(1.04);
  border-color: var(--imagix);
  background: var(--surface-soft);
}

#imgModalImg {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =========================================================
   CURSOR AURA
   ========================================================= */
.cursor-aura {
  position: fixed;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--cursor-aura);
  filter: blur(10px) saturate(1.1);
  pointer-events: none;
  z-index: 1600;
  opacity: 0;
  transform: translate3d(-120px, -120px, 0);
  transition: opacity 0.22s ease, filter 0.22s ease;
  will-change: transform;
}

.cursor-aura::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 4px;
  height: 4px;
  image-rendering: pixelated;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    4px 0 0 rgba(255, 255, 255, 0.72),
    8px 0 0 rgba(255, 255, 255, 0.48),
    4px 4px 0 rgba(255, 255, 255, 0.82),
    4px 8px 0 rgba(255, 255, 255, 0.52);
}

body[data-theme="light"] .cursor-aura::before {
  background: rgba(166, 108, 255, 0.7);
  box-shadow:
    4px 0 0 rgba(166, 108, 255, 0.7),
    8px 0 0 rgba(67, 215, 255, 0.42),
    4px 4px 0 rgba(255, 255, 255, 0.82),
    4px 8px 0 rgba(166, 108, 255, 0.44);
}

.cursor-aura.is-visible {
  opacity: 0.62;
}

.cursor-aura.is-active {
  opacity: 0.88;
  filter: blur(7px) saturate(1.16);
}

.cursor-aura.is-pressed {
  opacity: 0.48;
}

/* =========================================================
   FOCUS
   ========================================================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.dropzone:focus-visible,
.preview-frame:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .hamburger {
    display: grid;
  }
}

@media (max-width: 900px) {
  .imagix-card__grid {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    width: min(100%, 520px);
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 12px 12px 0;
  }

  .header-shell,
  .product-hero,
  .imagix-section {
    width: calc(100vw - 24px);
  }

  .brand__sub {
    display: none;
  }

  .product-hero {
    padding-top: 78px;
    padding-bottom: 34px;
  }

  .product-hero::before {
    inset: 42px 8% auto;
    height: 185px;
    filter: blur(42px);
  }

  .product-eyebrow {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
  }

  .product-hero h1 {
    padding-bottom: 0.09em;
    font-size: clamp(2.45rem, 14vw, 3.4rem);
    line-height: 1.06;
  }

  .subtitle {
    max-width: 34ch;
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .imagix-section {
    padding-top: 4px;
    padding-bottom: 64px;
  }

  .imagix-card {
    padding: 1.45rem 1.2rem 1.35rem;
    border-radius: 22px;
  }

  .imagix-card__intro {
    margin-bottom: 1.2rem;
  }

  .imagix-card h2 {
    font-size: 1.65rem;
  }

  .imagix-card p {
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .dropzone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: 150px;
    padding: 1.15rem;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-2,
  .row-3,
  .actions-2 {
    grid-template-columns: 1fr;
  }

  input,
  select {
    min-height: 48px;
    border-radius: 15px;
  }

  label.check {
    min-height: 48px;
  }

  .preview-frame {
    width: min(100%, 320px);
    min-height: 250px;
    padding: 12px;
    border-radius: 20px;
  }

  .preview-img {
    max-height: 50vh;
  }

  .btn {
    width: 100%;
    min-height: 42px;
    padding: 0.72rem 1.15rem;
    font-size: 0.88rem;
  }

  .tool-links {
    margin-top: 1.05rem;
    font-size: 0.82rem;
  }

  .seo-note {
    font-size: 0.84rem;
    line-height: 1.62;
  }

  .img-modal__panel {
    margin-top: 9vh;
    padding: 12px;
    border-radius: 20px;
  }

  .img-modal__close {
    top: 14px;
    right: 14px;
  }

  .site-footer {
    margin-bottom: 2rem;
    padding: 0 12px;
  }

.panel[data-panel="resize"] .row-3 {
  grid-template-columns: 1fr;
}

.panel[data-panel="resize"] label[for="resizeW"],
.panel[data-panel="resize"] #resizeW,
.panel[data-panel="resize"] label[for="resizeH"],
.panel[data-panel="resize"] #resizeH,
.panel[data-panel="resize"] label.check {
  grid-column: 1;
  grid-row: auto;
}

}

@media (max-width: 360px) {
  .imagix-card {
    padding-inline: 1rem;
  }

  .preview-frame {
    width: min(100%, 270px);
    min-height: 224px;
  }

  .submenu li {
    margin-right: 12px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .cursor-aura {
    display: none !important;
  }

  .imagix-card:hover,
  .preview-frame:hover,
  .dropzone:hover,
  .desktop-nav > a:hover,
  .desktop-products-toggle:hover,
  .icon-button:hover,
  .submenu-toggle:hover,
  .tool-btn:hover,
  .btn:hover {
    transform: none !important;
  }
}