/* ============ base.css — theme + fluid foundation ============ */
:root {
  /* colors */
  --color-highlight: #ffe867;
  --color-bg: #ffffff;
  --color-bg-page: #fafafa;
  --color-text: #1f1f1f;
  --color-text-muted: #777;
  --color-border: #e5e5e5;
  --color-primary: #082ed1;
  --color-primary-hover: #0625a5;

  /* graph paper identity */
  --graph-major: rgba(0, 0, 0, 0.04);
  --graph-minor: rgba(0, 0, 0, 0.015);

  /* fonts */
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* FLUID TYPE SCALE — glides from 320px to 1600px+ */
  --text-sm: clamp(0.875rem, 0.86rem + 0.1vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.18vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.08rem + 0.3vw, 1.3125rem);
  --text-xl: clamp(1.25rem, 1.18rem + 0.45vw, 1.5625rem);
  --text-2xl: clamp(1.5rem, 1.38rem + 0.75vw, 2.0625rem);
  --text-3xl: clamp(1.875rem, 1.66rem + 1.3vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.9rem + 2.2vw, 4rem);

  /* FLUID SPACING SCALE — sections breathe more on big screens */
  --space-xs: clamp(0.5rem, 0.48rem + 0.12vw, 0.625rem);
  --space-sm: clamp(0.75rem, 0.72rem + 0.2vw, 1rem);
  --space-md: clamp(1.25rem, 1.18rem + 0.4vw, 1.75rem);
  --space-lg: clamp(2rem, 1.85rem + 0.9vw, 3rem);
  --space-xl: clamp(3rem, 2.7rem + 1.8vw, 5rem);
  --space-2xl: clamp(4.5rem, 4rem + 3.5vw, 8rem);

  /* layout */
  --gutter: clamp(1.25rem, 4vw, 2.5rem); /* fluid side padding */
  --container-max: 65rem;
  --nav-h: 3rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  background-image:
    linear-gradient(var(--graph-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--graph-major) 1px, transparent 1px),
    linear-gradient(var(--graph-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--graph-minor) 1px, transparent 1px);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
  background-attachment: fixed;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
}

/* Variant A (recommended): two-tone + highlighter swipe */
.brand-py {
  color: var(--color-primary);
}
.brand-maths {
  color: var(--color-text);
  padding: 0 0.12em;
  background: linear-gradient(
    to bottom,
    transparent 58%,
    var(--color-highlight) 58%,
    var(--color-highlight) 94%,
    transparent 94%
  );
}

.brand--boxed .brand-py {
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  padding: 0.08em 0.32em;
  margin-right: 0.18em;
}
.brand--boxed .brand-maths {
  background: none;
  color: var(--color-text);
}

/* Typography — balance prevents ragged headline lines */
/* HEADINGS — flat, weight 700, no shadow */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
  text-shadow: none; /* ← kill any inherited shadow */
}
h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-xl);
}
p {
  color: var(--color-text-muted);
  text-wrap: pretty;
  text-shadow: none;
}
/* FLUID CONTAINER — no media query needed for padding */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container-max));
  margin-inline: auto;
}

/* Global polish */
::selection {
  background: var(--color-primary);
  color: var(--color-bg);
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  padding: 0.875em 1.375em; /* ≈ 14px × 22px → ~43px tall */
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}
.btn-lg {
  font-size: 1.0625rem;
  padding: 1em 1.75em;
} /* hero only */

.link-arrow {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.875em 0.25em;
  transition: color 0.2s ease;
}
.link-arrow:hover {
  color: var(--color-primary);
}

/* Accessibility: respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
