/* Base layout, reset, typography. */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark light;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-feature-settings: "ss01", "cv11", "tnum";
  min-height: 100vh;
}

.mono,
.num,
.tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-colour);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

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

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

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

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--text);
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  background: var(--accent);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--t-fast) var(--easing);
  z-index: 100;
}

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

/* Page shell */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, var(--accent-strong), var(--accent) 60%, #3B1D80 110%);
  box-shadow: 0 0 0 1px var(--border), 0 4px 14px rgba(167, 139, 250, 0.25);
}

.brand__name {
  font-size: var(--step-md);
  letter-spacing: 0.01em;
}

.brand__name span {
  color: var(--text-secondary);
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav a {
  color: var(--text-secondary);
  font-size: var(--step-sm);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

main {
  flex: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
  width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
  color: var(--text-secondary);
  font-size: var(--step-sm);
}

.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: var(--space-3);
}

.site-footer a:hover {
  color: var(--text);
}

/* Hero */

.hero {
  padding: var(--space-5) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--step-xs);
  color: var(--accent-strong);
  background: var(--accent-faint);
  border: 1px solid var(--accent-muted);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

.hero h1 {
  font-size: var(--fs-display);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-3);
  max-width: 26ch;
}

.hero__lede {
  max-width: 60ch;
  font-size: var(--fs-h3);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
}

.hero__lede strong {
  color: var(--text);
  font-weight: var(--fw-medium);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-top: var(--space-5);
}

@media (max-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero__aside {
  display: grid;
  gap: var(--space-3);
}

/* Section spacing */

section[aria-labelledby] {
  margin-bottom: var(--space-7);
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section__header p {
  margin: 0;
  font-size: var(--step-sm);
  color: var(--text-tertiary);
  max-width: 56ch;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-5);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

@media (max-width: 960px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Credits */

.credits {
  margin-top: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface);
}

.credits summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.credits[open] summary {
  margin-bottom: var(--space-3);
}

.credits ul {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text-secondary);
}
