:root {
  color-scheme: light;
  --ink: #111018;
  --muted: #696679;
  --soft: #f7f5ff;
  --paper: #fffdf8;
  --surface: #ffffff;
  --line: #ebe7f5;
  --purple: #6d4aff;
  --purple-dark: #4a2fcb;
  --mint: #22d3a6;
  --pink: #ff6b9e;
  --amber: #ffd166;
  --shadow: 0 24px 70px rgba(42, 31, 84, 0.14);
  --small-shadow: 0 14px 34px rgba(42, 31, 84, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 209, 102, 0.28), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(109, 74, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #fffdf8 0%, #ffffff 48%, #f8f7ff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 248, 0.82);
  border-bottom: 1px solid rgba(235, 231, 245, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-block;
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--purple), var(--pink)),
    linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.75) 46% 54%, transparent 54%);
  box-shadow: 0 10px 22px rgba(109, 74, 255, 0.28);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a {
  padding: 9px 12px;
  border-radius: 999px;
  text-decoration: none;
}

.site-nav a:hover {
  background: #f0ecff;
  color: var(--purple-dark);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #f0ecff;
}

.language-switch a {
  min-width: 36px;
  padding: 7px 9px;
  text-align: center;
}

.language-switch a[aria-current="page"] {
  background: #fff;
  color: var(--purple-dark);
  box-shadow: 0 6px 14px rgba(42, 31, 84, 0.08);
}

.tool-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 54px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 34px;
  align-items: center;
  margin-bottom: 34px;
}

.tool-heading {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 18px;
  padding: 0 14px;
  border-radius: 999px;
  background: #efeaff;
  color: var(--purple-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
}

.tool-heading p {
  max-width: 640px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(17, 16, 24, 0.18);
}

.visual-showcase {
  position: relative;
  min-height: 410px;
}

.floating-card {
  position: absolute;
  display: grid;
  gap: 12px;
  width: min(310px, 62%);
  padding: 14px;
  border: 1px solid rgba(235, 231, 245, 0.9);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.floating-card span {
  padding-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.card-before {
  top: 18px;
  left: 0;
  transform: rotate(-4deg);
}

.card-after {
  right: 0;
  bottom: 24px;
  transform: rotate(3deg);
}

.checker-board {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 22px;
  background-color: #f8f8ff;
  background-image:
    linear-gradient(45deg, #e7e3f3 25%, transparent 25%),
    linear-gradient(-45deg, #e7e3f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7e3f3 75%),
    linear-gradient(-45deg, transparent 75%, #e7e3f3 75%);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
}

.checker-board.tight {
  padding: 4px;
}

.sample-shape {
  width: 96%;
  aspect-ratio: 1.05;
  border-radius: 46% 54% 45% 55%;
  background:
    radial-gradient(circle at 30% 28%, #fff 0 9%, transparent 10%),
    linear-gradient(135deg, var(--mint), var(--purple));
  box-shadow: inset 0 -20px 38px rgba(17, 16, 24, 0.18);
}

.sample-shape.large-gap {
  width: 44%;
}

.batch-pill {
  position: absolute;
  right: 4%;
  top: 48%;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #3d2700;
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--small-shadow);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.upload-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 16px;
}

.result-panel {
  min-height: 600px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 34px 28px;
  overflow: hidden;
  text-align: center;
  border: 2px dashed #d8d0f6;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(109, 74, 255, 0.08), rgba(34, 211, 166, 0.08)),
    #fcfbff;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  pointer-events: none;
}

.drop-zone.dragging {
  border-color: var(--purple);
  background: #f2efff;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone h2 {
  position: relative;
  margin: 14px 0 8px;
  font-size: 25px;
  line-height: 1.18;
}

.drop-zone p {
  position: relative;
  max-width: 330px;
  color: var(--muted);
  line-height: 1.55;
}

.drop-art {
  position: relative;
  width: min(250px, 100%);
  aspect-ratio: 22 / 15;
  display: grid;
  place-items: center;
}

#sampleCanvas {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(109, 74, 255, 0.18));
}

.settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.settings label,
.advanced-grid label {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.advanced-settings {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.advanced-settings summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary::after {
  content: "+";
  margin-left: auto;
  color: var(--purple);
  font-size: 20px;
  line-height: 1;
}

.advanced-settings[open] summary::after {
  content: "-";
}

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

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

input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  border-radius: 12px;
  background: #f7f5ff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 14px 26px rgba(109, 74, 255, 0.22);
}

.primary-button:hover:not(:disabled) {
  background: var(--purple-dark);
}

.secondary-button {
  background: var(--ink);
  color: #fff;
}

.ghost-button {
  background: #f0edf8;
  color: var(--ink);
}

.progress-wrap {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ebe7f5;
}

progress::-webkit-progress-bar {
  background: #ebe7f5;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title-row h2 {
  margin: 0;
  font-size: 24px;
}

#fileCount {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f0edf8;
  color: var(--purple-dark);
  font-weight: 900;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding-top: 16px;
  flex: 1;
}

.results.empty {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  place-content: center;
  min-height: 0;
  height: 100%;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(109, 74, 255, 0.05), rgba(255, 107, 158, 0.05)),
    #fff;
  color: var(--muted);
  font-weight: 800;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, 100%);
  padding: 26px;
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(109, 74, 255, 0.16), rgba(255, 107, 158, 0.16)),
    #fff;
  position: relative;
  box-shadow: 0 14px 30px rgba(42, 31, 84, 0.1);
}

.empty-icon::before,
.empty-icon::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 12px;
  border: 2px dashed #b6a9ef;
}

.empty-icon::after {
  inset: 26px 20px 20px 26px;
  border: 0;
  background: linear-gradient(135deg, var(--mint), var(--purple));
}

.empty-state p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.empty-state small {
  max-width: 280px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.result-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(42, 31, 84, 0.06);
}

.preview-box {
  display: grid;
  place-items: center;
  height: 150px;
  overflow: hidden;
  border-radius: 16px;
  background-color: #faf9ff;
  background-image:
    linear-gradient(45deg, #e8e4f3 25%, transparent 25%),
    linear-gradient(-45deg, #e8e4f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e4f3 75%),
    linear-gradient(-45deg, transparent 75%, #e8e4f3 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.content-band {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.content-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.content-grid article {
  padding: 28px;
  border-radius: 28px;
  background: #faf9ff;
}

.content-grid h2 {
  font-size: 22px;
  line-height: 1.22;
}

.content-grid p {
  color: var(--muted);
  line-height: 1.72;
}

.guide-detail {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 56px;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
}

.guide-detail > div,
.guide-detail dl {
  margin: 0;
  padding: 30px;
  border-radius: 30px;
  background: #fff8df;
}

.guide-detail h2 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.12;
}

.guide-detail p {
  margin-bottom: 0;
  color: #766434;
  line-height: 1.7;
}

.guide-detail dl {
  display: grid;
  gap: 14px;
  background: #f7f5ff;
}

.guide-detail dl div {
  padding-bottom: 14px;
  border-bottom: 1px solid #e5def8;
}

.guide-detail dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.guide-detail dt {
  margin-bottom: 5px;
  color: var(--ink);
  font-weight: 900;
}

.guide-detail dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.faq-section {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 66px;
}

.faq-heading {
  max-width: 700px;
  margin-bottom: 22px;
}

.faq-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.faq-heading p:last-child {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(42, 31, 84, 0.06);
}

.faq-list summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  margin-left: auto;
  color: var(--purple);
  font-size: 24px;
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list details p {
  margin: 0;
  padding: 0 22px 22px;
  color: var(--muted);
  line-height: 1.75;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--purple-dark);
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 14px;
  padding: 0 12px;
  border-radius: 999px;
  background: #efeaff;
  color: var(--purple-dark);
  font-size: 13px;
  font-weight: 900;
}

.legal-page h1 {
  font-size: clamp(36px, 6vw, 62px);
}

.legal-page h2 {
  margin-top: 34px;
  font-size: 24px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.75;
}

.legal-page a {
  color: var(--purple-dark);
  font-weight: 800;
}

.contact-card {
  display: grid;
  gap: 8px;
  width: min(480px, 100%);
  margin: 26px 0 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--small-shadow);
}

.contact-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.contact-card a {
  font-size: 22px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .workspace,
  .content-grid,
  .guide-detail {
    grid-template-columns: 1fr;
  }

  .visual-showcase {
    min-height: 360px;
  }

  .result-panel {
    min-height: 380px;
  }

  .results.empty {
    min-height: 260px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tool-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 34px;
  }

  h1 {
    font-size: 44px;
  }

  .tool-heading p {
    font-size: 17px;
  }

  .visual-showcase {
    min-height: 320px;
  }

  .floating-card {
    width: 72%;
  }

  .advanced-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .upload-panel,
  .result-panel {
    border-radius: 26px;
  }
}
