@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --indigo:    #2B2D42;
  --indigo-90: #23253A;
  --grey:      #8D99AE;
  --grey-20:   rgba(141,153,174,0.15);
  --grey-10:   rgba(141,153,174,0.08);
  --plat:      #EDF2F4;
  --plat-80:   rgba(237,242,244,0.85);
  --red:       #EF233C;
  --red-dark:  #C81631;
  --red-glow:  rgba(239,35,60,0.18);
  --white:     #FFFFFF;

  --display:  'Space Grotesk', sans-serif;
  --body:     'DM Sans', sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--body);
  background: var(--plat);
  color: var(--indigo);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--body); border: none; background: none; }

/* ── Nav ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 64px);
  height: 58px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--plat);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo span {
  color: var(--red);
}

.nav-hub {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--grey);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid rgba(141,153,174,0.3);
  border-radius: 40px;
  transition: border-color 0.2s, color 0.2s;
}

.nav-hub:hover {
  color: var(--plat);
  border-color: rgba(141,153,174,0.6);
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  background: var(--indigo);
  padding: clamp(56px, 10vw, 100px) clamp(20px, 5vw, 64px) clamp(48px, 8vw, 80px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 110%, rgba(239,35,60,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--red);
  opacity: 0.6;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--plat);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--grey);
  max-width: 520px;
  margin: 0 auto 40px;
  font-weight: 400;
}

.badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  padding: 5px 12px;
  border: 1px solid rgba(141,153,174,0.25);
  border-radius: 40px;
}

/* ── Tool Section ───────────────────────────────────── */
.tool-section {
  max-width: 760px;
  margin: -28px auto 0;
  padding: 0 clamp(16px, 4vw, 40px) 64px;
  position: relative;
  z-index: 10;
}

.tool-card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: 0 4px 32px rgba(43,45,66,0.10), 0 1px 4px rgba(43,45,66,0.06);
  overflow: hidden;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(141,153,174,0.35);
  border-radius: var(--r-lg);
  margin: 28px 28px 0;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  background: var(--grey-10);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--red);
  background: rgba(239,35,60,0.04);
}

.drop-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: var(--grey-20);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  transition: background 0.2s, color 0.2s;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
  background: var(--red-glow);
  color: var(--red);
}

.drop-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.drop-label {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 6px;
}

.drop-sub {
  font-size: 0.8rem;
  color: var(--grey);
}

.drop-sub strong {
  color: var(--red);
  font-weight: 500;
}

#file-input { display: none; }

/* Preview Row */
.preview-row {
  display: none;
  align-items: center;
  gap: 16px;
  margin: 20px 28px 0;
  padding: 16px;
  background: var(--grey-10);
  border-radius: var(--r-md);
  border: 1px solid var(--grey-20);
}

.preview-row.visible { display: flex; }

.preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  object-fit: contain;
  background: var(--plat);
  border: 1px solid var(--grey-20);
  flex-shrink: 0;
}

.preview-info { flex: 1; min-width: 0; }
.preview-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--indigo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-size {
  font-size: 0.75rem;
  color: var(--grey);
  margin-top: 2px;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-remove:hover { background: var(--red-glow); color: var(--red); }
.btn-remove svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Size Options */
.sizes-block {
  padding: 20px 28px;
}

.sizes-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 12px;
}

.sizes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1.5px solid var(--grey-20);
  border-radius: 40px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.size-chip input[type="checkbox"] { display: none; }

.size-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--grey);
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.size-chip span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--grey);
  font-family: var(--display);
  transition: color 0.2s;
}

.size-chip.active {
  border-color: var(--red);
  background: var(--red-glow);
}

.size-chip.active .chip-dot {
  background: var(--red);
  border-color: var(--red);
}

.size-chip.active span { color: var(--indigo); }

/* Convert Button */
.convert-wrap {
  padding: 4px 28px 28px;
}

.btn-convert {
  width: 100%;
  padding: 15px;
  background: var(--red);
  color: var(--white);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-md);
  letter-spacing: 0.01em;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-convert:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.btn-convert:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-convert svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Progress */
.progress-block {
  display: none;
  padding: 0 28px 20px;
}
.progress-block.visible { display: block; }

.progress-bar-bg {
  height: 4px;
  background: var(--grey-20);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.78rem;
  color: var(--grey);
  text-align: center;
}

/* Result */
.result-block {
  display: none;
  padding: 0 28px 28px;
  text-align: center;
}
.result-block.visible { display: block; }

.result-preview-wrap {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.result-ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.result-ico canvas {
  border: 1.5px solid var(--grey-20);
  border-radius: var(--r-sm);
  image-rendering: pixelated;
  animation: popIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-ico-label {
  font-size: 0.7rem;
  color: var(--grey);
  font-weight: 500;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--indigo);
  color: var(--plat);
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--r-md);
  transition: background 0.2s, transform 0.15s;
}
.btn-download:hover {
  background: var(--indigo-90);
  transform: translateY(-1px);
}
.btn-download svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 18px;
  font-size: 0.82rem;
  color: var(--grey);
  border: 1px solid var(--grey-20);
  border-radius: 40px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-reset:hover { color: var(--red); border-color: rgba(239,35,60,0.4); }
.btn-reset svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── Content Sections ───────────────────────────────── */
.content-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.section {
  padding: clamp(56px, 8vw, 88px) 0;
}

.section + .section {
  border-top: 1px solid var(--grey-20);
}

.section-eye {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--indigo);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.section-lead {
  font-size: 1rem;
  color: var(--grey);
  max-width: 600px;
  margin-bottom: 36px;
}

/* How it Works */
.steps {
  display: grid;
  gap: 24px;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-num {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-glow);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.step-body h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.88rem;
  color: var(--grey);
  line-height: 1.6;
}

/* Format Cards */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.format-card {
  background: var(--white);
  border: 1px solid var(--grey-20);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.format-card:hover {
  border-color: rgba(239,35,60,0.3);
  box-shadow: 0 4px 20px rgba(239,35,60,0.06);
}

.format-ext {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.format-card p {
  font-size: 0.82rem;
  color: var(--grey);
  line-height: 1.55;
}

/* Use Cases */
.use-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.use-card {
  background: var(--white);
  border: 1px solid var(--grey-20);
  border-radius: var(--r-lg);
  padding: 24px;
}

.use-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.use-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--red-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}
.use-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.use-card h3 {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--indigo);
}

.use-card p {
  font-size: 0.84rem;
  color: var(--grey);
  line-height: 1.6;
}

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

.faq-item {
  background: var(--white);
  border: 1px solid var(--grey-20);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 22px;
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--indigo);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

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

.faq-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--grey);
  transition: transform 0.25s;
}
.faq-arrow svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }

details[open] .faq-arrow { transform: rotate(180deg); }
details[open] .faq-arrow svg { color: var(--red); }

.faq-body {
  padding: 0 22px 18px;
  font-size: 0.87rem;
  color: var(--grey);
  line-height: 1.7;
  border-top: 1px solid var(--grey-20);
}

/* ── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--indigo);
  padding: clamp(48px, 7vw, 72px) clamp(20px, 5vw, 64px) 32px;
  margin-top: clamp(48px, 6vw, 80px);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(141,153,174,0.15);
}

.footer-brand .footer-logo {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--plat);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-brand .footer-logo span { color: var(--red); }

.footer-desc {
  font-size: 0.82rem;
  color: var(--grey);
  line-height: 1.65;
  max-width: 220px;
}

.footer-col h4 {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: grid; gap: 9px; }

.footer-col ul a {
  font-size: 0.84rem;
  color: rgba(237,242,244,0.65);
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--plat); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(141,153,174,0.6);
}

.footer-rh {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.footer-rh:hover { color: var(--plat); }

/* ── About/Terms/Privacy pages ──────────────────────── */
.page-hero {
  background: var(--indigo);
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 64px) clamp(40px, 6vw, 64px);
  text-align: center;
}
.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--plat);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.page-hero p {
  color: var(--grey);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 40px) 80px;
}

.page-content h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--indigo);
  margin: 36px 0 10px;
}

.page-content p, .page-content li {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.8;
}
.page-content ul { padding-left: 20px; margin-top: 8px; display: grid; gap: 6px; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 700px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .sizes-grid { gap: 6px; }
  .size-chip { padding: 6px 11px; }
  .drop-zone { padding: 32px 16px; }
  .tool-card { border-radius: var(--r-lg); }
  .drop-zone { margin: 20px 20px 0; }
  .sizes-block { padding: 16px 20px; }
  .convert-wrap { padding: 4px 20px 20px; }
  .result-block, .progress-block { padding: 0 20px 20px; }
  .preview-row { margin: 16px 20px 0; }
}
