: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;
  }
}
