:root {
  color-scheme: dark;
  --background: #0b0c10;
  --surface: #171920;
  --surface-soft: #20232d;
  --border: rgb(255 255 255 / 12%);
  --text: #f7f7f8;
  --muted: #b9bbc4;
  --accent: #ffd11a;
  --accent-strong: #f2bd00;
  --danger: #ff7c7c;
  --success: #5fe09b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgb(255 209 26 / 10%), transparent 35rem),
    var(--background);
  color: var(--text);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.preview-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--accent);
  color: #111;
  font-size: .86rem;
  font-weight: 700;
}

.preview-bar p {
  margin: 0;
  font-weight: 500;
}

.topbar {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand img {
  display: block;
  width: 190px;
  height: auto;
}

.back-link {
  color: var(--muted);
  text-underline-offset: 4px;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
}

.page-shell {
  width: min(940px, calc(100% - 40px));
  margin: 36px auto 0;
}

.intro {
  max-width: 780px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: .98;
  letter-spacing: -.05em;
}

.lead {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.65;
}

.tool-card {
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgb(23 25 32 / 88%);
  box-shadow: 0 28px 90px rgb(0 0 0 / 35%);
}

.upload-area {
  padding: clamp(36px, 8vw, 72px) clamp(20px, 6vw, 48px);
  border: 2px dashed rgb(255 255 255 / 22%);
  border-radius: 20px;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  cursor: pointer;
}

.upload-area:hover,
.upload-area:focus-visible,
.upload-area.drag-over {
  border-color: var(--accent);
  background: rgb(255 209 26 / 6%);
  outline: none;
}

.upload-area.drag-over {
  transform: translateY(-2px);
}

.upload-icon {
  width: 76px;
  color: var(--accent);
}

.upload-area h2 {
  margin: 20px 0 10px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.upload-area p {
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.55;
}

.upload-area code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgb(0 0 0 / 35%);
}

.upload-area small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: #111;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-strong);
}

.button-muted {
  background: var(--surface-soft);
  color: var(--text);
}

.privacy-note {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: rgb(255 209 26 / 6%);
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--text);
}

.processing-section,
.results-section {
  padding: 42px 10px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  border: 4px solid rgb(255 255 255 / 10%);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

.progress-track {
  width: min(560px, 100%);
  height: 10px;
  margin: 24px auto 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}

#progressText,
#resultsCount {
  color: var(--muted);
}

.status-message {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgb(255 124 124 / 35%);
  border-radius: 10px;
  background: rgb(255 124 124 / 8%);
  color: var(--danger);
}

.success-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: rgb(95 224 155 / 12%);
  color: var(--success);
  font-size: 2rem;
  font-weight: 900;
}

.download-list {
  margin: 28px 0;
}

.ad-slot {
  display: grid;
  min-height: 110px;
  margin: 24px 0;
  padding: 18px;
  place-items: center;
  align-content: center;
  border: 1px dashed rgb(255 255 255 / 22%);
  border-radius: 14px;
  background: rgb(255 255 255 / 2%);
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ad-slot p {
  margin: 6px 0 0;
  font-size: .82rem;
}

.pdf-result {
  display: grid;
  gap: 18px;
}

.pdf-preview {
  width: 100%;
  height: 720px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.pdf-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.steps {
  padding: 72px 0 40px;
}

.steps h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.steps li span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-weight: 900;
}

.steps li p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer {
  width: min(940px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .92rem;
}

.footer,
.footer nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer p {
  margin: 0;
}

.footer nav {
  flex-wrap: wrap;
}

.footer a {
  text-underline-offset: 4px;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .preview-bar p {
    display: none;
  }

  .topbar,
  .page-shell,
  .footer {
    width: min(100% - 28px, 940px);
  }

  .brand img {
    width: 155px;
  }

  .page-shell {
    margin-top: 20px;
  }

  .tool-card {
    border-radius: 20px;
  }

  .upload-area {
    padding: 36px 18px;
  }

  .pdf-preview {
    height: 500px;
  }

  .steps ol {
    grid-template-columns: 1fr;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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