/* =============================================================================
   stjnet.org: Brendan Williams, professional site
   Styles

   Contents
     1. Design tokens (light, dark, high contrast)
     2. Base elements
     3. Layout helpers
     4. Navigation and hero
     5. Sections and tiles
     6. Section: The difference it makes (stats)
     7. Section: What I love to do (features)
     8. Section: Recent highlights (carousel)
     9. Section: How I got here (career timeline)
    10. Pills (credentials and toolbox)
    11. Sections: Certified by Epic and My toolbox
    12. Connect band and footer
    13. Motion (scroll-in, counters, graphics)
    14. User preferences (reduced motion, transparency, contrast)

   Accessibility targets: WCAG 2.2 level AAA
     - Text contrast 7:1 (4.5:1 for large text) in light and dark mode
     - Minimum text size 15px; body text 17px with 1.5 line spacing
     - Every control at least 44 by 44 points
   ========================================================================== */


/* 1. Design tokens ---------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Surfaces and text */
  --bg: #ffffff;            /* page background */
  --field: #f5f5f7;         /* gray bands */
  --tile: #ffffff;          /* tiles on gray bands */
  --tile-alt: #f5f5f7;      /* tiles on white bands */
  --chip-base: #ffffff;     /* base that tinted pills mix into on white bands */
  --ink: #1d1d1f;           /* primary text */
  --muted: #505054;         /* secondary text, 7:1 on --field */
  --line: #d2d2d7;          /* hairlines */

  /* Actions */
  --link: #0054b0;          /* links, 7:1 on white */
  --btn: #0071e3;           /* Apple blue; button text is large and bold */
  --btn-hover: #0077ed;
  --btn-ink: #ffffff;

  /* Apple system colors, used for icons and graphics (non-text) */
  --g-blue: #0a84ff;
  --g-indigo: #5e5ce6;
  --g-purple: #bf5af2;
  --g-pink: #ff375f;
  --g-orange: #ff9f0a;
  --g-green: #30d158;
  --g-teal: #40c8e0;
  --g-gray: #8e8e93;

  /* Deeper versions of the system colors, for small text (7:1) */
  --t-blue: #004796;
  --t-purple: #6a1fa0;
  --t-pink: #9e1430;
  --t-orange: #713a00;
  --t-green: #0d5321;
  --t-teal: #06535b;

  /* Headline gradient (large text, 4.5:1) */
  --grad-1: #0066cc;
  --grad-2: #8a35c4;
  --grad-3: #c81e45;

  /* Glass material for navigation and controls */
  --glass: rgba(255, 255, 255, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-line: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);

  --glow-strength: 0.35;

  /* Type */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Shape and spacing */
  --radius-card: 28px;      /* Apple product-page cards */
  --radius-card-sm: 20px;   /* the same cards on phones */
  --radius-pill: 980px;
  --content: 980px;         /* one content column for every section */
  --gutter: max(22px, env(safe-area-inset-left, 0px));
  --section-pad: clamp(56px, 8vw, 96px);
}

/* Dark mode follows the device unless the page sets data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --field: #000000; --tile: #1d1d1f; --tile-alt: #1d1d1f; --chip-base: #2c2c2e;
    --ink: #f5f5f7; --muted: #bdbdc2; --line: #424245;
    --link: #7cc0ff;
    --t-blue: #8ac8ff; --t-purple: #e0a8ff; --t-pink: #ff9cb0; --t-orange: #ffc078; --t-green: #6ee79a; --t-teal: #7ddcea;
    --grad-1: #4aa3ff; --grad-2: #c67af5; --grad-3: #ff6f8a;
    --glass: rgba(36, 36, 38, 0.72); --glass-edge: rgba(255, 255, 255, 0.14); --glass-line: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
    --glow-strength: 0.32;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --field: #000000; --tile: #1d1d1f; --tile-alt: #1d1d1f; --chip-base: #2c2c2e;
  --ink: #f5f5f7; --muted: #bdbdc2; --line: #424245;
  --link: #7cc0ff;
  --t-blue: #8ac8ff; --t-purple: #e0a8ff; --t-pink: #ff9cb0; --t-orange: #ffc078; --t-green: #6ee79a; --t-teal: #7ddcea;
  --grad-1: #4aa3ff; --grad-2: #c67af5; --grad-3: #ff6f8a;
  --glass: rgba(36, 36, 38, 0.72); --glass-edge: rgba(255, 255, 255, 0.14); --glass-line: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  --glow-strength: 0.32;
}


/* 2. Base elements ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;           /* keeps anchors and focus clear of the sticky nav */
  scroll-padding-bottom: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font-text);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

h1, h2, h3 { text-wrap: balance; }
p { max-width: 65ch; }


/* 3. Layout helpers --------------------------------------------------------- */

.wrap {
  max-width: calc(var(--content) + 2 * 22px);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(22px, env(safe-area-inset-right, 0px));
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 12px; background: var(--bg); color: var(--ink);
}
.skip:focus { left: 16px; }


/* 4. Navigation and hero ---------------------------------------------------- */

/* Sticky glass bar, like apple.com */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--glass-line);
}
.site-nav .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.site-nav .brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font: 600 1rem/1 var(--font-display); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 0; padding: 0; list-style: none; }
.site-nav ul a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink); font-size: 0.9375rem; }

.hero {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding-block: clamp(64px, 11vw, 128px) clamp(48px, 7vw, 80px);
}

/* Soft color fields behind the headline (decorative) */
.glow { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none; filter: blur(60px); opacity: var(--glow-strength); }
.glow i { position: absolute; width: 38vw; height: 38vw; min-width: 240px; min-height: 240px; max-width: 520px; max-height: 520px; border-radius: 50%; }
.glow i:nth-child(1) { left: 8%;  top: 18%; background: radial-gradient(circle, var(--g-blue), transparent 65%); }
.glow i:nth-child(2) { left: 38%; top: 4%;  background: radial-gradient(circle, var(--g-purple), transparent 65%); }
.glow i:nth-child(3) { right: 6%; top: 22%; background: radial-gradient(circle, var(--g-pink), transparent 65%); }

/* Profile photo inside a color ring */
.portrait {
  width: 136px; height: 136px; margin: 0 auto 28px; padding: 4px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--g-blue), var(--g-indigo), var(--g-purple), var(--g-pink), var(--g-orange), var(--g-green), var(--g-blue));
}
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--bg); background: var(--field); }

.hero h1 { margin: 0; font: 700 clamp(2.75rem, 8vw, 5rem)/1.05 var(--font-display); letter-spacing: -0.015em; }
.grad {
  background-image: linear-gradient(90deg, var(--grad-1), var(--grad-2) 55%, var(--grad-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  max-width: 38ch; margin: 20px auto 0; color: var(--muted);
  font: 500 clamp(1.2rem, 2.6vw, 1.75rem)/1.5 var(--font-display); letter-spacing: 0.004em; text-wrap: balance;
}
.ctas { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; margin-top: 32px; }

/* Apple pill button. 19px bold counts as large text, so Apple blue passes AAA. */
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 11px 22px; border-radius: var(--radius-pill);
  background: var(--btn); color: var(--btn-ink); font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.05rem; }
.more::after { content: "›"; margin-left: 0.25em; }


/* 5. Sections and tiles ----------------------------------------------------- */

.band { padding-block: var(--section-pad); scroll-margin-top: 56px; }
.band-gray { background: var(--field); }
.band-white { background: var(--bg); }

.section-title { margin: 0 0 8px; text-align: center; font: 700 clamp(2rem, 5vw, 3rem)/1.08 var(--font-display); }
.lede { max-width: 44ch; margin: 0 auto 40px; text-align: center; color: var(--muted); font-size: 1.2rem; line-height: 1.5; text-wrap: balance; }

/* Six-column grid for tiles of different sizes */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-6 { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-6 { grid-column: auto; }
}

/* A tile picks its accent with a color class. --c is the vivid color for icons,
   --ck is the deeper color for small text on that tile. */
.tile {
  --c: var(--g-blue); --ck: var(--t-blue); --pill-base: var(--tile);
  position: relative; min-width: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 36px 32px; border-radius: var(--radius-card); background: var(--tile);
}
.band-white .tile { background: var(--tile-alt); --pill-base: var(--chip-base); }
.c-purple { --c: var(--g-purple); --ck: var(--t-purple); }
.c-green  { --c: var(--g-green);  --ck: var(--t-green); }
.c-orange { --c: var(--g-orange); --ck: var(--t-orange); }
.c-pink   { --c: var(--g-pink);   --ck: var(--t-pink); }
.c-teal   { --c: var(--g-teal);   --ck: var(--t-teal); }
.c-gray   { --c: var(--g-gray);   --ck: var(--muted); }

.tile h3 { margin: 0; font: 700 1.25rem/1.25 var(--font-display); }
.tile p { margin: 0; color: var(--muted); line-height: 1.5; }
.sym { width: 40px; height: 40px; flex: none; color: var(--c); }

@media (max-width: 640px) {
  .tile { padding: 28px 22px; border-radius: var(--radius-card-sm); }
}


/* 6. Section: The difference it makes ------------------------------------- */

.stat { justify-content: flex-start; }
.stat .viz { display: flex; align-items: center; height: 72px; margin-bottom: 8px; }
.stat .glyph { width: auto; height: 64px; }
.stat .chart { width: 100%; max-width: 232px; height: 64px; overflow: visible; }
.stat .big { display: block; margin: 20px 0 0; color: var(--ink); font: 700 clamp(3rem, 7vw, 4.5rem)/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .what { max-width: 22ch; margin-top: 4px; color: var(--ink); font: 600 1.15rem/1.3 var(--font-display); }
.stat .src { font-size: 0.9375rem; }
.chart-axis { stroke: var(--line); }


/* 7. Section: What I love to do ------------------------------------------- */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.features .tile { padding: 32px 28px; }
.features .sym { margin-bottom: 6px; }


/* 8. Section: Recent highlights (carousel) --------------------------------- */

.carousel { width: min(var(--content), calc(100% - 2 * 22px)); margin-inline: auto; }

.carousel-track {
  display: flex; gap: 20px; margin: 0; padding: 8px 0 24px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  border-radius: var(--radius-card);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 3px solid var(--link); outline-offset: -3px; }

/* Each card sits on its own layer so autoplay scrolls smoothly */
.slide {
  --c: var(--g-blue); --ck: var(--t-blue);
  flex: 0 0 min(82%, 400px); display: flex; flex-direction: column; overflow: hidden;
  scroll-snap-align: start; border-radius: var(--radius-card); background: var(--tile);
  transform: translateZ(0); backface-visibility: hidden; contain: paint;
}
.slide-art { position: relative; height: 200px; display: grid; place-items: center; overflow: hidden; }
.slide-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 55%); }
.slide-art svg { position: relative; z-index: 1; width: 88px; height: 88px; color: #ffffff; }
.art-1 { background: linear-gradient(135deg, var(--g-indigo), var(--g-purple)); }
.art-2 { background: linear-gradient(135deg, var(--g-pink), var(--g-orange)); }
.art-3 { background: linear-gradient(135deg, var(--g-green), var(--g-blue)); }
.art-4 { background: linear-gradient(135deg, var(--g-blue), var(--g-indigo)); }
.art-5 { background: linear-gradient(135deg, var(--g-orange), var(--g-pink)); }
.art-6 { background: linear-gradient(135deg, #64d2ff, var(--g-green)); }
.slide-body { display: grid; gap: 6px; padding: 24px 28px 30px; }
.slide .kicker { margin: 0; color: var(--ck); font-size: 0.9375rem; font-weight: 600; }
.slide h3 { margin: 0; font: 700 1.45rem/1.15 var(--font-display); }
.slide-body p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) {
  .carousel-track, .slide { border-radius: var(--radius-card-sm); }
}

/* Controls live in one floating glass capsule */
.carousel-ui {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: max-content; max-width: 100%; margin: 12px auto 0; padding: 6px;
  border-radius: var(--radius-pill); border: 1px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge);
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.play-btn .icon-pause { display: none; }
.play-btn.is-playing .icon-pause { display: block; }
.play-btn.is-playing .icon-play { display: none; }

/* Dots: the current one is a pill that fills while autoplay counts down */
.dots { display: flex; }
.dots button { display: grid; place-items: center; min-width: 28px; height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer; }
.dots .bar { position: relative; display: block; width: 8px; height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 30%, transparent); transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.dots .fill { position: absolute; inset: 0; width: 0; border-radius: inherit; background: var(--ink); }
.dots [aria-current="true"] .bar { width: 36px; background: var(--ink); }
.carousel.is-playing .dots [aria-current="true"] .bar { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.carousel.is-playing .dots [aria-current="true"] .fill { animation: dot-fill 10s linear forwards; }
.carousel.is-playing.is-paused .dots [aria-current="true"] .fill { animation-play-state: paused; }
@keyframes dot-fill { from { width: 0; } to { width: 100%; } }

@media (max-width: 400px) {
  .carousel-ui { gap: 2px; padding: 4px; }
  .dots button { min-width: 24px; padding: 0 4px; }
  .dots [aria-current="true"] .bar { width: 28px; }
}
@media (max-width: 360px) {
  .carousel-ui { flex-wrap: wrap; border-radius: 26px; }
}


/* 9. Section: How I got here ---------------------------------------------- */

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); transform-origin: top; }
.timeline > li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 20px; padding-bottom: 40px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline .dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 2px solid var(--line); background: var(--tile); color: var(--g-blue);
}
.timeline .dot svg { width: 22px; height: 22px; }
.timeline .is-current .dot { background: var(--btn); border-color: var(--btn); color: #ffffff; }
.timeline .when { margin: 6px 0 2px; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.timeline h3 { margin: 0; font: 700 1.35rem/1.25 var(--font-display); }
.timeline .org { margin: 2px 0 10px; color: var(--muted); }
.timeline ul { max-width: 68ch; margin: 0; padding-left: 1.2em; }
.timeline ul li { line-height: 1.5; }
.timeline ul li + li { margin-top: 6px; }


/* 10. Pills ----------------------------------------------------------------- */

.chips, .legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chips li, .chip {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius-pill);
  font-size: 0.9375rem; font-weight: 500; line-height: 1.35;
  /* Pills sit in a wrapping flex row, so each stays on one line and only breaks
     if it is wider than the whole tile (very large text, or extra text spacing). */
}
.chip { padding: 8px 16px; font-weight: 600; }
.legend { justify-content: center; gap: 12px; margin: -16px auto 32px; }

/* Credential types, strongest to weakest (key chips) */
.chip.pill-cert  { background: color-mix(in srgb, var(--g-blue) 6%, var(--tile));    color: var(--t-blue);   border: 2px solid var(--g-blue); font-weight: 700; padding: 7px 15px; }
.chip.pill-accr  { background: color-mix(in srgb, var(--g-purple) 18%, var(--tile)); color: var(--t-purple); font-weight: 600; }
.chip.pill-badge { background: color-mix(in srgb, var(--g-green) 18%, var(--tile));  color: var(--t-green); }
.chip.pill-past  { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); }

/* Skills are filled and tools are outlined, both in the tile's color */
.chip.pill-skill { background: color-mix(in srgb, var(--c) 10%, var(--pill-base)); color: var(--ck); font-weight: 600; }
.chip.pill-tool  { background: transparent; color: var(--ck); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }

/* The toolbox key is neutral: it explains the shape, not a color */
.legend .key-skill { background: color-mix(in srgb, var(--ink) 9%, var(--bg)); color: var(--ink); }
.legend .key-tool  { background: transparent; color: var(--ink); border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); }

/* The same styles applied to every pill in a list */
.chips.pill-cert li  { background: color-mix(in srgb, var(--g-blue) 6%, var(--tile));    color: var(--t-blue);   border: 2px solid var(--g-blue); font-weight: 700; padding: 8px 15px; }
.chips.pill-accr li  { background: color-mix(in srgb, var(--g-purple) 18%, var(--tile)); color: var(--t-purple); font-weight: 600; }
.chips.pill-badge li { background: color-mix(in srgb, var(--g-green) 18%, var(--tile));  color: var(--t-green); }
.chips.pill-past li  { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); }
.chips.pill-skill li { background: color-mix(in srgb, var(--c) 10%, var(--pill-base)); color: var(--ck); font-weight: 600; }
.chips.pill-tool li  { background: transparent; color: var(--ck); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }



/* 11. Sections: Certified by Epic and My toolbox ----------------------------- */

/* Shared tile header: icon beside the title */
.list-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 12px; padding-block: 28px; }
.list-tile > .sym { width: 32px; height: 32px; align-self: center; }
.list-tile > h3 { align-self: center; font-size: 1.5rem; }
.list-tile > .chips { grid-column: 1 / -1; margin-top: 18px; }

/* Toolbox: three columns on wide screens, two on tablets and small laptops, one on phones */
@media (min-width: 1060px) {
  .toolbox-grid > .tile { grid-column: span 2; }
  .toolbox-grid .tile { padding-inline: 24px; }
  .toolbox-grid .chips li { padding-inline: 13px; }
}
@media (min-width: 760px) and (max-width: 1059px) {
  .toolbox-grid { grid-template-columns: 1fr 1fr; }
  .toolbox-grid > .tile { grid-column: auto; }
}

@media (max-width: 520px) {
  .list-tile { padding-inline: 16px; }
  #credentials .chips li { padding-inline: 12px; }
  /* Past credentials become a quiet list, since their names are too long for pills on a phone */
  .chips.pill-past { display: block; }
  .chips.pill-past li { display: block; padding: 12px 0; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; }
  .chips.pill-past li:last-child { border-bottom: 0; }
}


/* 12. Connect band and footer --------------------------------------------- */

.connect { text-align: center; }
.connect .section-title { margin-bottom: 8px; }
.connect p { max-width: 44ch; margin: 0 auto 40px; color: var(--muted); font-size: 1.2rem; line-height: 1.5; text-wrap: balance; }

.site-footer { background: var(--field); color: var(--muted); font-size: 0.9375rem; border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 40px 32px; }

.directory { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 32px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
@media (max-width: 980px) { .directory { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .directory { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .directory { grid-template-columns: 1fr; } }
.directory h2 { margin: 0 0 4px; color: var(--ink); font: 600 0.9375rem/1.3 var(--font-text); }
.directory ul { margin: 0; padding: 0; list-style: none; }
.directory a { display: flex; align-items: center; min-height: 44px; color: var(--muted); line-height: 1.3; }
.directory a:hover { color: var(--ink); }

/* Legal row: buttons stay put, and their notes open on their own line below */
.legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; padding-top: 12px; }
.legal .copy { display: flex; align-items: center; min-height: 44px; margin: 0; }
.legal-links { display: flex; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.fine-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer;
}
.fine-btn:hover { color: var(--ink); text-decoration: underline; }
.fine-btn::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; }
.fine-btn[aria-expanded="true"] { color: var(--ink); }
.fine-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.fine-panel { padding: 4px 0 12px; }
.fine-panel p { margin: 0; max-width: 72ch; line-height: 1.5; }


/* 13. Motion ---------------------------------------------------------------- */
/* Everything here runs only when the visitor hasn't asked for reduced motion.
   Scripts add .is-hidden to items below the fold, then remove it once as they
   scroll into view, so nothing ever fades back out. */

@media (prefers-reduced-motion: no-preference) {
  .glow i:nth-child(1) { animation: drift-1 5s ease-in-out both; }
  .glow i:nth-child(2) { animation: drift-2 5s ease-in-out both; }
  .glow i:nth-child(3) { animation: drift-3 5s ease-in-out both; }

  .reveal { transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.is-hidden { opacity: 0; transform: translateY(48px) scale(0.97); }
  .reveal-soft { transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal-soft.is-hidden { opacity: 0; transform: translateY(32px); }

  /* Stat graphics */
  .stat .viz > * { transform-origin: left center; transition: opacity 0.5s ease 0.15s, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.15) 0.15s; }
  .stat.is-hidden .glyph { opacity: 0; transform: scale(0.6); }
  .chart .bar { transform-box: fill-box; transform-origin: bottom; transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .chart .bar:nth-of-type(1)  { transition-delay: 0.20s; } .chart .bar:nth-of-type(2)  { transition-delay: 0.245s; }
  .chart .bar:nth-of-type(3)  { transition-delay: 0.29s; } .chart .bar:nth-of-type(4)  { transition-delay: 0.335s; }
  .chart .bar:nth-of-type(5)  { transition-delay: 0.38s; } .chart .bar:nth-of-type(6)  { transition-delay: 0.425s; }
  .chart .bar:nth-of-type(7)  { transition-delay: 0.47s; } .chart .bar:nth-of-type(8)  { transition-delay: 0.515s; }
  .chart .bar:nth-of-type(9)  { transition-delay: 0.56s; } .chart .bar:nth-of-type(10) { transition-delay: 0.605s; }
  .chart .bar:nth-of-type(11) { transition-delay: 0.65s; } .chart .bar:nth-of-type(12) { transition-delay: 0.695s; }
  .stat.is-hidden .chart .bar { transform: scaleY(0); }
  .chart .branch { stroke-dasharray: 80; stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s ease 0.2s; }
  .stat.is-hidden .chart .branch { stroke-dashoffset: 80; }

  /* Career line draws down once */
  .timeline::before { transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .timeline.is-hidden::before { transform: scaleY(0); }
}

/* Applied for one frame while scripts hide below-the-fold items, so they hide instantly */
.no-transitions *, .no-transitions *::before { transition: none !important; }

@keyframes drift-1 { 50% { transform: translate(8%, 10%) scale(1.1); } }
@keyframes drift-2 { 50% { transform: translate(-10%, 8%) scale(0.9); } }
@keyframes drift-3 { 50% { transform: translate(-6%, -8%) scale(1.15); } }


/* 14. User preferences ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html, .carousel-track { scroll-behavior: auto; }
  .dots .bar { transition: none; }
}

/* Reduce Transparency and Increase Contrast swap glass for solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  .site-nav, .carousel-ui { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #3a3a3c; --line: #8e8e93; }
  .site-nav, .carousel-ui { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line); }
  .tile { border: 1px solid var(--line); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --muted: #d1d1d6; }
}

/* Windows High Contrast: let the system color the gradient headline */
@media (forced-colors: active) {
  .grad { background: none; color: CanvasText; }
}

/* 404 page */
.page-center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
