:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #101010;
  --panel-2: #151515;
  --text: #f7f7f2;
  --muted: #a8aaa7;
  --line: #2b2b2b;
  --line-strong: #444;
  --accent: #f7f7f2;
  --danger: #ffb4a8;
  --danger-bg: #2a1210;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 160ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 7, 0.86);
  padding: 0 6vw;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 900;
}

.brand strong,
.brand em {
  display: block;
}

.brand strong {
  font-size: 17px;
  font-weight: 650;
}

.brand em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--text);
}

.hero,
.tool-shell,
.info-grid,
.site-footer {
  width: min(1180px, calc(100vw - 40px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 44px;
  align-items: center;
  min-height: 520px;
  padding: 48px 0 34px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 22px;
  max-width: 760px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6.8vw, 82px);
  font-weight: 500;
  line-height: 1.02;
}

.hero-lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.trust-row span,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 650;
}

.ad-card {
  display: grid;
  min-height: 250px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 28px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ad-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: #191919;
}

.ad-card span,
.ad-card strong,
.ad-card small {
  display: block;
}

.ad-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ad-card strong {
  margin-top: 16px;
  font-size: 26px;
  font-weight: 650;
}

.ad-card small {
  max-width: 220px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 20px 0 42px;
}

.tool-panel,
.side-rail article,
.info-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: 28px;
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.tool-heading h2,
.info-grid h2 {
  margin-top: 8px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}

.drop-zone {
  display: grid;
  min-height: 238px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #0b0b0b;
  padding: 30px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone.is-dragging,
.drop-zone:hover {
  border-color: var(--accent);
  background: #111;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
}

.upload-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

#file-title {
  margin-top: 18px;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 26px;
  font-weight: 650;
}

#file-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.button-like,
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 750;
}

.button-like {
  margin-top: 20px;
  background: var(--accent);
  color: var(--bg);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
  padding: 16px;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend,
.range-control span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.range-control strong {
  color: var(--text);
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.segmented button {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 750;
}

.segmented button.is-active {
  background: var(--accent);
  color: var(--bg);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.progress-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
  padding: 16px;
}

.progress-box > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.progress-box strong {
  color: var(--text);
}

.progress-track {
  display: block;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

#progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.error-message {
  margin: 16px 0 0;
  border: 1px solid rgba(255, 180, 168, 0.32);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  border: 1px solid var(--accent);
}

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

.primary-button:disabled {
  opacity: 0.42;
}

.secondary-button {
  background: transparent;
  color: var(--text);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

.result-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 19px;
}

.result-ad {
  display: none;
  min-height: 136px;
  margin-top: 18px;
}

.result-ad.is-visible {
  display: grid;
}

.side-rail {
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-rail article,
.info-grid article {
  padding: 22px;
}

.side-rail p,
.info-grid p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.side-rail p:last-child,
.info-grid p:last-child {
  margin-bottom: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0 80px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 28px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 18px;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .tool-shell,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 52px;
  }

  .controls-grid,
  .result-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero,
  .tool-shell,
  .info-grid,
  .site-footer {
    width: min(100vw - 28px, 1180px);
  }

  h1 {
    margin-top: 16px;
    font-size: clamp(36px, 11vw, 50px);
    line-height: 1.04;
  }

  .hero-lead {
    margin-top: 16px;
    font-size: 16px;
  }

  .trust-row {
    margin-top: 16px;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 18px;
  }

  .hero-ad {
    display: none;
  }

  .tool-panel {
    padding: 18px;
  }

  .tool-heading {
    flex-direction: column;
  }

  .action-row > * {
    width: 100%;
  }
}
