/* Reset, fonts, page grid, atmosphere. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 23px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .3s ease, color .3s ease;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

.sr-only {
  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: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---- type helpers ---- */
.mono {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: normal;
}
.muted { color: var(--text-muted); }
.grad {
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* keep descenders inside the clip box */
  padding-bottom: .06em;
}
.grad--rose { background-image: var(--grad-rose); }
.grad--orange { background-image: var(--grad-orange); }
.grad--amber { background-image: var(--grad-amber); }
.icon { width: 1em; height: 1em; flex: none; }

/* ---- page grid ---- */
main, .footer { position: relative; z-index: 1; }
.wrap {
  width: min(100% - 2 * var(--gutter), 350px);
  margin-inline: auto;
}
section { position: relative; }

/* ---- atmosphere: colour glows the glass blurs ---- */
.atmo {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.glow {
  position: absolute;
  border-radius: 50%;
  opacity: var(--glow-alpha);
  background: radial-gradient(closest-side, rgb(from var(--c) r g b / var(--a)), rgb(from var(--c) r g b / calc(var(--a) * .45)) 45%, transparent);
  transform: translate(-50%, -50%);
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
}
.sky-wash {
  position: absolute; left: 0; right: 0; top: 0; height: 760px;
  background: linear-gradient(180deg, rgb(59 29 143 / .55), rgb(30 17 80 / .25) 55%, transparent);
  pointer-events: none;
}
[data-theme="light"] .sky-wash {
  background: linear-gradient(180deg, rgb(196 181 253 / .38), rgb(221 214 254 / .22) 55%, transparent);
}
.page-clip { position: relative; overflow-x: clip; }

/* Desktop (>= 1024): content 1200 centred. 1024-1239 is zoomed by js/state.js. */
@media (min-width: 1024px) {
  .wrap { width: var(--page); }
  .sky-wash { height: 900px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* page-level glows (Figma "Atmosphere"): centre in design px from the frame centre */
.atmosphere { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.aglow, .pglow {
  position: absolute; border-radius: 50%; pointer-events: none;
  opacity: var(--glow-alpha);
  background: radial-gradient(closest-side, rgb(from var(--c) r g b / var(--a)), rgb(from var(--c) r g b / calc(var(--a) * .5)) 40%, transparent);
  translate: -50% -50%;
}
.aglow { left: calc(50% + var(--mx) * 1px); top: calc(var(--my) * 1px); width: calc(var(--mw) * 1px); height: calc(var(--mh) * 1px); }
.pglow { z-index: 0; left: calc(var(--ox, 0px) + var(--mx) * 1px); top: calc(var(--my) * 1px); width: calc(var(--mw) * 1px); height: calc(var(--mh) * 1px); }
@media (min-width: 1024px) {
  .aglow { left: calc(50% + var(--dx) * 1px); top: calc(var(--dy) * 1px); width: calc(var(--dw) * 1px); height: calc(var(--dh) * 1px); }
  .pglow { left: calc(var(--x) * 1px); top: calc(var(--y) * 1px); width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); }
}

/* 600-1023 (not drawn): the phone layout, given more room */
@media (min-width: 600px) and (max-width: 1023px) {
  .wrap { width: min(100% - 80px, 560px); }
}
