/* ============================================================
   The Cake Studio — Base layer
   Reset, defaults, container, accessibility helpers,
   and shared typographic primitives that compose into components.
   ============================================================ */

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

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

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

figure { margin: 0; }

ul, ol { list-style: none; padding: 0; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
input, button, select, textarea { font: inherit; }

/* ---------- Display headings (Newsreader serif) ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  font-optical-sizing: auto;
}

h1 { font-size: var(--font-size-5xl); line-height: var(--line-height-tight); letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-lg); font-family: var(--font-family-body); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-normal); }
h5 { font-size: var(--font-size-md); font-family: var(--font-family-body); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-normal); }

/* Inline links inside body copy */
.prose a,
a.text-link {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-standard);
}
.prose a:hover,
a.text-link:hover { color: var(--text-link-hover); }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: calc(var(--z-sticky) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-canvas);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  transition: top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus { top: var(--space-4); }

:focus { outline: 0; }
:focus-visible {
  outline: var(--border-width-thick) solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Layout container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}
.container--narrow {
  max-width: var(--container-narrow);
}

/* ---------- Typographic primitives ---------- */
/* Eyebrow — small uppercase label above headings or values */
.eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-4);
  font-family: var(--font-family-body);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow--muted { color: var(--text-muted); }
.eyebrow strong {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wider);
  color: var(--text-primary);
}

/* Rail label — vertical micro-label in section gutters */
.rail-label {
  position: absolute;
  left: -8px;
  top: var(--space-9);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-family-body);
  font-size: var(--font-size-2xs);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.rail-label::before {
  content: "";
  display: block;
  width: var(--border-width-thin);
  height: var(--space-7);
  margin: 0 auto var(--space-3);
  background: var(--accent);
}

/* Inline arrow link — for section-head "VIEW ALL →" affordances */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-family-body);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  transition: gap var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.link-arrow:hover { color: var(--accent-hover); gap: var(--space-3); }

/* Lead paragraph — used immediately under page H1 */
.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  color: var(--text-secondary);
  max-width: 60ch;
}

/* Section head pattern — title + optional link-arrow on the right.
   ---------------------------------------------------------------
   USE WHEN: the section below has SYMMETRIC content (a 3-up card grid,
   a 4-up grid, a centred narrow text block). The link-arrow on the
   right naturally aligns with the cards/content underneath.
   AVOID WHEN: the section below is an asymmetric text-vs-image two
   column grid. The link-arrow ends up floating in the empty quadrant
   above the image, with no visual anchor. Instead, put the eyebrow
   and h2 INSIDE the text column of the grid — see the Roora feature
   band on the homepage for the correct pattern.                       */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.section-head h2 { max-width: 28ch; }
