/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0b0b;
  --surface:   #141414;
  --surface2:  #1c1c1c;
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);
  --text:      #f0ece4;
  --muted:     #7a7672;
  --faint:     #3a3734;
  --accent:    #e63232;
  --accent-dk: #b52424;
  --radius:    10px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}


/* ── Nav ──────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.accent { color: var(--accent); }

.nav-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--faint);
  padding: 4px 10px;
  border-radius: 99px;
}


/* ── Hero ─────────────────────────────────────────────── */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 6rem 2rem 5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(230,50,50,0.3);
  background: rgba(230,50,50,0.07);
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 2rem;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.hero-hint {
  font-size: 0.8rem;
  color: var(--faint);
}


/* ── Hero Diagram ─────────────────────────────────────── */
.hero-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.diagram-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.diagram-box span {
  position: absolute;
  bottom: 6px;
  right: 9px;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
}

.diagram-box.square  { width: 110px; height: 110px; }
.diagram-box.landscape { width: 174px; height: 98px; }

.diagram-inner {
  border-radius: 4px;
  background: linear-gradient(135deg, #3a3734 0%, #222 100%);
  position: relative;
  z-index: 1;
}
.square-inner   { width: 72px; height: 72px; }
.landscape-inner { width: 64px; height: 64px; }

.diagram-blur-bg {
  position: absolute;
  inset: -20px;
  background: linear-gradient(135deg, #3a2020 0%, #1a1a2e 100%);
  filter: blur(8px);
  z-index: 0;
}

.diagram-arrow {
  font-size: 1.25rem;
  color: var(--faint);
}


/* ── Tool Section ─────────────────────────────────────── */
.tool {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.tool-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.tool-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 4px;
}
.tool-header p {
  font-size: 0.875rem;
  color: var(--muted);
}


/* ── Dropzone ─────────────────────────────────────────── */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.25rem;
}
.dropzone:hover,
.dropzone.drag {
  border-color: rgba(230,50,50,0.5);
  background: rgba(230,50,50,0.04);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dz-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.dz-icon svg { width: 20px; height: 20px; }

.dz-title { font-size: 0.95rem; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.dz-sub   { font-size: 0.8rem; color: var(--muted); }


/* ── Controls ─────────────────────────────────────────── */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.25rem;
}

@media (max-width: 560px) {
  .controls { grid-template-columns: 1fr; }
}

.ctrl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.ctrl label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ctrl-name {
  font-size: 0.8rem;
  color: var(--muted);
}

.ctrl-value {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--faint);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border2);
  transition: background 0.1s, transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { background: var(--accent); transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border2);
  cursor: pointer;
}


/* ── Canvas Preview ───────────────────────────────────── */
.canvas-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 1.25rem;
  position: relative;
  min-height: 120px;
}

.canvas-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.canvas-dim {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--faint);
}

#canvas {
  width: 100%;
  display: none;
}

#canvas.visible { display: block; }

.canvas-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  font-size: 0.85rem;
  color: var(--faint);
}


/* ── Download Row ─────────────────────────────────────── */
.download-row {
  display: flex;
  gap: 10px;
}

.btn-download {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-download svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-download:hover:not(:disabled) { background: var(--accent-dk); transform: translateY(-1px); }
.btn-download:active:not(:disabled) { transform: translateY(0); }
.btn-download:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-reset {
  padding: 12px 20px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-reset:hover { color: var(--text); border-color: var(--border2); }


/* ── How it works ─────────────────────────────────────── */
.how {
  border-top: 1px solid var(--border);
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.how-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  margin-bottom: 2.5rem;
}

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }

.step-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 3px;
  flex-shrink: 0;
  width: 28px;
}

.steps strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.steps p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}


/* ── Footer ───────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--faint);
}

.footer-sep { margin: 0 0.5rem; }


/* ── Animations ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-badge  { animation: fadeUp 0.5s ease both; animation-delay: 0.05s; }
.hero-title  { animation: fadeUp 0.5s ease both; animation-delay: 0.12s; }
.hero-sub    { animation: fadeUp 0.5s ease both; animation-delay: 0.2s; }
.hero-cta    { animation: fadeUp 0.5s ease both; animation-delay: 0.28s; }
.hero-diagram { animation: fadeUp 0.5s ease both; animation-delay: 0.36s; }
