:root {
  --bg: #07070c;
  --panel: rgba(10, 10, 20, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f7f7fb;
  --muted: #aab0c6;
  --accent: #76f5c4;
  --accent-strong: #2ad1ff;
  --danger: #ff6f7a;
  --font-display: "Space Grotesk", "Chivo Mono", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: radial-gradient(circle at top left, #161629, #050508 55%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 3rem 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.hero {
  width: 100%;
  margin: 0;
  padding: 3rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 3.5rem;
}

.hero__content h2 {
  font-size: clamp(2.8rem, 4vw, 3.8rem);
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.hero__eyebrow {
  font-family: "Chivo Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero__preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  padding: 2rem;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero__preview img {
  width: 200px;
  height: auto;
}

.hero__tag {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #041310;
  border: none;
}

.cta--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 0;
}

.features article {
  background: rgba(12, 12, 20, 0.7);
  border-radius: 1.2rem;
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
}

.features h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.studio header {
  margin-bottom: 2rem;
}

.studio h1,
.studio h2 {
  margin-top: 0.2rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.overline {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
}

.studio--spotlight {
  background: rgba(5, 5, 12, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.45);
}

.studio__intro {
  max-width: 720px;
}

.studio__intro h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  letter-spacing: -0.03em;
}

.studio__subtext {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 540px;
}

.studio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
  align-items: stretch;
  margin-top: 2rem;
}

.panel {
  background: rgba(9, 9, 18, 0.88);
  border-radius: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem;
  backdrop-filter: blur(22px);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.panel--input {
  grid-column: span 2;
}

.panel--output canvas,
.panel--input canvas {
  margin-top: 1.2rem;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel__head h4 {
  margin: 0;
}

.panel__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.panel__hint {
  margin: 0.2rem 0 0;
  color: rgba(247, 247, 251, 0.75);
  font-size: 0.9rem;
}

.upload {
  border: 1px dashed rgba(118, 245, 196, 0.55);
  border-radius: 1.15rem;
  padding: 1.8rem;
  margin: 1.2rem 0;
  text-align: center;
  background: linear-gradient(135deg, rgba(118, 245, 196, 0.08), rgba(42, 209, 255, 0.08));
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
}

.upload:hover {
  border-color: rgba(118, 245, 196, 0.9);
  background: linear-gradient(135deg, rgba(118, 245, 196, 0.12), rgba(42, 209, 255, 0.12));
}

.upload__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}

.upload__label small {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--muted);
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.code-field {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin: 1rem 0;
  padding: 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.progress {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.progress__bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}
.progress__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  transition: width 0.15s ease;
}
.progress span {
  font-size: 0.85rem;
  color: var(--muted);
}

.code-field input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-size: 1.2rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: "Chivo Mono", monospace;
  text-align: center;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button.small {
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 1rem;
  background: transparent;
  color: var(--text);
}

button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 1.2rem;
  border-radius: 0.6rem;
}

.actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.actions button {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: none;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

#distort-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #021c15;
  border: none;
}

#recover-btn {
  border: none;
}

#reset-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text);
}

.status {
  min-height: 2.5rem;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  background: rgba(2, 28, 21, 0.65);
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid rgba(118, 245, 196, 0.2);
}

.status.success {
  color: #6ef2c7;
}

.status.error {
  color: var(--danger);
}

.status.busy {
  color: var(--accent-strong);
}

.download {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: none;
  background: linear-gradient(120deg, rgba(118, 245, 196, 0.35), rgba(42, 209, 255, 0.35));
  color: var(--text);
  margin-top: 0.8rem;
  font-weight: 600;
}

.download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding: 3rem;
  border-radius: 1.5rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(120deg, rgba(42, 209, 255, 0.08), rgba(118, 245, 196, 0.08));
}

.guide ol {
  padding-left: 1.2rem;
}

.guide li {
  margin-bottom: 0.8rem;
}

.checklist {
  background: rgba(5, 5, 10, 0.4);
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
}

.checklist ul {
  padding-left: 1.2rem;
}

footer {
  width: min(1200px, 92vw);
  margin: 0 auto 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

.orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.5;
}

.orb--one {
  top: -60px;
  left: -40px;
  background: rgba(118, 245, 196, 0.65);
}

.orb--two {
  bottom: 60px;
  right: -120px;
  background: rgba(42, 209, 255, 0.55);
}

@media (max-width: 720px) {
  .hero {
    padding-top: 2rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .panel {
    padding: 1.25rem;
  }

  .guide {
    padding: 2rem 1.2rem;
  }

  .panel--input {
    grid-column: span 1;
  }
}
