/* CATO site. Faceted orange crystal, blue used only like CATO's eyes and core. */

:root {
  color-scheme: light dark;

  --orange: #E8701A;
  --copper: #8A3A0E;
  --amber: #F59A3C;
  --blue: #1E8BFF;

  --bg: #ECECEE;
  --surface: #F6F6F7;
  --text: #16161A;
  --muted: #4A4A52;
  --line: rgba(232, 112, 26, 0.55);
  --rule: rgba(22, 22, 26, 0.12);
  --facet: #16161A;
  --facet-opacity: 0.045;
  --heading-accent: var(--copper);
  --link: #0B6BD6;          /* the electric blue, darkened for 4.5:1 on light gray */
  --glow: 0;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 68ch;
  --chamfer: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F12;
    --surface: #17171B;
    --text: #EDEBE7;
    --muted: #A8A6A2;
    --line: rgba(232, 112, 26, 0.6);
    --rule: rgba(237, 235, 231, 0.12);
    --facet: #F59A3C;
    --facet-opacity: 0.05;
    --heading-accent: var(--amber);
    --link: #5AA9FF;
    --glow: 1;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Low-poly pattern behind everything, very low contrast. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--facet);
  opacity: var(--facet-opacity);
  -webkit-mask: url("/assets/facets.svg") 0 0 / 480px 480px repeat;
          mask: url("/assets/facets.svg") 0 0 / 480px 480px repeat;
  pointer-events: none;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.125rem; letter-spacing: 0.06em;
}
.brand:hover { text-decoration: none; }

.mark { position: relative; width: 34px; height: 34px; flex: none; }
.mark img { width: 100%; height: 100%; display: block; }
/* Blue glow sitting on the mark's core. */
.mark::after {
  content: "";
  position: absolute;
  left: 51%; top: 50%;
  width: 34%; height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 139, 255, 0.9), rgba(30, 139, 255, 0) 70%);
  opacity: calc(0.35 + 0.35 * var(--glow));
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mark::after { animation: core 4.5s ease-in-out infinite; }
}
@keyframes core {
  0%, 100% { opacity: calc(0.2 + 0.25 * var(--glow)); }
  50%      { opacity: calc(0.6 + 0.35 * var(--glow)); }
}

.site-nav { display: flex; gap: 22px; font-size: 0.9375rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--orange); }

main { flex: 1; }

/* ---------- Hero ---------- */

.hero { padding: 56px 0 32px; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 40px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(4.5rem, 12vw, 8.5rem);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.hero .tagline {
  margin: 22px 0 0;
  max-width: 30ch;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  line-height: 1.4;
  color: var(--muted);
}
.hero .tagline strong { display: block; color: var(--heading-accent); font-weight: 600; }
.hero .rule { width: 64px; height: 3px; margin-top: 28px; background: var(--blue); }

.portrait { position: relative; justify-self: center; width: 100%; max-width: 440px; }
.portrait::before {
  content: "";
  position: absolute;
  inset: 12% 6% 6%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(232, 112, 26, calc(0.18 + 0.14 * var(--glow))), transparent);
}
.portrait img { display: block; width: 100%; height: auto; }

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

.section { padding: 24px 0 64px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.card {
  position: relative;
  padding: 28px 28px 24px;
  isolation: isolate;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)),
                     calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  background: var(--line);
}
/* 1px "border" that follows the chamfer: the card is the border color, this is the fill. */
.card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--surface);
  clip-path: polygon(calc(var(--chamfer) - 0.4px) 0, 100% 0, 100% calc(100% - var(--chamfer) + 0.4px),
                     calc(100% - var(--chamfer) + 0.4px) 100%, 0 100%, 0 calc(var(--chamfer) - 0.4px));
}
.card h2 {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--heading-accent);
}
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

.access { list-style: none; margin: 0; padding: 0; }
.access li { padding: 12px 0; border-top: 1px solid var(--rule); }
.access li:first-child { border-top: 0; padding-top: 2px; }
.access b { display: block; font-weight: 600; }
.access span { color: var(--muted); font-size: 0.9688rem; }
.tag {
  display: inline-block; margin-left: 6px; padding: 0 7px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; vertical-align: 2px;
  color: var(--muted); border: 1px solid var(--rule);
}

.links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 32px; font-weight: 500; }

/* ---------- Policy pages ---------- */

.doc { padding: 48px 0 72px; }
.doc .wrap { max-width: calc(var(--measure) + 40px); }
.doc h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.doc .meta { margin: 10px 0 36px; color: var(--muted); font-size: 0.9375rem; }
.doc h2 {
  margin: 40px 0 10px;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.doc h2 .n { color: var(--heading-accent); font-variant-numeric: tabular-nums; margin-right: 8px; }
.doc p, .doc ul { margin: 0 0 14px; }
.doc ul { padding-left: 1.25em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--orange); }
.doc code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.doc blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--orange);
  background: var(--surface);
}
.doc blockquote p { margin: 0; }
.doc .summary { font-size: 1.125rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 22px; padding-bottom: 28px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 0; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }
.site-footer nav a + a::before { content: "·"; margin: 0 10px; color: var(--muted); display: inline-block; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .site-nav { gap: 16px; }
  .hero { padding: 24px 0 8px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 8px; }
  .portrait { order: -1; max-width: 240px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 22px 20px 18px; }
  .doc { padding-top: 32px; }
}
