@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/hanken-grotesk-latin-wght-normal.c501f578bf3f.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f8fafc;
  --text: #111827;
  --body: #374151;
  --muted: #4b5563;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --accent: #b8f000;
  --accent-ink: #5c7300;
  --accent-soft: #f4fbd6;
  --accent-strong: #a3d800;
  --accent-contrast: #111827;
  --link: #315cde;
  --amber: #b45309;
  --green: #047857;
  --error: #b42318;
  --focus-ring: #315cde;
  --shadow: 0 1px 2px rgb(17 24 39 / 0.05), 0 18px 40px -22px rgb(17 24 39 / 0.22);
  --brand-ink: #0f172a;
  --flag-edge: rgb(17 24 39 / 0.14);
  --field: #ffffff;
  --placeholder: #6b7280;
  --check: #111827;
  --highlight: var(--accent);
  --dots: #dfe5ec;
  --dep-line: #64748b;
  --raised: #f1f5f9;
  --column: #e9eef4;
  --idle-bg: #eef2f6;
  --ok-bg: #d1fae5;
  --ok-ink: #065f46;
  --ok-line: #6ee7b7;
  --info-bg: #dbe6ff;
  --info-ink: #1e3fae;
  --info-line: #93b0f5;
  --risk-bg: #fee4e2;
  --risk-ink: #912018;
  --risk-line: #fda29b;
  --risk-fill: #d92d20;
  --off-a: #e2e8f0;
  --off-b: #f8fafc;
  --band: #111827;
  --form-bg: #ffffff;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --max: 1328px;
  --page-inset: clamp(32px, 7.8vw, 112px);
  --font: "Hanken Grotesk", Arial, sans-serif;
  --display: var(--font);
}

/* theme.js sets data-theme before the first paint. Screen only, so printing keeps dark ink on white. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-muted: #162235;
    --text: #f1f5f9;
    --body: #cbd5e1;
    --muted: #a3b1c6;
    --border: #334155;
    --border-strong: #475569;
    --accent-ink: #b8f000;
    --accent-soft: #314000;
    --accent-strong: #ccff19;
    --link: #8fb0ff;
    --amber: #fbbf24;
    --green: #34d399;
    --error: #fda29b;
    --focus-ring: #b8f000;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -22px rgb(0 0 0 / 0.7);
    --brand-ink: #f8fafc;
    --flag-edge: rgb(255 255 255 / 0.22);
    --field: #0f172a;
    --placeholder: #a3b1c6;
    --check: #b8f000;
    --highlight: rgb(184 240 0 / 0.26);
    --dots: #2b3a50;
    --dep-line: #94a3b8;
    --raised: #273449;
    --column: #172235;
    --idle-bg: #334155;
    --ok-bg: #064e3b;
    --ok-ink: #a7f3d0;
    --ok-line: #10b981;
    --info-bg: #1e3a8a;
    --info-ink: #c7d7fe;
    --info-line: #6b8ff0;
    --risk-bg: #7a271a;
    --risk-ink: #fecdca;
    --risk-line: #f97066;
    --risk-fill: #f97066;
    --off-a: #334155;
    --off-b: #1e293b;
    --band: #1e293b;
    --form-bg: #273449;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  scrollbar-color: var(--border-strong) var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button { font: inherit; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.nowrap { white-space: nowrap; }
.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;
}

.wrap {
  width: min(var(--max), calc(100% - var(--page-inset)));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
}
/* Flex on every page: as a plain block, the inline-flex .brand sits on a text baseline and rides ~4px higher. */
.site-header__id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}
.brand-logo {
  display: block;
  width: 118px;
  height: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  padding: 8px 0;
  color: var(--body);
  font-size: 0.97rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}
.nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-strong);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav--legal { margin-left: auto; }
.nav--legal + .header-tools { margin-left: 0; }
.nav--legal a {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.nav--legal a:hover,
.nav--legal a:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.picker { position: relative; }
.picker summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.picker summary::-webkit-details-marker { display: none; }
.picker summary:hover,
.picker[open] summary { background: var(--bg-muted); color: var(--text); }
.picker__chevron { transition: transform 160ms var(--ease); }
.picker[open] .picker__chevron { transform: rotate(180deg); }
.lang__flag {
  display: block;
  flex: none;
  width: 21px;
  height: 14px;
  border-radius: 2px;
  /* Keeps the white in the Italian flag visible against the page. */
  box-shadow: 0 0 0 1px var(--flag-edge);
}
/* Only theme.js can change the theme, so the control waits for it to set data-theme. */
.theme-picker { display: none; }
:root[data-theme] .theme-picker { display: block; }
.theme-picker summary { justify-content: center; min-width: 32px; }
.picker__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 96px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  list-style: none;
}
.picker__menu :is(a, button) {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.picker__menu :is(a, button):hover,
.picker__menu :is(a, button):focus-visible { background: var(--bg-muted); color: var(--text); }
.picker__menu :is(a[aria-current], button[aria-pressed="true"]) { background: var(--accent-soft); color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-lg {
  min-height: 48px;
  padding: 0 20px;
  font-size: 1rem;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover,
.btn-primary:focus-visible { background: var(--accent-strong); }
.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover,
.btn-ghost:focus-visible { background: var(--accent-soft); }
.btn-login {
  padding: 0;
  background: transparent;
  color: var(--body);
  font-weight: 600;
}
.btn-login:hover,
.btn-login:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 0.94rem;
}
.site-footer nav {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

@media (max-width: 900px) {
  .nav:not(.nav--legal) { display: none; }
  .header-tools { gap: 8px; }
  .site-footer__inner { flex-direction: column; }
  /* Footer links become 44px touch targets once the layout is phone or tablet sized. */
  .site-footer nav { gap: 0 20px; }
  .site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 76px; }
  .site-header__inner { gap: 8px; min-height: 64px; }
  .brand { flex: 0 0 auto; gap: 8px; font-size: 0.98rem; }
  .brand-logo { width: 104px; }
  .header-tools { gap: 6px; min-width: 0; }
  /* No room for the text link beside both actions; legal pages repeat it in the hero. */
  .nav--legal { display: none; }
  .nav--legal + .header-tools { margin-left: auto; }
  .header-actions { gap: 10px; flex: 0 0 auto; }
  .header-actions .btn { min-height: 44px; font-size: 0.88rem; }
  .picker summary { gap: 4px; min-height: 44px; padding: 0 3px; font-size: 0.84rem; }
  .picker__menu :is(a, button) { min-height: 44px; }
  .header-actions .btn-primary { padding: 0 12px; }
}

@media (max-width: 400px) {
  /* The SVG crops to its left edge, so a square box shows the mark alone and frees room for the tools. */
  .brand-logo { width: 32px; height: 32px; }
  .header-actions { gap: 8px; }
  .header-actions .btn { font-size: 0.84rem; }
  .header-actions .btn-primary { padding: 0 9px; }
}

@media (max-width: 340px) {
  /* The longest call to action needs this width; the footer repeats the link. */
  .header-actions .btn-login { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:active { transform: none; }
  .picker__chevron { transition: none; }
}
