:root {
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --bg: oklch(0.145 0.004 240);
  --panel: oklch(0.185 0.005 240);
  --panel-2: oklch(0.225 0.006 240);
  --ink: oklch(0.945 0.004 240);
  --body: oklch(0.78 0.006 240);
  --muted: oklch(0.62 0.006 240);
  --quiet: oklch(0.43 0.006 240);
  --line: oklch(0.31 0.005 240);
  --line-strong: oklch(0.42 0.006 240);
  --cyan: oklch(0.78 0.055 225);
  --cyan-soft: oklch(0.28 0.026 225);
  --success: oklch(0.72 0.09 155);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
}

/* Faint echo of the home page's crystal orb behind the header. */
body::before {
  content: "";
  position: absolute;
  top: -38vmin;
  left: 50%;
  z-index: -1;
  width: min(1100px, 130vmin);
  aspect-ratio: 1;
  border: 1px solid oklch(0.85 0.04 240 / 0.16);
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 34%,
    oklch(0.72 0.08 230 / 0.09),
    oklch(0.5 0.1 280 / 0.05) 55%,
    transparent 72%
  );
  box-shadow:
    0 0 60px oklch(0.7 0.1 240 / 0.12),
    inset 0 0 80px oklch(0.6 0.12 280 / 0.1);
  pointer-events: none;
  transform: translateX(-50%);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

::selection {
  background: var(--cyan-soft);
  color: var(--ink);
}

@keyframes rise {
  from {
    opacity: 0.01;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

/* ---------- Top bar ---------- */

.legal-topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.17 0.005 240 / 0.72);
  backdrop-filter: blur(16px);
  animation: rise 700ms var(--ease-out-expo) both;
}

.brand-link,
.back-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 520;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-link {
  color: var(--ink);
}

.brand-link::before {
  content: "B/F";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.back-link {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  transition:
    background 180ms ease,
    color 180ms ease;
}

.back-link:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Content ---------- */

.content-panel {
  margin-top: 40px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: oklch(0.175 0.005 240 / 0.82);
  backdrop-filter: blur(10px);
  animation: rise 800ms var(--ease-out-expo) 80ms both;
}

.content-panel + .content-panel {
  margin-top: 16px;
  animation-delay: 160ms;
}

.eyebrow {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 520;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4.6vw, 2.75rem);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}

h2 {
  margin-top: 36px;
  font-size: 1.22rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

p,
li {
  color: var(--body);
  font-size: 1rem;
  line-height: 1.7;
}

p {
  margin-top: 14px;
}

p a,
li a,
dd a {
  color: var(--ink);
  text-decoration-color: var(--cyan);
  text-underline-offset: 3px;
}

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

ul {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 20px;
}

li::marker {
  color: var(--cyan);
}

.lede {
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.6;
}

/* ---------- Cards ---------- */

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.guide-card,
.cta-link {
  position: relative;
  display: block;
  padding: 18px 44px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    transform 320ms var(--ease-out-expo);
}

.guide-card::after,
.cta-link::after {
  content: "→";
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  transition:
    transform 320ms var(--ease-out-expo),
    color 200ms ease;
}

.cta-link {
  margin-top: 22px;
  border-color: oklch(0.78 0.055 225 / 0.45);
  background: oklch(0.28 0.026 225 / 0.45);
}

.guide-card:hover,
.cta-link:hover {
  border-color: var(--cyan);
  background: oklch(0.28 0.026 225 / 0.55);
  transform: translateY(-2px);
}

.guide-card:hover::after,
.cta-link:hover::after {
  color: var(--cyan);
  transform: translateX(4px);
}

.guide-card strong,
.cta-link strong {
  display: block;
  font-size: 1rem;
  font-weight: 620;
}

.guide-card span,
.cta-link span {
  display: block;
  margin-top: 6px;
  color: var(--body);
  font-size: 0.9rem;
  line-height: 1.5;
}

.step-list {
  counter-reset: steps;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.step-list li {
  position: relative;
  padding: 14px 16px 14px 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  counter-increment: steps;
}

.step-list li::before {
  content: counter(steps);
  position: absolute;
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.74rem;
}

/* ---------- Tables, FAQ, notes ---------- */

.mini-table {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
}

.mini-table th,
.mini-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.mini-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 520;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mini-table td {
  color: var(--body);
  line-height: 1.5;
}

.mini-table tbody tr {
  transition: background 160ms ease;
}

.mini-table tbody tr:hover {
  background: oklch(0.21 0.006 240);
}

.faq-list {
  margin-top: 24px;
}

.faq-list dt {
  margin-top: 8px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.faq-list dt:first-child {
  border-top: 0;
}

.faq-list dd {
  margin: 6px 0 0;
  padding-bottom: 8px;
  color: var(--body);
  font-size: 0.94rem;
  line-height: 1.7;
}

.note {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  background: oklch(0.2 0.006 240);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ---------- Search form, byline, footer ---------- */

.byline {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.byline a {
  color: var(--body);
  text-decoration-color: var(--cyan);
  text-underline-offset: 3px;
}

.tool-form {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid oklch(0.78 0.055 225 / 0.45);
  border-radius: 14px;
  background: oklch(0.28 0.026 225 / 0.45);
}

.tool-form label {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.tool-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tool-form input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.tool-form button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 620;
  cursor: pointer;
}

.tool-form input:focus-visible,
.tool-form button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.tool-form-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-scroll {
  overflow-x: auto;
}

.mini-table a {
  color: var(--ink);
  text-decoration-color: var(--cyan);
  text-underline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.site-foot {
  margin-top: 24px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-foot p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: inherit;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.site-foot a {
  display: inline-block;
  padding: 7px 0;
  color: var(--body);
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 12px;
  }

  .legal-topbar {
    top: 8px;
  }

  .back-link {
    min-height: 44px;
    padding: 0 12px;
    letter-spacing: 0.12em;
  }

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

  .mini-table {
    display: block;
    overflow-x: auto;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
