:root {
  --bg: #f6fbf8;
  --surface: #ffffff;
  --surface-strong: #eef9f4;
  --ink: #14221d;
  --muted: #5f7069;
  --faint: #dbe9e3;
  --accent: #0b8f78;
  --accent-strong: #056452;
  --cyan: #2c9fd8;
  --amber: #ffb84d;
  --rose: #d85f6d;
  --shadow: 0 24px 70px rgba(24, 57, 45, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(44, 159, 216, 0.11), transparent 30rem),
    radial-gradient(circle at 83% 18%, rgba(255, 184, 77, 0.16), transparent 19rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(246, 251, 248, 0.8);
  border-bottom: 1px solid rgba(20, 34, 29, 0.08);
}

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

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  font-size: 1.05rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: #dff6ef;
  border: 1px solid #bfe8dc;
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(11, 143, 120, 0.09);
  color: var(--accent-strong);
  outline: none;
}

.hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.72fr);
  gap: 28px;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.title-block {
  padding: 8px 0 6px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 4vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.title-block p {
  max-width: 660px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-brand-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.hero-logo-card {
  min-height: 96px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(11, 143, 120, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(223, 246, 239, 0.82)),
    #f8fffc;
  box-shadow: 0 18px 44px rgba(24, 57, 45, 0.12);
}

.hero-logo {
  width: 82px;
  height: 82px;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(5, 100, 82, 0.18));
}

.result-panel,
.strength-panel,
.controls-panel,
.method article,
.resource-grid a {
  border: 1px solid rgba(20, 34, 29, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.result-panel {
  padding: 22px;
}

.result-topline,
.label-row,
.strength-heading,
.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-topline {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
  text-transform: uppercase;
}

#privacyNote {
  color: var(--accent-strong);
  text-transform: none;
}

.passphrase {
  min-height: 116px;
  display: block;
  margin: 18px 0;
  padding: 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 246, 239, 0.88), rgba(255, 248, 235, 0.82)),
    #f7fbf7;
  border: 1px solid #cfe6dc;
  color: #0e2d25;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.18rem, 2.2vw, 2rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 760;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(11, 143, 120, 0.25);
}

.ghost-button {
  color: var(--ink);
  background: #edf7f3;
  border: 1px solid #cde5dc;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
input:focus-visible + span,
.connector-grid input:focus-visible + span {
  outline: 3px solid rgba(44, 159, 216, 0.36);
  outline-offset: 2px;
}

button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strength-panel {
  padding: 20px;
  position: relative;
  overflow: visible;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(230, 248, 243, 0.84)),
    radial-gradient(circle at 100% 0%, rgba(44, 159, 216, 0.18), transparent 18rem);
}

.strength-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 4px solid var(--accent);
  pointer-events: none;
}

.strength-heading h2,
.panel-heading h2,
.method h2,
.research h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.strength-heading p,
.helper,
.section-heading p,
.method p,
.resource-grid span {
  color: var(--muted);
}

.strength-heading p {
  margin-top: 5px;
  font-size: 0.92rem;
}

#bitsValue {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: #dff6ef;
  box-shadow: inset 0 0 0 1px #bfe8dc;
  font-size: 1.7rem;
  color: var(--accent-strong);
}

.meter {
  height: 14px;
  margin: 18px 0 16px;
  border-radius: 999px;
  background: #e4eee9;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(20, 34, 29, 0.04);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--amber), var(--accent), var(--cyan));
  transition: width 240ms ease;
}

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.strength-grid div {
  min-height: 86px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(238, 249, 244, 0.9);
  border: 1px solid rgba(191, 232, 220, 0.78);
  box-shadow: 0 10px 22px rgba(24, 57, 45, 0.06);
}

.strength-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.info-bubble {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dff6ef;
  color: var(--accent-strong);
  cursor: help;
  font-size: 0.72rem;
  font-weight: 820;
  line-height: 1;
}

.info-bubble:focus-visible {
  outline: 3px solid rgba(44, 159, 216, 0.36);
  outline-offset: 2px;
}

.info-flyout {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: min(320px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid #bfe8dc;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(24, 57, 45, 0.18);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 520;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.info-bubble:hover .info-flyout,
.info-bubble:focus .info-flyout,
.info-bubble:focus-within .info-flyout {
  opacity: 1;
  transform: translate(-50%, 0);
}

.strength-grid div:last-child .info-flyout {
  left: auto;
  right: 0;
  transform: translateY(4px);
}

.strength-grid div:last-child .info-bubble:hover .info-flyout,
.strength-grid div:last-child .info-bubble:focus .info-flyout,
.strength-grid div:last-child .info-bubble:focus-within .info-flyout {
  transform: translateY(0);
}

.strength-grid dd {
  margin: 8px 0 0;
  color: #041f19;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.25;
}

.strength-grid dd span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.resistance-bar {
  height: 7px;
  display: block;
  margin-top: 10px;
  border-radius: 999px;
  background: #dcebe6;
  overflow: hidden;
}

.resistance-bar b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.resistance-bar.is-caution b {
  background: linear-gradient(90deg, var(--amber), #c8b75a);
}

.controls-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.icon-button {
  width: 46px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: #e7f5f0;
}

.control-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.label-row label,
legend {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 760;
}

.label-row output {
  color: var(--accent-strong);
  font-weight: 780;
}

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

.helper {
  font-size: 0.82rem;
  line-height: 1.45;
}

.toggle-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d3e5de;
  border-radius: 6px;
  background: #f7fbf9;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 720;
}

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

input[type="range"]:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.connector-grid,
.segmented,
.flag-grid {
  display: grid;
  gap: 8px;
}

.connector-grid {
  grid-template-columns: repeat(4, 1fr);
}

.segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flag-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connector-grid input,
.segmented input,
.flag-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.connector-grid span,
.segmented span,
.flag-grid span {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid #d3e5de;
  border-radius: 6px;
  background: #f7fbf9;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.connector-grid input:checked + span,
.segmented input:checked + span,
.flag-grid input:checked + span {
  background: #dff6ef;
  border-color: #73cfbd;
  color: var(--accent-strong);
}

.flag-grid span {
  justify-content: flex-start;
  gap: 10px;
}

.flag {
  width: 22px;
  height: 15px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(20, 34, 29, 0.16);
}

.flag-en {
  background:
    linear-gradient(90deg, transparent 42%, #c8102e 42% 58%, transparent 58%),
    linear-gradient(transparent 36%, #c8102e 36% 64%, transparent 64%),
    linear-gradient(90deg, #012169 0 100%);
}

.flag-de {
  background: linear-gradient(#111 0 33%, #dd0000 33% 66%, #ffce00 66%);
}

.flag-es {
  background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%);
}

.flag-fr {
  background: linear-gradient(90deg, #0055a4 0 33%, #fff 33% 66%, #ef4135 66%);
}

.flag-pt {
  background: linear-gradient(90deg, #046a38 0 42%, #ffcc29 42% 100%);
}

.flag-mix {
  background: linear-gradient(90deg, #012169 0 18%, #dd0000 18% 36%, #f1bf00 36% 54%, #0055a4 54% 72%, #046a38 72%);
}

.method,
.research,
.ad-band,
.legal-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.ad-band {
  padding: 0 0 48px;
}

.ad-band-after-tool {
  padding: 0 0 34px;
}

.ad-band-top {
  width: 100%;
  padding: 0;
  margin: 0;
}

.ad-slot-top {
  min-height: 96px;
}

.ad-band-compact {
  padding: 0 0 28px;
}

.ad-slot {
  min-height: 90px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #9fc9bd;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 246, 239, 0.62), rgba(255, 255, 255, 0.86)),
    #fafffd;
  color: var(--muted);
  text-align: center;
}

.ad-slot--leaderboard {
  width: 100%;
  min-height: 90px;
}

.ad-slot--rectangle {
  width: min(100%, 336px);
  min-height: 280px;
  margin: 0 auto;
}

.ad-slot[data-ad-state="consented"] {
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(223, 246, 239, 0.88), rgba(255, 255, 255, 0.94)),
    #fafffd;
}

.ad-slot[data-ad-state="limited"] {
  opacity: 0.88;
}

.ad-slot span {
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--accent-strong);
  font-size: 0.98rem;
}

.method {
  padding: 30px 0 72px;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 28px;
  align-items: start;
}

.method > div:first-child p {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.7;
}

.method code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e7f5f0;
  color: var(--accent-strong);
}

.method-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.method article {
  padding: 18px;
  box-shadow: none;
}

.method article span {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 820;
}

.method h3 {
  margin-top: 14px;
  font-size: 1rem;
}

.method article p {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.58;
}

.research {
  padding: 52px 0 72px;
  border-top: 1px solid rgba(20, 34, 29, 0.1);
}

.resource-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.resource-grid a {
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  box-shadow: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.resource-grid a:hover,
.resource-grid a:focus-visible {
  transform: translateY(-2px);
  background: #fafffd;
  border-color: #7ecfbd;
  outline: none;
}

.legal-page {
  padding: 48px 0 80px;
}

.legal-card {
  max-width: 860px;
  padding: 28px;
  border: 1px solid rgba(20, 34, 29, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.legal-card h2 {
  margin-top: 28px;
  font-size: 1.2rem;
}

.legal-card p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 34px;
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-strong);
  font-weight: 720;
  text-decoration: none;
}

.resource-grid span {
  font-size: 0.78rem;
  font-weight: 720;
}

.resource-grid strong {
  font-size: 1rem;
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  transform: translateY(90px);
  opacity: 0;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 720;
  box-shadow: var(--shadow);
  transition:
    transform 220ms ease,
    opacity 220ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .hero,
  .method {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    order: initial;
  }

  .method-list,
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .nav,
  .hero,
  .method,
  .research,
  .ad-band,
  .legal-page,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .nav {
    min-height: 64px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 30px;
    gap: 18px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .title-block p {
    font-size: 1rem;
  }

  .hero-brand-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-logo-card {
    width: 88px;
    min-height: 88px;
  }

  .hero-logo {
    width: 74px;
    height: 74px;
  }

  .result-panel,
  .controls-panel,
  .strength-panel {
    padding: 16px;
  }

  .result-topline,
  .strength-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .passphrase {
    min-height: 104px;
    padding: 16px;
    font-size: 1.06rem;
  }

  .result-actions,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .strength-grid,
  .method-list,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .flag-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot {
    min-height: 88px;
  }

  .ad-slot--leaderboard,
  .ad-slot-top {
    min-height: 100px;
  }

  .ad-slot--rectangle {
    width: 100%;
    min-height: 250px;
  }

}

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