:root {
  color-scheme: light;
  --bg: #f8faf9;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --text: #13211f;
  --muted: #5c6f6b;
  --line: #d8e5e1;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --accent: #f59e0b;
  --shadow: 0 20px 60px rgba(15, 118, 110, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101514;
  --surface: rgba(24, 33, 31, 0.86);
  --surface-strong: #18211f;
  --text: #edf7f4;
  --muted: #a7bbb5;
  --line: #2a3a36;
  --brand: #2dd4bf;
  --brand-strong: #5eead4;
  --accent: #fbbf24;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 32rem),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), #ffffff 35%));
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--surface-strong), transparent 10%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 34px rgba(19, 33, 31, 0.06);
}

.brand,
.nav,
.hero-actions,
.results-header,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-icon {
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(15, 118, 110, 0.18));
}

.brand-word {
  font-size: 1.08rem;
}

.nav {
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a,
.nav-menu-button {
  min-height: 2.55rem;
  padding: 0 0.8rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.nav a {
  display: inline-flex;
  align-items: center;
}

.nav a:hover,
.nav-menu:hover .nav-menu-button,
.nav-menu-button:focus-visible {
  background: color-mix(in srgb, var(--brand), transparent 90%);
  color: var(--brand-strong);
}

.nav-menu {
  position: relative;
}

.nav-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-menu-button span {
  font-size: 0.72rem;
  line-height: 1;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 50%;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface-strong);
  box-shadow: 0 24px 70px rgba(19, 33, 31, 0.16);
  transform: translateX(-50%) translateY(0.4rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-menu:hover .nav-dropdown,
.nav-menu:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: grid;
  gap: 0.16rem;
  min-height: auto;
  padding: 0.8rem;
  border-radius: 0.5rem;
}

.nav-dropdown span {
  color: var(--text);
  font-weight: 800;
}

.nav-dropdown small {
  color: var(--muted);
  font-size: 0.82rem;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  background: var(--text);
  color: var(--surface-strong);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
}

.icon-button,
.primary-action,
.secondary-action {
  min-height: 2.65rem;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}

.icon-button {
  width: 2.65rem;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  text-decoration: none;
  font-weight: 750;
}

.primary-action {
  background: var(--brand);
  color: #ffffff;
}

.secondary-action {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hero,
.tool-shell,
.feature-band,
.footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
  min-height: calc(100vh - 4.7rem);
  padding: 4rem 0;
}

.compact-hero {
  min-height: 34rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3rem, 10vw, 6.6rem);
  line-height: 0.96;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

h3 {
  margin: 0 0 0.45rem;
}

.hero-text {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-panel,
.hero-image-card,
.tool-shell,
.settings-panel,
.feature-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-panel {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 0.5rem;
}

.hero-image-card {
  overflow: hidden;
  margin: 0;
  border-radius: 0.5rem;
}

.hero-image-card picture,
.hero-image-card img {
  display: block;
}

.hero-image-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.hero-image-card figcaption {
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--surface-strong);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.metric-row span {
  color: var(--muted);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 7rem;
  aspect-ratio: 1;
  margin: 1rem auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 86%, var(--line) 86% 100%);
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 900;
}

.tool-shell {
  padding: clamp(1rem, 4vw, 2rem);
  border-radius: 0.5rem;
}

.tool-header,
.tool-grid {
  display: grid;
  gap: 1rem;
}

.tool-header {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 1.5rem;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand), transparent 86%);
  color: var(--brand);
  font-weight: 750;
}

.tool-grid {
  grid-template-columns: minmax(0, 1fr) 21rem;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 22rem;
  padding: 2rem;
  border: 2px dashed color-mix(in srgb, var(--brand), var(--line) 55%);
  border-radius: 0.5rem;
  text-align: center;
  background: color-mix(in srgb, var(--surface-strong), transparent 22%);
}

.upload-zone.is-dragging {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand), transparent 90%);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 4.5rem;
  aspect-ratio: 1;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 2rem;
}

.upload-zone p,
.feature-grid p,
.empty-state,
.recommendation {
  color: var(--muted);
  line-height: 1.6;
}

.settings-panel {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
}

.settings-panel label {
  font-weight: 750;
}

.settings-panel input,
.settings-panel select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface-strong);
  color: var(--text);
}

.settings-panel input[type="range"] {
  padding: 0;
}

.recommendation {
  margin-top: 0.6rem;
  padding: 0.8rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--accent), transparent 86%);
}

.results {
  margin-top: 1.5rem;
}

.results-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-list {
  display: grid;
  gap: 0.75rem;
}

.ad-slot {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  min-height: 6rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--brand), var(--line) 55%);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--surface-strong), transparent 20%);
  color: var(--muted);
  text-align: center;
}

.ad-slot-top {
  margin: 0 0 1.5rem;
}

.ad-slot span {
  color: var(--text);
  font-weight: 800;
}

.ad-slot small {
  font-size: 0.85rem;
}

.result-card {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.result-card img {
  width: 5rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.45rem;
}

.result-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.result-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saving {
  color: var(--brand);
  font-weight: 800;
}

.feature-band {
  display: grid;
  gap: 1.5rem;
  padding: 5rem 0;
}

.content-page {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.content-page h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.content-page h2 {
  margin-top: 2rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.content-page p,
.content-page li {
  color: var(--muted);
  line-height: 1.75;
}

.content-page a {
  color: var(--brand);
  font-weight: 750;
}

.contact-panel {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article {
  padding: 1rem;
  border-radius: 0.5rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.blog-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.blog-card span {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.article-meta {
  margin: 0 0 1rem;
  color: var(--muted);
}

.article-hero {
  overflow: hidden;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-hero picture,
.article-hero img {
  display: block;
}

.article-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.article-hero figcaption {
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--surface-strong);
}

.source-list {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.source-list h2 {
  margin-top: 0;
}

.footer {
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }

  .header-cta {
    min-height: 2.45rem;
    padding: 0 0.75rem;
    font-size: 0.88rem;
  }

  .brand-word {
    font-size: 1rem;
  }

  .hero,
  .tool-grid,
  .tool-header,
  .feature-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 2.5rem;
  }

  h1 {
    max-width: 10ch;
  }

  .privacy-pill {
    width: fit-content;
  }

  .result-card {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .result-card img {
    width: 4rem;
  }

  .result-card .secondary-action {
    grid-column: 1 / -1;
  }
}

/* ---------- Video compressor ---------- */
.video-hero {
  min-height: auto;
  padding: 3.5rem 0 2.5rem;
}

.video-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.hero-panel ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.8;
}

.engine-info {
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-panel .primary-action {
  width: 100%;
  margin-top: 0.4rem;
}

.settings-panel .primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.video-card {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.video-card video,
.video-thumb {
  width: 9rem;
  aspect-ratio: 16 / 9;
  border-radius: 0.45rem;
  background: #0b1514;
  object-fit: contain;
}

.video-thumb {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.4rem;
}

.video-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.progress {
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 200ms ease;
}

.error-text {
  color: #b91c1c;
  font-weight: 700;
}

.faq details {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.faq summary {
  font-weight: 800;
  cursor: pointer;
}

.faq {
  display: grid;
  gap: 0.75rem;
}

.faq p {
  color: var(--muted);
  line-height: 1.7;
}

.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (max-width: 820px) {
  .video-card {
    grid-template-columns: 1fr;
  }

  .video-card video,
  .video-thumb {
    width: 100%;
  }
}

.settings-panel [hidden] {
  display: none !important;
}

.footer {
  flex-wrap: wrap;
}

.hero-panel[hidden] {
  display: none;
}

.quick-answer {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--brand);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--brand), transparent 92%);
}

.quick-answer p {
  margin: 0.3rem 0 0;
}

.content-page table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.content-page th,
.content-page td {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  text-align: left;
  color: var(--muted);
}

.content-page th {
  color: var(--text);
  background: var(--surface);
}

.table-wrap {
  overflow-x: auto;
}

.article-cta {
  display: grid;
  gap: 0.6rem;
  margin: 2rem 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-cta .primary-action {
  width: fit-content;
  color: #ffffff;
}

.guide-links {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.9;
}

.guide-links a {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- Mobile menu ---------- */
.menu-toggle {
  display: none;
}

.nav-menu.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-grid;
    place-content: center;
    gap: 5px;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface-strong);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 1.2rem;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .brand {
    margin-right: auto;
  }

  .topbar.nav-open .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    order: 10;
    width: 100%;
    gap: 0.15rem;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--line);
    font-size: 1rem;
  }

  .topbar.nav-open .nav > a,
  .topbar.nav-open .nav-menu-button {
    min-height: 2.9rem;
    padding: 0 0.6rem;
  }

  /* Show the Tools links inline inside the open mobile menu */
  .topbar.nav-open .nav-menu-button {
    display: flex;
    width: 100%;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    pointer-events: none;
  }

  .topbar.nav-open .nav-menu-button span {
    display: none;
  }

  .topbar.nav-open .nav-dropdown {
    position: static;
    width: auto;
    padding: 0 0 0.4rem;
    border: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .topbar.nav-open .nav-dropdown a {
    padding: 0.6rem;
  }
}

@media (max-width: 480px) {
  .topbar .header-cta {
    display: none;
  }
}

/* ---------- Shared tool controls ---------- */
.tool-hero {
  min-height: auto;
  padding: 3.5rem 0 2.5rem;
}

.tool-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  min-height: 2.1rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand), transparent 88%);
  color: var(--brand-strong);
}

.input-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
}

.settings-panel .check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.settings-panel .check-row input {
  width: auto;
  min-height: auto;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--brand), transparent 88%);
  color: var(--brand);
  font-weight: 900;
}

.result-card .result-actions {
  display: flex;
  gap: 0.5rem;
}

.tool-preview {
  display: grid;
  place-items: center;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.tool-preview canvas,
.tool-preview img,
.tool-preview video {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 0.4rem;
}

.tools-hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.tool-card strong {
  font-size: 1.05rem;
}

.tool-card span {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .tools-hub {
    grid-template-columns: 1fr;
  }

  .result-card .result-actions {
    grid-column: 1 / -1;
  }
}

#vtPanel {
  display: grid;
  gap: 0.75rem;
}

.input-pair .secondary-action {
  min-height: 2.65rem;
  padding: 0 0.6rem;
  font-size: 0.88rem;
}

.tool-preview audio {
  width: 100%;
}

.passport-editor {
  margin-top: 1rem;
}

#ppCanvas {
  width: 360px;
  max-width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 1px var(--line);
}

#ppCanvas:active {
  cursor: grabbing;
}
