@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --blue: #0078d4;
  --blue-deep: #004578;
  --blue-mid: #106ebe;
  --blue-soft: #c7e0f4;
  --blue-mist: #deecf9;
  --ink: #1b1a19;
  --ink-muted: #484644;
  --paper: #fafbfd;
  --white: #ffffff;
  --surface: #ffffff;
  --header-bg: rgba(250, 251, 253, 0.88);
  --line: rgba(0, 90, 158, 0.14);
  --shadow: 0 24px 60px rgba(0, 69, 120, 0.18);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1280px;
  --header-h: 64px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --ink: #f3f2f1;
  --ink-muted: #c8c6c4;
  --paper: #14181d;
  --surface: #1f242b;
  --blue-soft: #274156;
  --blue-mist: rgba(0, 120, 212, 0.16);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(20, 24, 29, 0.85);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(0, 120, 212, 0.14), transparent 55%),
    radial-gradient(700px 360px at 92% 0%, rgba(16, 110, 190, 0.1), transparent 50%);
}

a {
  color: var(--blue-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-deep);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--blue-mist);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
  padding-inline: max(1.25rem, calc((100% - var(--max)) / 2));
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.top-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.top-brand .dash {
  color: var(--blue);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.top-nav > a {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.top-nav > a:hover {
  color: var(--blue);
}

.top-dropdown {
  position: relative;
}

.top-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.top-dropdown-toggle:hover {
  color: var(--blue);
}

.top-dropdown-caret {
  color: var(--ink-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.top-dropdown-toggle:hover .top-dropdown-caret {
  color: var(--blue);
}

.top-dropdown.is-open .top-dropdown-caret {
  transform: rotate(180deg);
}

.top-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 160px;
  padding: 0.4rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

.top-dropdown.is-open .top-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.top-dropdown-menu a {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-dropdown-menu a:hover {
  background: var(--blue-mist);
  color: var(--blue);
}

.top-coffee {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}

.top-coffee:hover {
  border-color: var(--blue-soft);
  color: var(--blue);
}

.top-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  border: 2px solid transparent;
  font-weight: 600;
  color: var(--white) !important;
  background: var(--blue);
  box-shadow: 0 10px 28px rgba(0, 120, 212, 0.35);
  white-space: nowrap;
}

.top-cta:hover {
  background: var(--blue-mid);
  color: var(--white) !important;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--blue);
  border-color: var(--blue-soft);
}

.theme-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-icon-sun {
  display: none;
}

:root[data-theme='dark'] .theme-icon-moon {
  display: block;
}

@media (max-width: 780px) {
  .top-nav > a:not(.top-coffee),
  .top-dropdown {
    display: none;
  }

  .top-coffee {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .top {
    gap: 0.75rem;
  }

  .top-nav {
    gap: 0.6rem;
  }

  .top-coffee {
    display: none;
  }

  .top-cta {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* Legal content */

.legal {
  width: min(100% - 2.5rem, 56rem);
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.legal-updated {
  font-family: var(--font-display);
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin: 2.25rem 0 0.65rem;
}

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

.legal ul {
  padding-left: 1.25rem;
}

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

.legal pre {
  background: var(--blue-mist);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.legal pre code {
  background: none;
  padding: 0;
  color: var(--ink);
}

.legal ol {
  padding-left: 1.25rem;
  color: var(--ink-muted);
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

.legal th,
.legal td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
}

.legal th {
  background: var(--blue-mist);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
}

.legal td {
  color: var(--ink-muted);
}

.legal-callout {
  list-style: none;
  margin: 0;
  padding: 1.1rem 1.4rem;
  background: var(--blue-mist);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.legal-callout li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}

.legal-callout li:first-child {
  border-top: none;
  padding-top: 0.1rem;
}

.legal-callout li:last-child {
  padding-bottom: 0.1rem;
}

.legal-callout strong {
  color: var(--blue-deep);
}

:root[data-theme='dark'] .legal h2 {
  color: var(--ink);
}

:root[data-theme='dark'] .legal-callout strong {
  color: var(--blue);
}

/* Footer */

.footer {
  background: var(--blue-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 0 1.75rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-about {
  max-width: 24rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  text-decoration: none;
}

.footer-brand .dash {
  color: #7ec8f7;
}

.footer-tagline {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-links {
  font-family: var(--font-display);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  padding-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}
