/*
 * base.css: reset, typography, shell and controls.
 * Page-wide rules only. Widgets live in components.css, and the
 * composition of each band of the page lives in sections.css.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The sticky masthead would otherwise clip anchored headings. */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--face-sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ---- Headings -------------------------------------------------
 * The serif is the brand's voice, so headings are set in it at a
 * tight measure and tight leading. Weight does the work; no single
 * word is ever accented in a different colour or style.
 */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--face-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); line-height: 0.98; letter-spacing: -0.028em; }
h2 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.024em; }
h3 { font-size: var(--step-2); line-height: 1.12; }
h4 { font-size: var(--step-1); line-height: 1.2;  font-weight: 600; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

/* The lede voice: the serif at reading size, for ledes, the mission
 * statement and anything that should sound like a person. */
.read {
  font-family: var(--face-display);
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.52;
  color: var(--bone-dim);
}
.read-sm { font-size: var(--step-0); line-height: 1.6; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

/* The parts of the page the browser draws by default still belong to
 * the design: selection, caret, form accents and the scrollbar. */
::selection { background: var(--gold); color: var(--ink); }
html { caret-color: var(--gold); accent-color: var(--gold); scrollbar-color: var(--ink-line) var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink-line); border-radius: 99px; border: 3px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }
.field-gold ::selection { background: var(--ink); color: var(--gold); }

/* Figures that sit in columns align on the digit, not the glyph. */
.tabular { font-variant-numeric: tabular-nums; }

/* ---- Shell ---------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Gold fields invert the page, mirroring the black-on-yellow logo.
 * Declaring the inversion once keeps children readable without
 * per-element overrides. */
.field-gold {
  background: var(--gold);
  color: var(--ink);
  background-image:
    radial-gradient(118% 88% at 8% 0%, var(--gold-lift) 0%, transparent 56%),
    radial-gradient(100% 118% at 100% 100%, var(--gold-deep) 0%, transparent 52%);
}
.field-gold .read { color: color-mix(in srgb, var(--ink) 78%, transparent); }
.field-gold a { color: var(--ink); }

.field-raised { background: var(--ink-raised); }

/* ---- Rules ----------------------------------------------------
 * A hairline that carries the yellow only where a section begins,
 * so it reads as a seam rather than a decorative stripe.
 */
.seam {
  border: 0;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, var(--gold) 0%, var(--ink-line) 32%, var(--ink-line) 100%);
}
.field-gold .seam {
  background: linear-gradient(90deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 20%, transparent) 38%, transparent 100%);
}

/* ---- Lockup ---------------------------------------------------
 * The logo set in live type: POWER in tracked roman caps, &Precision
 * in bold, PHYSIOTHERAPY in the widely tracked geometric sans. Used
 * by the masthead and the preloader so both match the printed mark
 * without waiting on an image to load.
 */
.lockup { display: grid; justify-items: start; line-height: 1; }
.lockup .lock-1 {
  font-family: var(--face-display);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lockup .lock-2 {
  font-family: var(--face-display);
  font-weight: 800;
  letter-spacing: -0.005em;
  margin-top: 0.06em;
}
.lockup .lock-3 {
  font-family: var(--face-sans);
  font-weight: 300;
  letter-spacing: var(--track-lockup);
  text-transform: uppercase;
  margin-top: 0.5em;
}
.lockup-center { justify-items: center; text-align: center; }

/* ---- Controls -------------------------------------------------
 * Button labels name the thing that happens. No appended arrows:
 * the verb already carries the direction.
 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--face-sans);
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--fast) var(--ease-out),
              background-color var(--fast) var(--ease-out),
              color var(--fast) var(--ease-out),
              border-color var(--fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--gold); color: var(--ink); font-weight: 600; }
.btn-primary:hover { background: var(--gold-lift); }

.btn-ghost { background: transparent; color: var(--bone); border-color: var(--ink-line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.field-gold .btn-primary { background: var(--ink); color: var(--gold); }
.field-gold .btn-primary:hover { background: var(--ink-raised); }
.field-gold .btn-ghost { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 36%, transparent); }
.field-gold .btn-ghost:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ---- Focus ----------------------------------------------------
 * A ring that survives both the black and the yellow ground.
 */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.field-gold :focus-visible { outline-color: var(--ink); }

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

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -140%);
  z-index: 200;
  padding: 0.85rem 1.4rem;
  background: var(--gold); color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }
