:root {
  color-scheme: light dark;
  --page: #f7f7fb;
  --surface: #f1f0fa;
  --surface-strong: #ffffff;
  --ink: #05033e;
  --ink-soft: #343452;
  --muted: #565875;
  --line: #d8d9e8;
  --line-strong: #a5a7c2;
  --control-border: #777994;
  --signal: #3526d3;
  --signal-bright: #5142e8;
  --signal-soft: #eceaff;
  --brand-navy: #05033e;
  --header: #ffffff;
  --header-ink: #05033e;
  --header-muted: #565875;
  --danger-note: #f1f0fa;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #090821;
    --surface: #11102e;
    --surface-strong: #17163b;
    --ink: #f7f7ff;
    --ink-soft: #d6d4ef;
    --muted: #aaa8c7;
    --line: #34325d;
    --line-strong: #666393;
    --control-border: #666393;
    --signal: #9d98ff;
    --signal-bright: #bbb7ff;
    --signal-soft: #201c5e;
    --brand-navy: #05033e;
    --header: #ffffff;
    --header-ink: #05033e;
    --header-muted: #565875;
    --danger-note: #15143a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--signal);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--signal);
  transform: translateY(-160%);
}

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

.site-header {
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(calc(100% - 40px), var(--measure));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: auto;
  color: var(--header-ink);
  text-decoration: none;
}

.site-brand:hover {
  color: var(--signal);
}

.site-brand:focus-visible {
  outline-color: #3526d3;
}

.site-brand img {
  width: 174px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--header-muted);
  font-size: 0.86rem;
  font-weight: 620;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--signal);
}

main {
  min-height: calc(100vh - 178px);
}

.home-page,
.legal-page {
  width: min(calc(100% - 40px), var(--measure));
  margin: 0 auto;
}

.home-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(76px, 11vw, 132px) 0 clamp(58px, 9vw, 96px);
  text-align: center;
}

.home-eyebrow {
  margin: 0 0 18px;
  color: var(--signal);
  font-size: 0.76rem;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 730;
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.home-hero-copy {
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.home-search {
  max-width: 680px;
  margin: 38px auto 0;
  text-align: left;
}

.home-search label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.home-search input {
  width: 100%;
  min-height: 62px;
  padding: 15px 20px;
  appearance: none;
  background: var(--surface-strong);
  color: var(--ink);
  border: 2px solid var(--control-border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgb(5 3 62 / 8%);
  font: inherit;
  font-size: 1.02rem;
}

.home-search input::placeholder {
  color: var(--muted);
}

.home-search input:hover {
  border-color: var(--signal);
}

.home-search p {
  min-height: 1.4em;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.home-section {
  padding: 0 0 clamp(76px, 10vw, 120px);
}

.home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.home-section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.home-section-heading > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.home-empty-state {
  display: grid;
  min-height: 104px;
  place-items: center;
  padding: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.home-empty-state p {
  margin: 0;
  color: var(--muted);
}

.home-tool-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-tool-card[hidden],
.home-no-results[hidden] {
  display: none;
}

.home-tool-card a {
  display: flex;
  min-height: 100%;
  padding: 24px;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
}

.home-tool-card a:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
}

.home-tool-category {
  color: var(--signal);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-tool-card h3 {
  margin: 16px 0 8px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.home-tool-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.home-tool-open {
  margin-top: auto;
  color: var(--signal);
  font-size: 0.84rem;
  font-weight: 700;
}

.home-no-results {
  margin: 0;
  padding: 40px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.site-footer {
  background: #05033e;
  color: #c9c7e5;
  border-top: 1px solid #29266d;
}

.site-footer-inner {
  width: min(calc(100% - 40px), var(--measure));
  min-height: 110px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-footer-nav a {
  color: #f7f7ff;
}

.site-footer-nav {
  display: flex;
  gap: 22px;
}

.site-footer-nav a {
  font-size: 0.82rem;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
}

.legal-page {
  max-width: 850px;
  padding: 42px 0 80px;
}

.legal-breadcrumb {
  display: flex;
  gap: 9px;
  margin-bottom: 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-breadcrumb a {
  color: var(--muted);
}

.legal-page > header {
  padding-bottom: 30px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line-strong);
}

.legal-label {
  margin: 0 0 12px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-page h1 {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.legal-updated {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-page > p:first-of-type {
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.legal-page section {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.legal-page h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.legal-page h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}

.legal-page p,
.legal-page li {
  color: var(--ink-soft);
}

.legal-page ul {
  padding-left: 1.3rem;
}

.legal-note {
  padding: 16px 18px;
  border-left: 3px solid var(--signal);
  background: var(--danger-note);
}

@media (max-width: 760px) {
  .site-header-inner {
    min-height: auto;
    padding: 13px 0;
    flex-wrap: wrap;
  }

  .site-nav {
    width: 100%;
    order: 3;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    gap: 20px;
  }

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

@media (max-width: 520px) {
  .site-header-inner,
  .home-page,
  .legal-page,
  .site-footer-inner {
    width: min(calc(100% - 28px), var(--measure));
  }

  .site-nav {
    justify-content: space-between;
    gap: 10px;
  }

  .site-nav a {
    font-size: 0.78rem;
  }

  .site-brand img {
    width: 146px;
  }

  .home-hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.2rem);
  }

  .home-search input {
    min-height: 56px;
  }

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

  .site-footer-inner {
    min-height: 130px;
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
