:root {
  --ink: #172033;
  --muted: #5f6b7a;
  --line: #dfe5ee;
  --soft: #f5f7fb;
  --brand: #5b38d1;
  --brand-dark: #3f239c;
  --accent: #1b9aaa;
  --white: #fff;
  --danger: #c43d4b;
  --shadow: 0 18px 50px rgba(30, 41, 59, .11);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: var(--brand); }
button, input, select { font: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  min-height: 70px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav > a, .dropdown > summary {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  border-radius: 9px;
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.main-nav > a:hover, .dropdown > summary:hover { background: var(--soft); color: var(--brand); }
.dropdown { position: relative; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(980px, 94vw);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dropdown:not([open]) .dropdown-menu { display: none; }
.dropdown-menu a {
  padding: 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.dropdown-menu a:hover { background: var(--soft); color: var(--brand); }
.dropdown-menu strong, .dropdown-menu span { display: block; }
.dropdown-menu span { color: var(--muted); font-size: .86rem; font-weight: 450; }
.menu-group { padding: 4px; }
.menu-group h3 { margin: 4px 12px 8px; color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.menu-group a { display: block; }
.page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 72px 0 36px; text-align: center; }
.eyebrow {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  background: #ece8ff;
  color: var(--brand-dark);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1 { margin: 18px auto 12px; max-width: 900px; font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.06; letter-spacing: -.045em; }
h2 { margin-top: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.02em; }
h3 { line-height: 1.3; }
.lead { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; }
.tool-shell, .content-card {
  margin: 28px 0;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.upload-zone {
  min-height: 250px;
  padding: 28px;
  border: 2px dashed #b7c0cf;
  border-radius: 18px;
  background: #fbfcfe;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: .2s ease;
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--brand); background: #f4f1ff; }
.upload-zone input { display: none; }
.upload-icon { font-size: 2.4rem; line-height: 1; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  padding: 12px 18px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: white; color: var(--brand); border: 1px solid #b9adee; }
.button.danger { background: var(--danger); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.grid-2, .grid-3, .tool-grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: white;
  text-decoration: none;
}
.tool-card:hover { border-color: #a796ea; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(30,41,59,.09); }
.tool-card p, .muted { color: var(--muted); }
.trust-note { padding: 14px 16px; border-left: 4px solid var(--accent); border-radius: 8px; background: #edfafa; }
.section { padding: 34px 0; }
.section-heading { max-width: 720px; margin-bottom: 24px; }
.prose { max-width: 850px; }
.prose p, .prose li { color: #344054; }
.steps { counter-reset: steps; list-style: none; padding: 0; }
.steps li { position: relative; padding: 0 0 22px 48px; }
.steps li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 800;
}
.faq details { padding: 15px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 750; }
.site-footer { margin-top: 60px; padding: 40px 0; color: #d9dcec; background: #161b29; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer a { color: #e3ddff; text-decoration: none; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin: 7px 0; }
.controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.field label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 750; }
.field input, .field select { width: 100%; padding: 11px; border: 1px solid #cfd6e1; border-radius: 9px; background: white; }
.choice-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.preset-panel { margin-bottom: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.preset-panel h2 { margin-bottom: 4px; font-size: 1.3rem; }
.preset-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.preset-button { padding: 10px; border: 1px solid #cfc5f3; border-radius: 9px; color: var(--brand-dark); background: white; font-weight: 750; cursor: pointer; }
.preset-button:hover, .preset-button.active { color: white; border-color: var(--brand); background: var(--brand); }
.file-list { display: grid; gap: 12px; margin-top: 22px; }
.file-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.file-row img { width: 64px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.file-meta { min-width: 0; }
.file-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: var(--muted); font-size: .88rem; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.status { margin-top: 14px; font-weight: 700; color: var(--brand-dark); }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.tool-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.pdf-file {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.file-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--danger); font-size: .72rem; font-weight: 850; }
.small-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); cursor: pointer; }
.small-button:hover { border-color: var(--brand); color: var(--brand); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.result-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.result-card canvas, .result-card img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.picker-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 20px; }
.picker-stage { min-height: 360px; display: grid; place-items: center; border-radius: 15px; background: #eef1f6; overflow: hidden; }
.picker-stage img { display: none; max-width: 100%; max-height: 620px; cursor: crosshair; }
.picked-swatch { height: 120px; border-radius: 15px; border: 1px solid var(--line); background: #6a11cb; }
.value-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 840px) {
  .nav-wrap { align-items: flex-start; padding: 14px 0; flex-direction: column; }
  .main-nav { width: 100%; flex-wrap: wrap; }
  .dropdown-menu { left: 0; right: auto; grid-template-columns: 1fr; }
  .grid-2, .grid-3, .tool-grid, .picker-layout, .footer-grid, .tool-options, .result-grid { grid-template-columns: 1fr; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .controls { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 52px 1fr; }
  .result-actions { grid-column: 1 / -1; justify-content: start; }
  .pdf-file { grid-template-columns: 38px 1fr; }
  .pdf-file > :last-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
  .preset-grid { grid-template-columns: 1fr; }
}
