/* Reset, document defaults, typography, and the page shell layout. */

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

html {
  scroll-behavior: smooth;
  /* Sticky header height plus breathing room, so anchors do not land under it. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Faint radial wash keeps the flat charcoal from reading as dead space. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(70rem 40rem at 15% -10%, rgba(56, 189, 248, 0.07), transparent 60%),
    radial-gradient(50rem 35rem at 95% 8%, rgba(52, 211, 153, 0.05), transparent 55%),
    var(--bg-base);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-bright);
  letter-spacing: 0.06em;
  line-height: 1.25;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--cyan-bright);
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

pre {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--cyan);
  color: var(--bg-void);
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-deep);
}

/* Visually hidden but available to screen readers and in-page search. */
.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;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--gap-md);
  z-index: 200;
  padding: 0.5rem 0.9rem;
  background: var(--cyan);
  color: var(--bg-void);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease-out);
}

.skip-link:focus {
  top: var(--gap-sm);
}

/* --- Page shell --------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding-inline: var(--shell-pad);
}

main.shell {
  flex: 1 0 auto;
  position: relative;
  z-index: 10;
  padding-block: clamp(2rem, 1.5rem + 3vw, 4rem) var(--gap-xl);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-xl) var(--gap-lg);
}

@media (min-width: 62rem) {
  .layout {
    grid-template-columns: 19rem minmax(0, 1fr);
    align-items: start;
  }

  .col-side {
    position: sticky;
    top: 5.5rem;
  }
}

.col-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  min-width: 0;
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
  min-width: 0;
}

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

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