/* Reset, page backdrop, typography, layout primitives */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--space-7));
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: clip;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Backdrop for the glass: faint architectural dot grid plus soft colour fields.
   Fixed, so cards blur whatever drifts behind them. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(29, 29, 31, 0.14) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 25%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 25%, #000 0%, transparent 72%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40rem 30rem at 92% 62%, rgba(var(--glow-rgb), 0.12), transparent 70%),
    radial-gradient(38rem 30rem at 4% 78%, rgba(var(--silver-rgb), 0.15), transparent 70%);
  pointer-events: none;
}

h1,
h2,
h3,
p,
dl,
dd,
figure,
ul,
ol,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

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

::selection {
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--pill);
}

.skip-link:focus {
  top: var(--space-3);
}

/* Type scale */
.t-display,
.hero__title {
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  padding-bottom: 0.08em;
  hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, #1d1d1f 40%, #3d5775 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__title {
  font-size: clamp(2.25rem, 7vw, 5.25rem);
}

.t-h2,
.section__title {
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.t-h3,
.bento__title,
.principle__title {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.t-lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--text-muted);
}

.t-mono {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--step--1);
}

.prose {
  max-width: 40rem;
}

.prose > * + * {
  margin-top: var(--space-5);
}

/* Spec lists: definition lists for technical facts */
.spec {
  display: grid;
  gap: var(--space-3);
  font-size: var(--step--1);
}

.spec > div {
  display: grid;
  gap: var(--space-1);
}

.spec dt {
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
}

.spec dd {
  color: var(--ink);
  font-weight: 500;
}

.spec a {
  text-underline-offset: 0.2em;
}

/* Sections */
/* Apple-scale vertical rhythm */
.section {
  padding-block: clamp(5rem, 10vw, 9rem);
}

.section__title {
  max-width: 20ch;
  margin-bottom: var(--space-7);
}

/* Scroll reveal. Only hidden when JS is running, so the page works without it. */
.js [data-reveal] {
  opacity: 0.6;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* After the entrance, only hover/press transitions remain, with no delay */
.js [data-reveal].is-settled {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  transition-delay: 0s;
}

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
