:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #d8dde7;
  --paper: #f7f8fb;
  --panel: #ffffff;
  --accent: #00ff66;
  --accent-dark: #008f3a;
  --warn: #b45309;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
  background: #eef3f7;
}

.nav-static {
  display: flex;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: clamp(24px, 5vw, 70px);
  align-items: end;
  min-height: 360px;
  padding: clamp(42px, 8vw, 86px) clamp(16px, 4vw, 56px) 38px;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.95), rgba(0, 143, 58, 0.84)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.22) 0 1px, transparent 1px 18px);
  color: #fff;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(17px, 2vw, 22px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #00ff66;
}

.privacy-panel {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.privacy-panel span:last-child {
  color: rgba(255, 255, 255, 0.78);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
}

.layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 56px) 48px;
}

.tool-list {
  display: grid;
  align-self: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-tab {
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tool-tab:hover,
.tool-tab.active {
  color: var(--ink);
  background: #e8ffef;
}

.workspace {
  min-width: 0;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.workspace h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 38px);
  letter-spacing: 0;
}

.client-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #d9ffe8;
  font-size: 13px;
  font-weight: 800;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 116px;
  place-items: center;
  margin-bottom: 18px;
  border: 2px dashed #9fb0c6;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #e8ffef;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong,
.dropzone span {
  display: block;
}

.dropzone span {
  color: var(--muted);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 360px);
  gap: 18px;
}

.preview-wrap {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
}

.controls {
  display: grid;
  align-content: start;
  gap: 12px;
}

.file-meta,
.status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(110px, 1.3fr) auto;
  align-items: center;
  gap: 10px;
}

.control-row input[type="number"],
.crop-grid input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.control-row input[type="color"] {
  width: 58px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.crop-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset-row button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.primary,
.download {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary:disabled,
.download.disabled {
  color: #8a94a6;
  background: #e5e7eb;
  cursor: not-allowed;
  pointer-events: none;
}

.download {
  background: var(--ink);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.legal-page {
  padding: clamp(32px, 7vw, 72px) clamp(16px, 4vw, 56px);
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.legal-content h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.legal-content h2 {
  margin: 26px 0 8px;
  font-size: 22px;
}

.legal-content p {
  color: var(--muted);
}

.option {
  display: none;
}

.show-quality .quality-option,
.show-bg .bg-option,
.show-resize .resize-options,
.show-crop .crop-options {
  display: grid;
}

.seo-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 56px) 64px;
}

.seo-content > div:first-child,
.faq {
  max-width: 820px;
}

.seo-content h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.seo-content p {
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 34px;
}

.info-grid article,
.faq details {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.info-grid h3 {
  margin: 0 0 8px;
}

.faq details + details {
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.ad-reserve {
  min-height: 0;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .nav.open,
  .nav-static {
    display: grid;
  }

  .nav-static {
    position: static;
    box-shadow: none;
  }

  .hero,
  .layout,
  .editor-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 430px;
  }

  .tool-list {
    grid-template-columns: 1fr;
  }

  .workspace-head,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .crop-grid {
    grid-template-columns: 1fr;
  }
}
