/* Intelligent Algorithms Ltd
   v3 stylesheet — professional blue palette, modern business look
   ---------------------------------------- */

:root {
  /* Blue palette — dark to light */
  --navy:      #0a2540;
  --navy-700:  #0f3460;
  --blue-800:  #14467f;
  --blue-700:  #1551a3;
  --blue-600:  #1d4ed8;
  --blue-500:  #2f72d6;
  --blue-400:  #4f9bf0;
  --sky-300:   #8fc1f5;
  --sky-200:   #c5ddf9;
  --sky-100:   #e3eefb;
  --sky-50:    #eef5fe;

  /* Secondary accent (blue) for pops of colour */
  --cyan:      #4f9bf0;
  --cyan-soft: #8fc1f5;

  /* Ink (blue-grey neutrals) */
  --ink:       #14233b;
  --ink-soft:  #44566f;
  --ink-faint: #6c7f9a;

  /* Surfaces */
  --paper:     #f4f8fd;
  --paper-2:   #ffffff;
  --rule:      #dbe5f1;
  --rule-soft: #e9f0f9;

  --primary:   var(--blue-600);
  --accent:    var(--cyan);

  --max:        760px;
  --max-wide:   1080px;
  --max-article: 700px;

  --serif: "Crimson Pro", "Iowan Old Style", "Charter", Georgia, Cambria, serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px rgba(16,52,96,.05), 0 1px 3px rgba(16,52,96,.08);
  --shadow-md: 0 4px 12px rgba(16,52,96,.07), 0 16px 32px -18px rgba(16,52,96,.30);
  --shadow-lg: 0 10px 24px rgba(16,52,96,.10), 0 28px 56px -22px rgba(16,52,96,.38);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  padding: 0;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }

/* ---------- Layout ---------- */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.25rem 1.5rem 5rem;
}
.page-wide { max-width: var(--max-wide); }
.page-article { max-width: var(--max-article); }

/* ---------- Header / nav ---------- */
.site-head-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 14, 28, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(143, 193, 245, 0.14);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--navy), var(--blue-600) 55%, var(--cyan)) 1;
}
.site-head {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-head .brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #eaf3ff;
  text-decoration: none;
  border-bottom: none;
}
.site-head .brand em {
  font-style: italic;
  font-weight: 400;
  color: var(--sky-300);
}
.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: none;
}
.brand-text { display: block; white-space: nowrap; }
.site-nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
}
.site-nav a {
  position: relative;
  color: var(--sky-200);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: none;
  transition: color 0.15s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover { color: #fff; }
.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
  margin: 2.5rem 0 1rem;
}
h1 {
  font-size: 2.6rem;
  letter-spacing: -0.018em;
  margin-top: 1rem;
}
h2 {
  font-size: 1.6rem;
  margin-top: 3rem;
}
h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-bottom: 0.85rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan));
}
h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
}
h4 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  color: var(--navy);
}
p { margin: 0 0 1.1rem; }
a {
  color: var(--blue-600);
  text-decoration: none;
  border-bottom: 1px solid var(--sky-200);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover {
  color: var(--blue-800);
  border-bottom-color: var(--cyan);
}
strong { font-weight: 600; color: var(--navy); }
em { font-style: italic; }

/* ---------- Lede ---------- */
.lede {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 1.25rem 0 2rem;
  font-weight: 400;
}

/* ---------- Eyebrow / kicker ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-600);
  font-weight: 600;
  margin: 0 0 0.6rem;
}

/* ---------- Meta line ---------- */
.meta {
  font-family: var(--sans);
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin: 0.25rem 0 0.5rem;
  font-weight: 500;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(125% 95% at 60% 100%, #0a1f3e 0%, #060f1f 46%, #03070f 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    radial-gradient(110% 80% at 88% -10%, rgba(79, 155, 240, 0.35), transparent 55%),
    radial-gradient(90% 70% at 0% 110%, rgba(143, 193, 245, 0.20), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 4.75rem 1.5rem 4.25rem;
}
.hero h1 {
  color: #fff;
  margin: 0.4rem 0 1.25rem;
  font-size: 3rem;
  max-width: 20ch;
  letter-spacing: -0.02em;
}
.eyebrow.on-dark { color: var(--sky-300); }
.lede.on-dark {
  color: var(--sky-100);
  max-width: 60ch;
  margin-bottom: 1.25rem;
}
.hero-sub {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--sky-200);
  max-width: 60ch;
  margin: 0;
}
.hero a {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}
.hero a:hover {
  color: var(--cyan-soft);
  border-bottom-color: var(--cyan-soft);
}
/* Inner-page hero sits a touch shorter than the home hero */
.hero.hero-page .hero-inner { padding: 3.75rem 1.5rem 3.25rem; }
.hero.hero-page h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.5rem);
  max-width: 18ch;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
/* Longer statement headings (e.g. the About mission) read better wider/smaller */
.hero.hero-page h1.mission {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  max-width: 26ch;
  line-height: 1.14;
}

/* ---------- Animated tagline (gradient shimmer) ---------- */
.tagline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: 0.005em;
  max-width: 24ch;
  margin: 0 0 1.15rem;
  background: linear-gradient(100deg, #ffffff 0%, #9ec9f7 22%, #4cc4e0 50%, #9ec9f7 78%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: tagline-in 0.8s ease-out both, tagline-shimmer 7s linear infinite;
}
@keyframes tagline-shimmer {
  from { background-position: 220% center; }
  to   { background-position: -220% center; }
}
@keyframes tagline-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .tagline, .hero-slogan .w { -webkit-text-fill-color: #eaf3ff; color: #eaf3ff; }
}
@media (prefers-reduced-motion: reduce) {
  .tagline { animation: tagline-in 0.4s ease-out both; }
  .hero-slogan .w { animation: none; opacity: 1; transform: none; }
  .hero-aurora .blob { animation: none; }
  .marquee-track { animation: none; }
}

/* ---------- Home hero slogan (large, DeepMind-style) ---------- */
main:has(.hero-home) { display: flex; flex-direction: column; }
.hero.hero-home {
  flex: 1;
  min-height: 80vh;
  display: flex;
  align-items: flex-start;
}
.hero-home .hero-inner { width: 100%; padding: 2.5rem 1.5rem 4rem; position: relative; z-index: 1; }
.hero-home .eyebrow { margin-bottom: 0.9rem; }

/* Beam-burst canvas spread across every hero (drawn by main.js) */
.hero .hero-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero .hero-inner { position: relative; z-index: 1; }
.hero-marquee { position: relative; z-index: 1; }
/* Prominent, static brand logo at the top-left of the home hero */
.hero-home .hero-logo {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 0 1.15rem;
  filter: drop-shadow(0 0 20px rgba(76, 212, 236, 0.55)) drop-shadow(0 3px 8px rgba(4, 18, 40, 0.45));
}
.hero-home .hero-aurora { display: none; }
/* Dark scrim keeps the wording readable over the full-width beams (all heroes) */
.hero .hero-inner::before {
  content: "";
  position: absolute;
  inset: -2rem -1.5rem -2rem -2rem;
  z-index: -1;
  background: linear-gradient(95deg, rgba(3, 8, 18, 0.86) 0%, rgba(3, 8, 18, 0.62) 26%, rgba(3, 8, 18, 0.24) 46%, rgba(3, 8, 18, 0) 60%);
  pointer-events: none;
}
@media (max-width: 600px) {
  .hero-home .hero-logo { width: 76px; height: 76px; }
}

/* Capabilities ticker integrated at the foot of the hero */
.hero-marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  padding: 1rem 0;
}
/* On the full-height home hero, pin it to the very bottom */
.hero-home .hero-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
/* On inner-page heroes, give the foot ticker a little breathing room */
.hero-page .hero-marquee { margin-top: 1.5rem; }
.hero-marquee .marquee-track span {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  color: var(--sky-100);
  opacity: 0.82;
}
.hero-marquee .marquee-track span::after {
  color: var(--cyan-soft);
  margin: 0 1.5rem;
  opacity: 0.9;
}
.hero-slogan {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.9rem, 9.6vw, 7.4rem);
  line-height: 1.02;
  letter-spacing: -0.027em;
  max-width: 19ch;
  margin: 0.2rem 0 1.5rem;
}
/* Brand line standing in for the dropped hero logo: capitals, blue, prominent */
.hero-home .brand-kicker {
  font-size: 0.98rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--sky-300);
  margin-bottom: 1.1rem;
}
.hero-slogan .w {
  display: inline-block;
  background: linear-gradient(100deg, #ffffff 0%, #9ec9f7 22%, #4cc4e0 50%, #9ec9f7 78%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform: translateY(0.45em);
  animation: word-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards, tagline-shimmer 8s linear infinite;
}
.hero-slogan .w:nth-child(1) { animation-delay: 0.05s, 0s; }
.hero-slogan .w:nth-child(2) { animation-delay: 0.16s, 0s; }
.hero-slogan .w:nth-child(3) { animation-delay: 0.27s, 0s; }
.hero-slogan .w:nth-child(4) { animation-delay: 0.38s, 0s; }
.hero-slogan .w:nth-child(5) { animation-delay: 0.49s, 0s; }
.hero-slogan .w:nth-child(6) { animation-delay: 0.60s, 0s; }
@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}
.hero-home .lede.on-dark { font-size: 1.32rem; max-width: 50ch; }

/* ---------- Hero aurora (animated background) ---------- */
.hero-aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.34;
  mix-blend-mode: screen;
}
.hero-aurora .blob1 { width: 46vw; height: 46vw; max-width: 560px; max-height: 560px; background: #2f7fe0; top: -14%; left: -6%; animation: drift1 19s ease-in-out infinite alternate; }
.hero-aurora .blob2 { width: 42vw; height: 42vw; max-width: 520px; max-height: 520px; background: #2f72d6; bottom: -20%; right: -8%; animation: drift2 23s ease-in-out infinite alternate; }
.hero-aurora .blob3 { width: 36vw; height: 36vw; max-width: 460px; max-height: 460px; background: #4f9bf0; top: 16%; right: 24%; animation: drift3 27s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(14%, 10%) scale(1.18); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1.05); } to { transform: translate(-12%, -8%) scale(1.22); } }
@keyframes drift3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(10%, -12%) scale(1.16); } }

/* ---------- Capability marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  color: var(--navy);
  opacity: 0.55;
}
.marquee-track span::after {
  content: "\2022";
  color: var(--cyan);
  margin: 0 1.6rem;
  opacity: 0.7;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Credentials cards (rotating skills) ---------- */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0 1rem;
}
.cred-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--c, var(--blue-600));
  border-radius: 14px;
  padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: 0 1px 2px rgba(16, 52, 96, 0.05), 0 16px 34px -20px var(--c-sh, rgba(16, 52, 96, 0.4));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cred-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(16, 52, 96, 0.08), 0 26px 52px -22px var(--c-sh, rgba(16, 52, 96, 0.45));
}
.cred-cert {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c, var(--blue-600));
  margin: 0 0 0.5rem;
}
.cred-card h3 {
  margin: 0 0 0.95rem;
  font-size: 1.1rem;
  color: var(--navy);
}
.cred-skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.45rem;
}
.cred-chip {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--c, var(--blue-700));
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .cred-chip {
    background: color-mix(in srgb, var(--c, #1d4ed8) 8%, #fff);
    border-color: color-mix(in srgb, var(--c, #1d4ed8) 24%, #fff);
  }
}
.cred-chip:hover {
  background: var(--c, var(--blue-600));
  border-color: var(--c, var(--blue-600));
  color: #fff;
}

/* ---------- Sector tile icons ---------- */
.sector-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  margin-bottom: 0.85rem;
  color: var(--c, var(--blue-600));
  background: var(--sky-50);
}
@supports (background: color-mix(in srgb, red, blue)) {
  .sector-icon-wrap { background: color-mix(in srgb, var(--c, #1d4ed8) 12%, #fff); }
}
.sector-icon { width: 23px; height: 23px; display: block; }

/* ---------- Entry / case study cards ---------- */
.entry {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue-500);
  border-radius: 14px;
  padding: 1.7rem 1.8rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--cyan);
}
.entry h3 { margin-top: 0; }
.entry .field {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 0.25rem;
  line-height: 1.6;
}
.entry .field strong {
  color: var(--blue-700);
  font-weight: 600;
}

/* ---------- Case-study glance grid ---------- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2.25rem 0 1rem;
  align-items: start;
}
.case-grid .entry {
  margin: 0;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--c, var(--blue-600));
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 52, 96, 0.05), 0 16px 34px -20px var(--c-sh, rgba(16, 52, 96, 0.4));
}
.case-grid .entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(16, 52, 96, 0.08), 0 26px 52px -22px var(--c-sh, rgba(16, 52, 96, 0.45));
}
.case-grid .entry h3 { color: var(--c, var(--navy)); }
.case-grid .entry .field strong { color: var(--c, var(--blue-700)); }

.case-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--c, var(--blue-600));
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

/* Category accents — a professional blue / teal / indigo family */
/* Cohesive blue / cyan / teal family only */
.cat-fin { --c: #1d4ed8; --c-sh: rgba(29, 78, 216, 0.45); }   /* royal blue */
.cat-eng { --c: #14467f; --c-sh: rgba(20, 70, 127, 0.45); }   /* deep blue */
.cat-opt { --c: #0284c7; --c-sh: rgba(2, 132, 199, 0.45); }   /* azure */
.cat-nlp { --c: #2f72d6; --c-sh: rgba(47, 114, 214, 0.45); }  /* medium blue */
.cat-env { --c: #4f9bf0; --c-sh: rgba(79, 155, 240, 0.45); }  /* azure */
.cat-edu { --c: #1551a3; --c-sh: rgba(21, 81, 163, 0.45); }   /* deep blue */

/* ---------- Capabilities / skill cloud ---------- */
.capabilities { margin: 2rem 0 1rem; }
.cap-intro {
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  max-width: 60ch;
}
.skill-cloud {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.7rem;
  align-items: center;
}
.skill {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--blue-700);
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  line-height: 1.2;
  cursor: default;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.skill:hover {
  transform: translateY(-2px);
  background: var(--blue-600);
  color: #fff;
  border-color: var(--blue-600);
  box-shadow: 0 8px 18px -8px rgba(29, 78, 216, 0.55);
}
/* size variation gives the at-a-glance "cloud" feel */
.skill.sk-lg { font-size: 1.18rem; padding: 0.5rem 1.2rem; }
.skill.sk-md { font-size: 1rem; }
.skill.sk-sm { font-size: 0.86rem; }
/* tri-colour rotation (blue / azure / indigo) */
.skill:nth-child(3n+2) { color: #1d4ed8; background: #eaf1fc; border-color: #cdddf2; }
.skill:nth-child(3n+2):hover { background: #2f72d6; border-color: #2f72d6; color: #fff; box-shadow: 0 8px 18px -8px rgba(47, 114, 214, 0.55); }
.skill:nth-child(3n) { color: #1551a3; background: #e8eefb; border-color: #cdddf2; }
.skill:nth-child(3n):hover { background: #4f9bf0; border-color: #4f9bf0; color: #fff; box-shadow: 0 8px 18px -8px rgba(79, 155, 240, 0.55); }


/* ---------- Section ornament ---------- */
.ornament {
  text-align: center;
  margin: 3.5rem 0;
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.5em;
  user-select: none;
}
.ornament::before { content: "§"; }

/* ---------- Publication list ---------- */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.pub-list li {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 1rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pub-list li:hover {
  background: var(--paper-2);
  border-color: var(--rule);
}
.pub-list .year {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}
.pub-list .title { font-style: italic; color: var(--navy); }
.pub-list .desc {
  display: block;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

/* ---------- Plain lists ---------- */
.page ul, .page ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
}
.page ul li, .page ol li { margin-bottom: 0.45rem; }
.page ul li::marker { color: var(--blue-500); }

/* ---------- Anchor cards (home) ---------- */
.anchors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0 1.5rem;
}
.anchor {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--c, var(--blue-600));
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: 0 1px 2px rgba(16, 52, 96, 0.05), 0 16px 34px -20px var(--c-sh, rgba(16, 52, 96, 0.4));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.anchor:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(16, 52, 96, 0.08), 0 26px 52px -22px var(--c-sh, rgba(16, 52, 96, 0.45));
}
.anchor h4 { margin-top: 0; font-size: 1.15rem; color: var(--c, var(--navy)); }
.anchor p {
  font-size: 0.97rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.anchor a {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  border-bottom: none;
  color: var(--c, var(--blue-600));
}

/* ---------- Writing index ---------- */
.writing-list { list-style: none; padding: 0; margin: 2rem 0; }
.writing-list .item {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.writing-list .item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.writing-list .item h3 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
}
.writing-list .item h3 a {
  color: var(--navy);
  border-bottom: none;
}
.writing-list .item h3 a:hover { color: var(--blue-600); }
.writing-list .item .meta { margin-bottom: 0.6rem; }
.writing-list .item .blurb {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}
.writing-list .excerpt {
  margin: 0.8rem 0;
  padding: 0.3rem 0 0.3rem 1.1rem;
  border-left: 3px solid var(--blue-500);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--navy);
}

/* ---------- Article (essay) styling ---------- */
.article-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.article-head .back {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--blue-600);
  display: inline-block;
  margin-bottom: 1.5rem;
  border-bottom: none;
}
.article-head .back:hover { color: var(--blue-800); }
.article-head h1 {
  font-size: 2.4rem;
  margin: 0 0 0.75rem;
  line-height: 1.18;
}
.article-head .subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0 0 1rem;
}
.article-head .byline {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-700);
}
.article-head .dateline {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 0.4rem;
}
.article-body p {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink);
}
.article-body h2 {
  font-size: 1.5rem;
  margin-top: 2.75rem;
}
/* Pull quotes / epigraphs within an article */
.article-body blockquote {
  margin: 1.9rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  border-left: 3px solid var(--blue-500);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--navy);
}

/* Drop cap on first paragraph of article */
.article-body > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.8rem;
  font-weight: 600;
  color: var(--blue-600);
  float: left;
  line-height: 0.82;
  margin: 0.35rem 0.7rem 0 0;
  padding: 0;
}

/* ---------- Bibliography ---------- */
.bibliography {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.bibliography h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}
.bibliography h2::before { display: none; }
.bibliography ol { padding-left: 2.5rem; }
.bibliography li { margin-bottom: 0.55rem; line-height: 1.5; }
.bibliography a { word-break: break-word; }

/* ---------- Inline citations ---------- */
.cite {
  font-family: var(--sans);
  font-size: 0.7rem;
  vertical-align: super;
  line-height: 0;
  color: var(--cyan);
  border-bottom: none;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-foot {
  background: linear-gradient(135deg, #0a2540 0%, #14467f 100%);
  color: var(--sky-200);
  margin-top: 4rem;
  font-family: var(--sans);
  font-size: 0.84rem;
}
.site-foot > * {
  max-width: var(--max-wide);
}
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 1.5rem 2.75rem;
}
.site-foot a { color: #fff; border-bottom-color: rgba(255,255,255,0.35); }
.site-foot a:hover { color: var(--cyan-soft); border-bottom-color: var(--cyan-soft); }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .page { padding: 2.25rem 1.25rem 4rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  .lede { font-size: 1.14rem; }
  .hero-inner { padding: 3.25rem 1.25rem 3rem; }
  .hero h1 { font-size: 2.1rem; }
  .tagline { font-size: 1.22rem; }
  .article-head h1 { font-size: 1.9rem; }
  .article-body p { font-size: 1.08rem; }
  .article-body > p:first-of-type::first-letter {
    font-size: 3rem;
    margin: 0.3rem 0.5rem 0 0;
  }
  .site-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .site-nav { width: 100%; flex-wrap: wrap; gap: 0.3rem 1.15rem; }
  .site-nav a { padding-top: 0.35rem; padding-bottom: 0.35rem; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head-wrap, .site-nav, .site-foot, .article-head .back { display: none; }
  .hero { background: none; color: #000; }
  .hero h1, .lede.on-dark, .hero-sub, .eyebrow.on-dark { color: #000; }
  a { color: #000; border-bottom: none; }
  .entry, .anchor, .writing-list .item { box-shadow: none; border: 1px solid #999; }
  .ornament { display: none; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- Button / call-to-action ---------- */
.cta-row { margin: 1.6rem 0 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--navy);
  text-decoration: none;
  border: none;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  background: var(--sky-100);
  color: var(--navy);
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.5);
}
/* Keep the button text dark even inside the dark hero (which colours links white) */
.hero a.btn,
.hero a.btn:hover { color: var(--navy); border-bottom: none; }

/* ---------- Text selection ---------- */
::selection { background: var(--sky-200); color: var(--navy); }

/* ---------- Keyboard focus (accessibility) ---------- */
/* Mouse clicks stay clean; keyboard navigation gets a clear brand-blue ring. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 3px;
  border-radius: 4px;
}
/* On dark surfaces (hero, footer) a white ring reads far better. */
.hero a:focus-visible,
.site-foot a:focus-visible,
.btn:focus-visible {
  outline-color: #fff;
}

/* ---------- Sticky-header anchor offset ---------- */
/* Stop in-page jumps (e.g. article footnotes) landing under the sticky header. */
[id] { scroll-margin-top: 88px; }

/* ---------- Dropdown navigation ---------- */
.site-nav { align-items: center; }
.nav-item { position: relative; display: inline-flex; }
.nav-top {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sky-200);
  background: none;
  border: none;
  padding: 0 0 4px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  position: relative;
  transition: color 0.15s ease;
}
.nav-top .caret {
  width: 0.66em;
  height: 0.66em;
  margin-top: 1px;
  transition: transform 0.2s ease;
}
.nav-item:hover .nav-top .caret,
.nav-item:focus-within .nav-top .caret,
.nav-item.open .nav-top .caret { transform: rotate(180deg); }
.nav-top::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-top:hover { color: #fff; }
.nav-item:hover .nav-top::after,
.nav-item:focus-within .nav-top::after,
.nav-item.open .nav-top::after,
.nav-top.active::after { transform: scaleX(1); }
.nav-top.active { color: #fff; }

.nav-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 9px);
  min-width: 186px;
  background: rgba(9, 18, 34, 0.96);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border: 1px solid rgba(143, 193, 245, 0.18);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}
/* invisible hover bridge so the menu doesn't close in the gap */
.nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  height: 11px;
}
.nav-item:hover .nav-menu,
.nav-item:focus-within .nav-menu,
.nav-item.open .nav-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 4px);
}
.nav-menu a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sky-200);
  white-space: nowrap;
  border-bottom: none;
}
.nav-menu a::after { display: none; }
.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(143, 193, 245, 0.12);
  color: #fff;
}
.nav-menu a.active { color: #fff; font-weight: 600; }

/* ---------- Hero light beams ---------- */
.hero-beams {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-beams .beam {
  position: absolute;
  top: -35%;
  height: 170%;
  background: linear-gradient(to bottom,
    rgba(143, 193, 245, 0) 0%,
    rgba(79, 155, 240, 0.5) 42%,
    rgba(150, 200, 250, 0.7) 52%,
    rgba(79, 155, 240, 0.4) 62%,
    rgba(143, 193, 245, 0) 100%);
  filter: blur(2.5px);
  mix-blend-mode: screen;
  transform: rotate(var(--rot, 14deg));
  transform-origin: top center;
  opacity: 0.55;
  animation: beam-sway 13s ease-in-out infinite alternate;
}
.hero-beams .beam:nth-child(1) { left: 8%;  width: 2px;   --rot: 15deg; animation-duration: 12s; opacity: 0.5; }
.hero-beams .beam:nth-child(2) { left: 24%; width: 1.5px; --rot: 10deg; animation-duration: 16s; animation-delay: -4s; opacity: 0.7; }
.hero-beams .beam:nth-child(3) { left: 45%; width: 3px;   --rot: 17deg; animation-duration: 14s; animation-delay: -7s; opacity: 0.5; }
.hero-beams .beam:nth-child(4) { left: 64%; width: 2px;   --rot: 12deg; animation-duration: 18s; animation-delay: -2s; opacity: 0.62; }
.hero-beams .beam:nth-child(5) { left: 82%; width: 2.5px; --rot: 16deg; animation-duration: 15s; animation-delay: -9s; opacity: 0.5; }
@keyframes beam-sway {
  from { transform: translateX(-4%) rotate(var(--rot, 14deg)); opacity: 0.28; }
  to   { transform: translateX(4%)  rotate(var(--rot, 14deg)); opacity: 0.7; }
}

/* ---------- Rotating hero headline ---------- */
.hero-slogan.rotator { display: grid; }
.hero-slogan.rotator .rot-line {
  grid-area: 1 / 1;
  background: linear-gradient(100deg, #ffffff 0%, #9ec9f7 22%, #4cc4e0 50%, #9ec9f7 78%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform: translateY(0.32em);
  transition: opacity 0.65s ease, transform 0.65s ease;
  animation: tagline-shimmer 8s linear infinite;
}
.hero-slogan.rotator .rot-line.is-active {
  opacity: 1;
  transform: none;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-slogan.rotator .rot-line { -webkit-text-fill-color: #eaf3ff; color: #eaf3ff; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-beams .beam { animation: none; }
  .hero-slogan.rotator .rot-line { transition: none; animation: none; }
}

/* ---------- Coming-soon resource cards ---------- */
.soon-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

/* ---------- Mobile nav (dropdowns inline) ---------- */
@media (max-width: 600px) {
  .nav-item { display: block; width: 100%; }
  .nav-top { width: 100%; justify-content: flex-start; padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .nav-top::after { display: none; }
  .nav-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0 0 0.3rem 1rem;
    min-width: 0;
  }
  .nav-menu::before { display: none; }
  .nav-menu a { padding: 0.3rem 0; }
}

/* ---------- Hero logo fountain (home) ---------- */
/* A prominent, left-aligned brand mark with thin three-colour beams
   sprouting upward and shooting out like a fountain. */
.hero-fountain {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 300px;
  margin: 0 0 0.75rem;
  pointer-events: none;
}
/* Particle spray (JS). Sits over the fallback beams; the logo stays on top. */
.hero-fountain .fountain-canvas {
  position: absolute;
  inset: -120px 0 0 0;       /* headroom so the long arcs aren't clipped */
  left: 0;
  width: 86vw;               /* let the spray ripple out wide across the hero */
  min-width: 900px;
  height: calc(100% + 120px);
  z-index: 1;
  pointer-events: none;
}
/* When the JS spray is active, hide the static fallback beams. */
.hero-fountain.js-spray .fbeam { display: none; }
/* origin point — the centre of the logo — that all beams spring from */
.hero-fountain .fbeam {
  position: absolute;
  left: 53px;
  bottom: 52px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
  transform-origin: bottom center;
  transform: rotate(var(--a, 0deg));
  background: linear-gradient(to top,
    rgba(255, 255, 255, 0.95) 0%,
    var(--bc, #4cd4ec) 14%,
    var(--bc, #4cd4ec) 38%,
    transparent 100%);
  filter: drop-shadow(0 0 5px var(--bc, #4cd4ec));
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: fbeam-shoot 1.7s ease-in-out infinite;
}
/* angle + colour + length per beam — tapered for a fountain silhouette.
   Three colours rotate: blue, cyan, teal. */
.hero-fountain .fbeam:nth-child(1) { --a: -62deg; --bc: #5aa2f5; height: 185px; animation-delay: -0.10s; }
.hero-fountain .fbeam:nth-child(2) { --a: -46deg; --bc: #4cd4ec; height: 222px; animation-delay: -0.55s; }
.hero-fountain .fbeam:nth-child(3) { --a: -31deg; --bc: #2fe0c4; height: 255px; animation-delay: -0.95s; }
.hero-fountain .fbeam:nth-child(4) { --a: -16deg; --bc: #5aa2f5; height: 280px; animation-delay: -0.30s; }
.hero-fountain .fbeam:nth-child(5) { --a:   0deg; --bc: #4cd4ec; height: 298px; animation-delay: -0.75s; }
.hero-fountain .fbeam:nth-child(6) { --a:  16deg; --bc: #2fe0c4; height: 280px; animation-delay: -1.15s; }
.hero-fountain .fbeam:nth-child(7) { --a:  31deg; --bc: #5aa2f5; height: 255px; animation-delay: -0.20s; }
.hero-fountain .fbeam:nth-child(8) { --a:  46deg; --bc: #4cd4ec; height: 222px; animation-delay: -0.65s; }
.hero-fountain .fbeam:nth-child(9) { --a:  62deg; --bc: #2fe0c4; height: 185px; animation-delay: -1.05s; }
@keyframes fbeam-shoot {
  0%, 100% { transform: rotate(var(--a, 0deg)) scaleY(0.4);  opacity: 0.28; }
  45%      { transform: rotate(var(--a, 0deg)) scaleY(1.05); opacity: 0.98; }
}
.hero-fountain .fountain-logo {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 106px;
  height: 106px;
  z-index: 2;
  filter: drop-shadow(0 0 24px rgba(76, 212, 236, 0.6)) drop-shadow(0 3px 8px rgba(4, 18, 40, 0.45));
  animation: logo-float 6s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-fountain .fbeam { animation: none; transform: rotate(var(--a, 0deg)) scaleY(0.92); opacity: 0.8; }
  .hero-fountain .fountain-logo { animation: none; }
}
@media (max-width: 600px) {
  .hero-fountain { height: 220px; }
  .hero-fountain .fbeam { left: 43px; bottom: 44px; }
  .hero-fountain .fbeam:nth-child(1) { height: 130px; }
  .hero-fountain .fbeam:nth-child(2) { height: 156px; }
  .hero-fountain .fbeam:nth-child(3) { height: 178px; }
  .hero-fountain .fbeam:nth-child(4) { height: 196px; }
  .hero-fountain .fbeam:nth-child(5) { height: 208px; }
  .hero-fountain .fbeam:nth-child(6) { height: 196px; }
  .hero-fountain .fbeam:nth-child(7) { height: 178px; }
  .hero-fountain .fbeam:nth-child(8) { height: 156px; }
  .hero-fountain .fbeam:nth-child(9) { height: 130px; }
  .hero-fountain .fountain-logo { width: 86px; height: 86px; }
}
