/* ==========================================================================
   STICKER LAB — design tokens from design.md (Discord design language)
   ========================================================================== */

:root {
  /* colors */
  --primary: #5865f2;
  --on-primary: #ffffff;
  --green: #35ed7e;
  --magenta: #ec48bd;
  --link: #00b0f4;
  --canvas: #0a0d3a;
  --surface-indigo: #1e2353;
  --surface-onyx: #23272a;
  --surface-black: #000000;
  --ink: #ffffff;
  --ink-dark: #000000;
  --muted: #333333;
  --hairline: #23272a;

  /* rounded */
  --r-xs: 6px;
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 40px;
  --r-pill: 50px;
  --r-jumbo: 120px;
  --r-full: 9999px;

  /* spacing */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 20px;
  --s-xl: 24px;
  --s-xxl: 32px;
  --s-section: 40px;

  /* type */
  --font-display: "Space Grotesk", "Pretendard Variable", Pretendard,
    "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Pretendard Variable", Pretendard, "Noto Sans KR", Inter,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;

  /* elevation — level 1, wide violet-tinted diffuse glow */
  --float: 0 3px 68px rgba(69, 42, 124, 0.35);

  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Author rules like `.btn { display: inline-flex }` outrank the UA's
   `[hidden] { display: none }`, so state the intent once, loudly. */
[hidden] {
  display: none !important;
}

figure {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The animated Blurple → violet → magenta gradient mesh.
   Atmosphere lives here, never a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 18% 12%, rgba(88, 101, 242, 0.55), transparent 62%),
    radial-gradient(34% 38% at 82% 8%, rgba(236, 72, 189, 0.34), transparent 60%),
    radial-gradient(46% 40% at 72% 62%, rgba(112, 74, 224, 0.4), transparent 64%),
    radial-gradient(40% 44% at 12% 78%, rgba(236, 72, 189, 0.22), transparent 62%);
  filter: blur(20px);
  animation: mesh-drift 26s ease-in-out infinite alternate;
}

@keyframes mesh-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2.5%, -3%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-3%, 2%, 0) scale(1.04);
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Type scale
   -------------------------------------------------------------------------- */

.display-xl,
.display-lg,
.display-md,
.heading-lg,
.heading-sm {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

.display-xl {
  font-size: clamp(44px, 8vw, 82px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.display-lg {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.display-md {
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
}

.heading-lg {
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.1;
}

.heading-sm {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.body-lg {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 500;
  line-height: 1.4;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

.dim {
  opacity: 0.72;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--s-xl), var(--container));
  margin-inline: auto;
}

section {
  padding-block: clamp(56px, 9vw, 120px);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.94);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  filter: none;
}

.btn:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--r-sm);
  padding: var(--s-lg) var(--s-xl);
}

.btn-green {
  background: var(--green);
  color: var(--ink-dark);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--r-sm);
  padding: var(--s-sm) var(--s-xl);
  min-height: 48px;
}

.btn-white {
  background: var(--ink);
  color: var(--ink-dark);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--r-lg);
  padding: var(--s-sm) var(--s-md);
}

.btn-ghost {
  background: var(--surface-indigo);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--r-lg);
  padding: var(--s-md);
}

.btn-ghost-sm {
  background: var(--surface-indigo);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--r-xs);
  padding: var(--s-sm) var(--s-xxl);
}

.badge {
  display: inline-block;
  background: var(--magenta);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--r-lg);
  padding: var(--s-xxs) var(--s-sm);
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 58, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-xl);
  padding: var(--s-md) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--primary);
  display: grid;
  place-items: center;
  font-size: 19px;
  box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.18);
}

.nav-links {
  display: flex;
  gap: var(--s-xl);
  margin-left: auto;
}

.nav-links a {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.nav-cta {
  margin-left: var(--s-md);
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-cta {
    margin-left: auto;
    font-size: 16px;
    padding-inline: var(--s-md);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(var(--s-xxl), 5vw, 72px);
  align-items: center;
}

.hero h1 {
  margin-block: var(--s-md) var(--s-lg);
}

.hero h1 .accent {
  color: var(--green);
  display: block;
}

.hero-lead {
  max-width: 46ch;
  margin: 0 0 var(--s-xxl);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

/* Hero media block — swooping bottom-only radius, per design.md */
.hero-media {
  background: linear-gradient(150deg, var(--primary) 0%, #7048c8 46%, var(--magenta) 100%);
  border-radius: var(--r-xl) var(--r-xl) 88px 88px;
  padding: clamp(var(--s-xl), 4vw, var(--s-section));
  box-shadow: var(--float);
}

.sticker-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-sm);
}

.sticker-wall span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: clamp(28px, 4.4vw, 46px);
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--r-lg);
  animation: bob 4.2s ease-in-out infinite;
}

.sticker-wall span:nth-child(2n) {
  animation-delay: -0.7s;
}
.sticker-wall span:nth-child(3n) {
  animation-delay: -1.6s;
}
.sticker-wall span:nth-child(5n) {
  animation-delay: -2.4s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-media {
    order: -1;
  }
}

/* --------------------------------------------------------------------------
   Marquee band
   -------------------------------------------------------------------------- */

.marquee {
  background: var(--primary);
  padding-block: var(--s-lg);
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  gap: var(--s-section);
  padding-right: var(--s-section);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 62px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  animation: slide 22s linear infinite;
}

@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Downloader app
   -------------------------------------------------------------------------- */

.app-shell {
  background: var(--surface-indigo);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 4vw, var(--s-section));
  box-shadow: var(--float);
}

.tabs {
  display: inline-flex;
  gap: var(--s-xxs);
  background: rgba(0, 0, 0, 0.3);
  padding: var(--s-xxs);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-xl);
  flex-wrap: wrap;
}

.tab {
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: var(--s-sm) var(--s-xl);
  border-radius: var(--r-pill);
  transition: background 0.16s ease, color 0.16s ease;
}

.tab[aria-selected="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

.tab:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.panel[hidden] {
  display: none;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: var(--s-xs);
  opacity: 0.8;
}

.input-row {
  display: flex;
  gap: var(--s-sm);
  flex-wrap: wrap;
}

.input {
  flex: 1 1 340px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  padding: var(--s-md);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.28);
}

.hint {
  font-size: 14px;
  opacity: 0.62;
  margin: var(--s-sm) 0 0;
}

.hint code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.34);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

.advanced {
  margin-top: var(--s-lg);
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--r-lg);
  padding: var(--s-md) var(--s-lg);
}

.advanced > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.8;
  list-style: none;
}

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

.advanced > summary::before {
  content: "▸ ";
}

.advanced[open] > summary::before {
  content: "▾ ";
}

.advanced-body {
  padding-top: var(--s-md);
  display: grid;
  gap: var(--s-md);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  font-size: 14px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* progress */
.progress-wrap {
  margin-top: var(--s-xl);
}

.progress-wrap[hidden] {
  display: none;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-sm);
  font-size: 14px;
  margin-bottom: var(--s-xs);
}

.progress {
  height: 10px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary), var(--magenta));
  transition: width 0.2s ease;
}

/* log console */
.log {
  margin-top: var(--s-md);
  background: var(--surface-black);
  border-radius: var(--r-lg);
  padding: var(--s-md);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log[hidden] {
  display: none;
}

.log-line {
  display: block;
}

.log-info {
  color: rgba(255, 255, 255, 0.82);
}
.log-ok {
  color: var(--green);
}
.log-warn {
  color: #ffcc4d;
}
.log-err {
  color: #ff6b81;
}
.log-step {
  color: var(--link);
}

/* results */
.result[hidden] {
  display: none;
}

.result {
  margin-top: var(--s-xl);
  background: var(--surface-black);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-lg), 3vw, var(--s-section));
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-md);
  margin-bottom: var(--s-lg);
}

.result-title {
  margin-right: auto;
}

.result-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.result-title p {
  margin: var(--s-xxs) 0 0;
  font-size: 14px;
  opacity: 0.66;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--s-sm);
}

.tile {
  background: var(--surface-indigo);
  border-radius: var(--r-md);
  padding: var(--s-sm);
  text-align: center;
}

.tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: auto;
}

.tile figcaption {
  margin-top: var(--s-xxs);
  font-size: 13px;
  opacity: 0.68;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  border-radius: var(--r-lg);
  padding: var(--s-md);
  font-size: 15px;
  margin-top: var(--s-md);
}

.notice[hidden] {
  display: none;
}

.notice-err {
  background: rgba(255, 107, 129, 0.14);
  border: 1px solid rgba(255, 107, 129, 0.4);
}

.notice-info {
  background: rgba(0, 176, 244, 0.12);
  border: 1px solid rgba(0, 176, 244, 0.35);
}

.notice strong {
  display: block;
  margin-bottom: var(--s-xxs);
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-lg);
  margin-top: var(--s-xxl);
}

.step-card {
  background: linear-gradient(155deg, var(--magenta) 0%, #b13ce0 100%);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
}

.step-card .num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.55;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: var(--s-sm) 0 var(--s-xs);
}

.step-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.92;
}

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

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-lg);
  margin-top: var(--s-xxl);
}

.feature-gradient {
  background: linear-gradient(145deg, var(--magenta) 0%, #8b4bf0 100%);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 3vw, var(--s-section));
}

.feature-dark {
  background: var(--surface-indigo);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 3vw, var(--s-xxl));
}

.feature-gradient h3,
.feature-dark h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--s-sm);
}

.feature-gradient p,
.feature-dark p {
  margin: 0;
  opacity: 0.9;
}

.feature-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: var(--s-md);
}

.stat-card {
  background: var(--primary);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 3vw, var(--s-xxl));
}

.stat-card .big {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.05;
}

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

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq {
  display: grid;
  gap: var(--s-sm);
  margin-top: var(--s-xxl);
}

.faq-item {
  background: var(--surface-indigo);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
}

.faq-item > summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  display: flex;
  gap: var(--s-md);
  align-items: flex-start;
}

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

.faq-item > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  color: var(--magenta);
}

.faq-item[open] > summary::after {
  content: "–";
}

.faq-item p {
  margin: var(--s-md) 0 0;
  opacity: 0.8;
}

.faq-item code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.36);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   CTA band + footer
   -------------------------------------------------------------------------- */

.cta-band {
  background: var(--primary);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 5vw, var(--s-section));
  text-align: center;
}

.cta-band p {
  max-width: 52ch;
  margin: var(--s-md) auto var(--s-xl);
  opacity: 0.92;
}

.footer {
  padding-block: var(--s-section) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-xl);
}

.footer h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 var(--s-sm);
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-xs);
}

.footer a {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(56px, 17vw, 240px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-align: center;
  margin: var(--s-section) 0 0;
  padding-bottom: var(--s-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(88, 101, 242, 0.15));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

.colophon {
  text-align: center;
  font-size: 14px;
  opacity: 0.5;
  padding-bottom: var(--s-xxl);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
