:root,
[data-theme="dark"] {
  --bg: #0f1412;
  --surface: #1a221f;
  --surface-2: #222c28;
  --border: #2e3a35;
  --ink: #f2f5f3;
  --muted: #9aaba3;
  --accent: #1fc992;
  --accent-ink: #062419;
  --danger: #ff6b5e;
  --header: #121a17;
  --footer: #0c100e;
  --radius: 14px;
  --font-display: "Urbanist", system-ui, sans-serif;
  --font-body: "Urbanist", system-ui, sans-serif;
  --theme-meta: #0f1412;
}

[data-theme="light"] {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --border: #d5e0da;
  --ink: #14201b;
  --muted: #5d6f67;
  --accent: #0f9f73;
  --accent-ink: #ffffff;
  --danger: #d6453a;
  --header: #ffffff;
  --footer: #e8efeb;
  --theme-meta: #f4f7f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle,
.menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-toggle:hover,
.menu-toggle:hover {
  border-color: var(--accent);
}

.theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

[data-theme="light"] .theme-icon-light {
  display: inline;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
}

.logo-text {
  line-height: 1;
}

.nav {
  display: flex;
  gap: 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--accent);
}

.nav a:hover {
  color: var(--accent);
}

/* Intro (replaces old hero) */
.intro {
  background: var(--bg);
  padding: 3.25rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.brand-kicker {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--accent);
}

.intro h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42ch;
}

.intro-points {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.intro-points li {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.field {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.field input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 1.1rem;
  min-width: 0;
}

.field input::placeholder {
  color: var(--muted);
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
}

.primary {
  position: relative;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  min-width: 118px;
}

.primary:hover {
  filter: brightness(1.06);
}

.primary:disabled {
  cursor: wait;
}

.primary.is-loading .btn-label {
  opacity: 0;
}

.primary.is-loading .btn-spinner {
  opacity: 1;
}

.btn-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(6, 36, 25, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

.ghost {
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.ghost:hover {
  color: var(--ink);
}

/* How-to download demo */
.intro-visual {
  display: flex;
  justify-content: center;
}

.howto-card {
  width: min(100%, 340px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 1.15rem 1.2rem 1.25rem;
  animation: floaty 5.5s ease-in-out infinite;
}

.howto-label {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.howto-stage {
  position: relative;
  min-height: 132px;
}

.howto-slide {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 0.35rem;
  align-content: start;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.howto-slide.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.howto-slide strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.howto-slide span {
  color: var(--muted);
  font-size: 0.92rem;
}

.howto-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
  position: relative;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 4px;
}
.copy-icon::before {
  width: 14px;
  height: 16px;
  left: 10px;
  top: 12px;
}
.copy-icon::after {
  width: 14px;
  height: 16px;
  left: 16px;
  top: 8px;
  background: var(--surface-2);
}

.paste-icon::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 14px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 7px 0 var(--accent), 0 14px 0 rgba(31, 201, 146, 0.45);
  border-radius: 2px;
}

.save-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 11px;
  width: 3px;
  height: 14px;
  background: var(--accent);
  transform: translateX(-50%);
}
.save-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

.howto-dots {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.howto-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.howto-dots span.is-on {
  background: var(--accent);
  width: 18px;
  border-radius: 999px;
}

.howto-mini-player {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

.mini-screen {
  position: relative;
  height: 110px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--ink) 30%);
}

.mini-screen::before {
  content: "";
  position: absolute;
  inset: 18% 16%;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 55%, var(--ink) 45%);
  border: 1px solid var(--border);
  animation: pulse 2.4s ease-in-out infinite;
}

[data-theme="light"] .mini-screen {
  background: #d7e4de;
}

[data-theme="light"] .mini-screen::before {
  background: #c4d5cd;
}

.mini-btn {
  position: absolute;
  right: 1rem;
  bottom: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
}

.mini-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 201, 146, 0.35);
  z-index: 3;
  animation: clickPath 3.6s ease-in-out infinite;
}

@keyframes clickPath {
  0%, 15% { top: 28%; left: 30%; transform: scale(1); }
  45% { top: 68%; left: 72%; transform: scale(1); }
  52% { top: 72%; left: 78%; transform: scale(0.75); }
  60% { top: 72%; left: 78%; transform: scale(1); }
  100% { top: 28%; left: 30%; transform: scale(1); }
}

/* Custom mouse */
body.has-cursor {
  cursor: none;
}

body.has-cursor a,
body.has-cursor button,
body.has-cursor input,
body.has-cursor summary {
  cursor: none;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor-dot.is-on,
.cursor-ring.is-on {
  opacity: 1;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  mix-blend-mode: difference;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--accent);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.cursor-ring.is-hover {
  width: 52px;
  height: 52px;
  background: rgba(31, 201, 146, 0.12);
}

.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(31, 201, 146, 0.45);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
}

/* Smooth loader */
.loader {
  padding: 1.5rem 0 0.5rem;
}

.loader-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.15rem 1.25rem;
  animation: fadeUp 0.35s ease both;
}

.loader-top {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.loader-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.loader-title {
  margin: 0;
  font-weight: 700;
}

.progress {
  margin-top: 0.95rem;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 8%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.loader-steps {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.loader-steps li {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.loader-steps li.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.loader-steps li.done {
  color: var(--ink);
  border-color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Results */
.results {
  padding: 2rem 0 1rem;
}

.results-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem;
  animation: fadeUp 0.4s ease both;
}

.preview {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.preview img {
  width: 132px;
  height: 168px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.platform {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.formats {
  display: grid;
  gap: 0.6rem;
}

.format-btn {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
}

.format-btn:hover {
  border-color: var(--accent);
}

.format-btn .label {
  font-weight: 600;
}

.format-btn .size {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.format-btn .action {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
}

.format-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.status {
  margin: 0.9rem 0 0;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
}

/* Sections */
.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.03em;
}

.section-lede {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 0.3rem;
}

.steps li::before {
  content: "0" counter(step);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
}

.steps span {
  color: var(--muted);
  font-size: 0.95rem;
}

.platform-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.platform-list li {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
}

.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--footer);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  margin-top: 1rem;
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
}

.footer-brand p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  max-width: 36ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}

.copyright {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  z-index: 60;
  max-width: calc(100vw - 2rem);
  text-align: center;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-visual {
    order: -1;
  }

  .howto-card {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    background: var(--header);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    z-index: 60;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
  }

  .nav a:active,
  .nav a:hover {
    background: var(--surface-2);
    color: var(--accent);
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 2rem 0 1.75rem;
  }

  .brand-kicker {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1080px, calc(100% - 1.25rem));
  }

  .field {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .primary,
  .ghost {
    width: 100%;
    min-height: 48px;
  }

  .field input {
    padding: 0.95rem 1rem;
    font-size: 16px; /* prevents iOS zoom */
  }

  .preview {
    grid-template-columns: 1fr;
  }

  .preview img {
    width: 100%;
    height: 220px;
  }

  .format-btn {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label action"
      "size action";
    min-height: 56px;
    padding: 0.95rem 1rem;
  }

  .format-btn .label {
    grid-area: label;
  }

  .format-btn .size {
    grid-area: size;
  }

  .format-btn .action {
    grid-area: action;
  }

  .loader-steps {
    gap: 0.4rem;
  }

  .loader-steps li {
    font-size: 0.75rem;
  }

  .cursor-dot,
  .cursor-ring,
  .cursor-trail {
    display: none !important;
  }
}

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-ring,
  .cursor-trail {
    display: none !important;
  }

  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button,
  body.has-cursor input,
  body.has-cursor summary {
    cursor: auto;
  }
}
