/* ==========================================================================
   IGNC — Reset, typography, helpers
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: var(--c-blue-600);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}

a:hover {
  color: var(--c-violet-500);
}

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

/* --- Headings ------------------------------------------------------------ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
}
h4 {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

/* The reset zeroes all margins, so prose spacing is reintroduced only
   between consecutive paragraphs — components keep their own rhythm. */
p + p {
  margin-top: 1.05rem;
}

.lead + p {
  margin-top: 1.3rem;
}

strong {
  font-weight: 700;
  color: var(--text);
}

blockquote {
  margin: 0;
}

::selection {
  background: var(--c-violet-500);
  color: #fff;
}

/* --- Focus --------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--c-gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: var(--z-top);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--c-blue-700);
  color: #fff;
  font-weight: 600;
  transition: top var(--t-med) var(--ease-out);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* --- Layout helpers ------------------------------------------------------ */

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

.container--narrow {
  max-width: var(--maxw-narrow);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--alt {
  background: var(--bg-alt);
}

.section--night {
  background: var(--grad-night);
  color: #e8ecff;
}

.section--night h2,
.section--night h3,
.section--night h4 {
  color: #fff;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.grid {
  display: grid;
  gap: clamp(1.15rem, 0.6rem + 1.6vw, 2rem);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.center {
  text-align: center;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-soft);
  line-height: 1.68;
}

.muted {
  color: var(--text-muted);
}

.section--night .lead,
.section--night .muted,
.section--night p {
  color: #b9c2ea;
}

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

/* Gradient text for emphasised words in headings. Every current use sits on
   a --grad-night background, so the default is the brightened ramp; use
   .grad-text--ink on white/light surfaces. */
.grad-text {
  background: var(--grad-brand-light);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.grad-text--ink {
  background-image: var(--grad-brand-ink);
}

.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
