:root {
  color-scheme: light;
  --bg: #f3f5ef;
  --paper: #fffff7;
  --paper-2: #f8f9f1;
  --ink: #171915;
  --ink-soft: #464b42;
  --ink-muted: #6e7468;
  --line: #1c1f19;
  --line-soft: #d8ddd0;
  --accent: #baff36;
  --accent-strong: #6a9d00;
  --accent-ink: #11140f;
  --yellow: #ffd86a;
  --blue: #c8e6ff;
  --red: #e06452;
  --result: #171d16;
  --result-soft: #222a20;
  --shadow-hard: 10px 10px 0 var(--ink);
  --shadow-soft: 0 24px 70px rgb(25 29 20 / 0.13);
  --radius: 10px;
  --radius-sm: 6px;
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f120e;
  --paper: #191d17;
  --paper-2: #20251d;
  --ink: #f3f7ed;
  --ink-soft: #cad2c2;
  --ink-muted: #9aa590;
  --line: #e9f0df;
  --line-soft: #384234;
  --accent: #c7ff4d;
  --accent-strong: #d8ff75;
  --accent-ink: #10140d;
  --yellow: #f4cb5a;
  --blue: #7fb2df;
  --red: #f08a78;
  --result: #f5f8ef;
  --result-soft: #e7efdc;
  --shadow-hard: 10px 10px 0 #050604;
  --shadow-soft: 0 28px 80px rgb(0 0 0 / 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgb(23 25 21 / 0.04) 1px, transparent 1px),
    linear-gradient(rgb(23 25 21 / 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
  text-rendering: geometricPrecision;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

input,
select {
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 3px;
}

input::placeholder {
  color: color-mix(in srgb, var(--ink-muted) 82%, transparent);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  transform: translateY(-145%);
  transition: transform 180ms var(--ease-out-strong);
}

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

.site-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  max-width: 1160px;
  min-height: 58px;
  margin: 12px auto 0;
  padding: 7px 9px;
  border: 1.5px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow:
    0 14px 38px rgb(25 29 20 / 0.08),
    inset 0 0 0 1px color-mix(in srgb, var(--paper) 70%, transparent);
  backdrop-filter: blur(18px) saturate(1.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 2px;
  width: fit-content;
  justify-self: center;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 16%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 760;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.site-nav a:hover {
  background: var(--paper);
  color: var(--ink);
}

.theme-toggle,
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 65%, transparent);
  transition:
    transform 140ms var(--ease-out-strong),
    background-color 160ms ease,
    color 160ms ease;
}

.theme-toggle svg,
.button svg,
.icon-button svg,
.copy-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
  transition:
    transform 140ms var(--ease-out-strong),
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 4px 4px 0 var(--line);
}

.button.secondary,
.copy-button {
  background: var(--paper);
  color: var(--ink);
}

.theme-toggle:active,
.icon-button:active,
.button:active,
.copy-button:active,
.word-chip:active {
  transform: translateY(1px);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover,
  .copy-button:hover,
  .icon-button:hover,
  .theme-toggle:hover,
  .word-chip:hover {
    transform: translateY(-2px);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.52fr) minmax(620px, 1fr);
  gap: 34px;
  max-width: 1280px;
  min-height: calc(100dvh - 96px);
  margin: 0 auto;
  padding: 54px 22px 76px;
  align-items: center;
}

.hero-copy {
  align-self: center;
  padding-top: 10px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.1rem, 7vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 34rem;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  line-height: 1.55;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.tool-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.46fr);
  gap: 0;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

.tool-shell::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent calc(100% - 292px), rgb(23 25 21 / 0.03) calc(100% - 292px)),
    linear-gradient(rgb(23 25 21 / 0.028) 1px, transparent 1px);
  background-size: auto, 100% 38px;
}

.tool-header {
  position: relative;
  grid-column: 1 / 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 2px solid var(--line);
}

.tool-kicker,
.result-label,
.freshness {
  margin: 0 0 5px;
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 850;
}

.tool-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.95rem);
  line-height: 1;
  letter-spacing: 0;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 820;
  white-space: nowrap;
  cursor: pointer;
}

.mode-switch input {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  min-height: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, var(--paper));
  box-shadow: none;
  cursor: pointer;
  vertical-align: middle;
}

.mode-switch input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  content: "";
  transition:
    transform 180ms var(--ease-out-strong),
    background-color 160ms ease;
}

.mode-switch input:checked {
  background: var(--accent);
}

.mode-switch input:checked::before {
  transform: translateX(18px);
  background: var(--accent-ink);
}

.mode-switch input:focus {
  outline: none;
}

.mode-switch input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 3px;
}

.solver-form {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

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

legend,
.form-grid label > span,
.sort-label span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 850;
}

.tile-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(46px, 1fr));
  gap: 8px;
}

.tile-row label {
  display: grid;
  gap: 5px;
}

.tile-row label span {
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.tile-row input {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.tile-row.warning input {
  background: color-mix(in srgb, var(--yellow) 72%, var(--paper));
}

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

.form-grid input,
.sort-label select {
  width: 100%;
  padding: 0 12px;
  font-weight: 680;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-note {
  min-height: 24px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-note.error {
  color: var(--red);
}

.results-panel {
  position: relative;
  z-index: 1;
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  border-left: 2px solid var(--line);
  background: var(--result);
  color: var(--paper);
  padding: 20px;
}

[data-theme="dark"] .results-panel {
  color: #11140f;
}

.results-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.results-panel .result-label,
.results-panel .sort-label span {
  color: color-mix(in srgb, currentColor 68%, transparent);
}

.results-topline strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2.6rem;
  line-height: 0.95;
}

.sort-label {
  min-width: 116px;
}

.sort-label select {
  border-color: transparent;
  background: color-mix(in srgb, currentColor 10%, transparent);
  color: inherit;
}

.sort-label option {
  color: #171915;
}

.best-word {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 2px solid color-mix(in srgb, currentColor 48%, transparent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
}

.best-word span {
  font-size: 0.78rem;
  font-weight: 850;
}

.best-word strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.65rem;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 190px;
  max-height: 430px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 40%, transparent) transparent;
}

.results-grid::-webkit-scrollbar {
  width: 8px;
}

.results-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 34%, transparent);
}

.word-chip {
  min-width: 0;
  min-height: 40px;
  border: 1.5px solid color-mix(in srgb, currentColor 42%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  transition:
    transform 140ms var(--ease-out-strong),
    background-color 160ms ease,
    color 160ms ease;
}

.word-chip:hover {
  background: var(--paper);
  color: var(--accent-ink);
}

[data-theme="dark"] .word-chip:hover {
  background: #11140f;
  color: #f6f9ef;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1.5px dashed color-mix(in srgb, currentColor 42%, transparent);
  border-radius: var(--radius);
  color: color-mix(in srgb, currentColor 76%, transparent);
  line-height: 1.5;
}

.copy-button {
  margin-top: auto;
  border-color: color-mix(in srgb, currentColor 56%, transparent);
  background: var(--paper);
  color: var(--accent-ink);
  box-shadow: none;
}

.seo-article {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 22px 112px;
}

.seo-article section {
  padding: 44px 0;
  border-top: 2px solid var(--line);
}

.seo-article h1,
.seo-article h2 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 4vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.seo-article h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.seo-article p {
  max-width: 72ch;
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.direct-answer {
  display: grid;
  gap: 6px;
}

.direct-answer p:last-child {
  max-width: 82ch;
  padding: 20px 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 72%, var(--line));
}

.comparison-table {
  display: grid;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.comparison-table [role="row"] {
  display: grid;
  grid-template-columns: 0.72fr 1.35fr 1fr;
}

.comparison-table [role="row"] + [role="row"] {
  border-top: 1.5px solid var(--line-soft);
}

.comparison-table span {
  padding: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.comparison-table [role="columnheader"] {
  border-bottom: 2px solid var(--line);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
}

.use-case-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.use-case-grid div {
  min-height: 156px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.use-case-grid div:nth-child(2) {
  background: var(--blue);
  color: #101318;
}

.use-case-grid div:nth-child(3) {
  background: var(--yellow);
  color: #17130a;
}

.use-case-grid div:nth-child(4) {
  background: color-mix(in srgb, var(--accent) 42%, var(--paper));
}

.use-case-grid div:nth-child(2) h3,
.use-case-grid div:nth-child(2) p,
.use-case-grid div:nth-child(3) h3,
.use-case-grid div:nth-child(3) p {
  color: inherit;
}

.use-case-grid p {
  margin-bottom: 0;
}

.faq-section details {
  border-top: 1.5px solid var(--line-soft);
  padding: 18px 0;
}

.faq-section details:last-child {
  border-bottom: 1.5px solid var(--line-soft);
}

.faq-section summary {
  min-height: 44px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.faq-section summary::marker {
  color: var(--accent-strong);
}

.next-step {
  display: grid;
  justify-items: start;
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 70px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 6px 0;
}

.policy-dock {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgb(25 34 18 / 0.13);
  font-size: 0.8rem;
  font-weight: 750;
}

.policy-dock a {
  color: var(--ink-soft);
}

.policy-dock a:hover {
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 38px;
  }

  h1 {
    max-width: 12ch;
  }

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

  .tool-shell::before {
    background:
      linear-gradient(rgb(23 25 21 / 0.028) 1px, transparent 1px);
    background-size: 100% 38px;
  }

  .tool-header,
  .solver-form,
  .results-panel {
    grid-column: 1 / -1;
  }

  .results-panel {
    grid-row: auto;
    border-top: 2px solid var(--line);
    border-left: 0;
  }

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

@media (max-width: 760px) {
  html {
    scroll-behavior: auto;
  }

  body {
    background-size: 34px 34px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    top: 8px;
    margin: 8px 10px 0;
    padding: 8px;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .hero {
    padding: 28px 12px 54px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.25rem);
  }

  .hero-lede {
    font-size: 1rem;
  }

  .tool-shell {
    border-radius: 14px;
    box-shadow: 6px 6px 0 var(--line);
  }

  .tool-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 15px 14px;
  }

  .solver-form {
    padding: 15px;
  }

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

  .tile-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .results-panel {
    padding: 16px;
  }

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

  .comparison-table [role="row"] {
    grid-template-columns: 1fr;
  }

  .comparison-table span + span {
    border-top: 1px solid var(--line-soft);
  }

  .use-case-grid {
    grid-template-columns: 1fr;
  }

  .seo-article {
    padding-inline: 14px;
  }

  .policy-dock {
    position: static;
    justify-content: flex-end;
    width: fit-content;
    margin: 20px 10px 0 auto;
  }
}

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