/* ===================================================
   BLUEPRINT — visual layer for the 2026 redesign
   Loaded LAST on every page, after style.css, skills.css and
   photography.css. It changes how things look and move, never what
   is on the page: no markup, copy or layout order depends on it.
   Delete the <link> and <script> tags and the old design returns.

   Direction: an engineering drawing come to life. Blueprint grid
   paper behind everything, circuit traces carrying signal pulses
   through the heroes, registration marks on cards, chip-style icons
   with pins, section breaks drawn as traces with a node.

   Motion is progressive: every effect is either pure CSS or waits
   for blueprint.js to add html.bp-js, and prefers-reduced-motion
   turns all of it off.
   =================================================== */

/* ─── TOKENS ─────────────────────────────────────── */
:root, [data-theme="dark"] {
  --color-bg:              #070c16;
  --color-surface:         #0b1321;
  --color-surface-2:       #0f192b;
  --color-surface-offset:  #142137;
  --color-border:          #1d2c46;
  --color-divider:         #142137;

  --color-text:            #e7eefa;
  --color-text-muted:      #97a7bf;
  --color-text-faint:      #7a8ca8;
  --color-text-inverse:    #070c16;

  --color-primary:         #5cb4ff;
  --color-primary-hover:   #8ccbff;
  --color-primary-active:  #3a98f0;
  --color-primary-dim:     rgba(92, 180, 255, 0.13);
  --color-primary-glow:    rgba(92, 180, 255, 0.28);

  --bp-signal:     #45e0c8;               /* the pulse that travels a trace */
  --bp-signal-dim: rgba(69, 224, 200, 0.16);
  --bp-grid:       rgba(92, 180, 255, 0.055);
  --bp-grid-major: rgba(92, 180, 255, 0.10);
  --bp-trace:      rgba(92, 180, 255, 0.24);
  --bp-mark:       rgba(92, 180, 255, 0.55);
  --bp-card:       linear-gradient(180deg, rgba(17, 28, 47, 0.86), rgba(11, 19, 33, 0.86));
  --bp-panel:      rgba(11, 19, 33, 0.72);
  --bp-hero-shade: 7, 12, 22;             /* rgb of --color-bg, for overlays */

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --color-bg:              #f2f6fc;
  --color-surface:         #ffffff;
  --color-surface-2:       #edf2fa;
  --color-surface-offset:  #e2eaf6;
  --color-border:          #cad7ea;
  --color-divider:         #e2eaf6;

  --color-text:            #0b1a2e;
  --color-text-muted:      #4a5b74;
  --color-text-faint:      #5c6d86;
  --color-text-inverse:    #f2f6fc;

  --color-primary:         #0a62d6;
  --color-primary-hover:   #0852b4;
  --color-primary-active:  #06449a;
  --color-primary-dim:     rgba(10, 98, 214, 0.09);
  --color-primary-glow:    rgba(10, 98, 214, 0.18);

  --bp-signal:     #0b9c88;
  --bp-signal-dim: rgba(11, 156, 136, 0.12);
  --bp-grid:       rgba(10, 98, 214, 0.05);
  --bp-grid-major: rgba(10, 98, 214, 0.09);
  --bp-trace:      rgba(10, 98, 214, 0.17);
  --bp-mark:       rgba(10, 98, 214, 0.45);
  --bp-card:       linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.92));
  --bp-panel:      rgba(255, 255, 255, 0.66);
  --bp-hero-shade: 242, 246, 252;

  --shadow-sm: 0 1px 3px rgba(11, 26, 46, 0.07);
  --shadow-md: 0 6px 20px rgba(11, 26, 46, 0.09);
  --shadow-lg: 0 18px 48px rgba(11, 26, 46, 0.13);
}

/* ─── PAGE TRANSITIONS ───────────────────────────── */
/* Cross-document view transitions (Chrome, Edge, Safari 18+). The header
   is its own layer, so it holds still while the page beneath it changes.
   Browsers without support simply navigate as before. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: bp-header; }
::view-transition-old(root) { animation: bp-page-out 180ms cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: bp-page-in 380ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes bp-page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes bp-page-in  { from { opacity: 0; transform: translateY(10px); } }

/* ─── BLUEPRINT PAPER ────────────────────────────── */
/* A fixed sheet of grid paper behind the whole site: fine 24px cells and a
   heavier 120px major grid, fading out toward the edges. It sits under the
   canvas-level body background, so sections without their own fill show it. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 20%, #000 35%, rgba(0,0,0,0.35) 100%);
          mask-image: radial-gradient(ellipse 120% 90% at 50% 20%, #000 35%, rgba(0,0,0,0.35) 100%);
}
/* A soft light source top-left so the paper is not perfectly flat. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, var(--color-primary-dim), transparent 70%),
    radial-gradient(700px 500px at 100% 110%, var(--bp-signal-dim), transparent 70%);
  opacity: 0.8;
}

::selection { background: var(--color-primary-glow); }

/* ─── HEADER ─────────────────────────────────────── */
/* Solid, not frosted glass. A translucent bar with backdrop-filter has to
   re-blur everything that moves beneath it (circuit pulses, reveals, the
   scrolling page); in Mac Chrome's power-saving mode that dropped frames
   and read as the bar flickering, at rest and while scrolling. */
.site-header {
  background: var(--color-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
/* The header's bottom edge is a plain hairline. It used to carry a signal
   that swept along it every 9 seconds; on the owner's Mac Chrome that read
   as the whole bar flashing at rest, so the sweep was removed. */
.site-header::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--color-border);
  pointer-events: none;
}
/* Reading progress, drawn by blueprint.js as a scaleX on this bar. */
.bp-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(var(--bp-progress, 0));
  background: linear-gradient(90deg, var(--color-primary), var(--bp-signal));
  box-shadow: 0 0 10px var(--color-primary-glow);
  pointer-events: none;
}
.site-header.scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); }

.logo img { transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), filter 300ms; }
.logo:hover { opacity: 1; }
.logo:hover img { transform: rotate(-12deg) scale(1.05); filter: drop-shadow(0 0 10px var(--color-primary-glow)); }

/* Nav: an underline trace grows from the centre instead of a filled pill. */
.site-nav .nav-link { position: relative; background: none; }
.site-nav > .nav-link::after,
.site-nav > .nav-group > .nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, var(--color-primary), var(--bp-signal));
  transform: scaleX(0);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.site-nav > .nav-link:hover::after,
.site-nav > .nav-link.active::after,
.site-nav > .nav-group:hover > .nav-link::after,
.site-nav > .nav-group:focus-within > .nav-link::after { transform: scaleX(1); }
.site-nav .nav-link:hover,
.site-nav .nav-link.active { background: none; }

.nav-dropdown {
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg);
  transform-origin: top left;
  animation: bp-drop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bp-drop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.nav-dropdown .nav-link { border-radius: 6px; }
.nav-dropdown .nav-link:hover { background: var(--color-primary-dim); color: var(--color-text); }

.mobile-nav { background: color-mix(in srgb, var(--color-bg) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.mobile-nav.open .mobile-nav-link,
.mobile-nav.open .mobile-nav-label { animation: bp-rise 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.mobile-nav.open > :nth-child(2) { animation-delay: 30ms; }
.mobile-nav.open > :nth-child(3) { animation-delay: 60ms; }
.mobile-nav.open > :nth-child(4) { animation-delay: 90ms; }
.mobile-nav.open > :nth-child(5) { animation-delay: 120ms; }
.mobile-nav.open > :nth-child(n+6) { animation-delay: 150ms; }
@keyframes bp-rise { from { opacity: 0; transform: translateY(8px); } }

.theme-toggle svg { transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.theme-toggle:hover svg { transform: rotate(40deg); }

/* ─── SECTIONS ───────────────────────────────────── */
/* Alternating bands become translucent panels, so the grid paper reads
   through them instead of being blanked out. */
.experience-teaser,
.skills-domain--alt,
.page-hero,
.media-section,
.site-footer { background: var(--bp-panel); }
.section, .skills-domain, .page-hero, .cta-strip { position: relative; }

/* Section breaks: a trace with a node at the content edge, instead of a
   flat full-width rule. blueprint.js draws it in from the node. */
main > section + section { border-top: none; }
main > section + section::before {
  content: "";
  position: absolute;
  top: -4px; left: 0; right: 0;
  height: 9px;
  z-index: 1;
  pointer-events: none;
  --bp-node-x: max(16px, calc((100% - var(--content-wide)) / 2));
  background:
    radial-gradient(circle at var(--bp-node-x) 50%, var(--color-primary) 0 2.5px, var(--color-primary-glow) 3px 4.5px, transparent 5px),
    linear-gradient(to bottom, transparent 4px, var(--color-border) 4px 5px, transparent 5px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  transform-origin: var(--bp-node-x) 50%;
  transition: transform 1100ms cubic-bezier(0.65, 0, 0.35, 1);
}
main > #founder + .cta-strip::before,
main > .page-hero--media + .media-section::before { display: none; }
html.bp-js main > section + section:not(.bp-drawn)::before { transform: scaleX(0); }

/* Section labels ("// what we do") become annotation tags: a node, the
   comment, and a leader line running off to the right. */
.section-label {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.12em;
}
.section-label::before {
  content: "";
  width: 7px; height: 7px;
  flex: none;
  border: 1.5px solid var(--color-primary);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--color-primary-glow);
}
.section-label::after {
  content: "";
  width: 72px; height: 1px;
  flex: none;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  transform-origin: 0 50%;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1) 200ms;
}
html.bp-js .section-label:not(.bp-in)::after { transform: scaleX(0); }

.section-title, .page-title, .cta-strip-title {
  background: linear-gradient(100deg, var(--color-text) 30%, color-mix(in srgb, var(--color-text) 55%, var(--color-primary)) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title .ca-leaf, .page-title .ca-leaf { -webkit-text-fill-color: initial; }

/* Reveal for headings and intros that the old observer never covered. */
html.bp-js .bp-reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
              filter 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--bp-i, 0) * 70ms);
}
html.bp-js .bp-reveal.bp-in { opacity: 1; transform: none; filter: none; }

/* Stagger the existing card reveal (style.css) so a grid fills in as a wave. */
html.js-reveal .skill-card,
html.js-reveal .skill-block,
html.js-reveal .interest-card,
html.js-reveal .exp-item,
html.js-reveal .timeline-item,
html.js-reveal .edu-card,
html.js-reveal .edu-block,
html.js-reveal .contact-channel {
  transition-delay: calc(var(--bp-i, 0) * 80ms);
}
html.js-reveal .is-visible:hover { transition-delay: 0ms; }

/* ─── HERO ───────────────────────────────────────── */
.hero-grid-bg { opacity: 0.35; }
.hero-label {
  width: fit-content;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.label-dot { background: var(--bp-signal); box-shadow: 0 0 0 0 var(--bp-signal); animation: bp-ping 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
@keyframes bp-ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bp-signal) 70%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* The wordmark: a slow sheen passes across the gradient. */
.hero-title .accent {
  background: linear-gradient(100deg, var(--color-primary) 0%, var(--color-primary) 38%, var(--color-primary-hover) 48%, var(--bp-signal) 52%, var(--color-primary) 62%, var(--color-primary) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: bp-sheen 7s ease-in-out 1s infinite;
  filter: drop-shadow(0 0 28px var(--color-primary-dim));
}
@keyframes bp-sheen {
  0%, 20% { background-position: 100% 0; }
  60%, 100% { background-position: 0% 0; }
}
.hero-subtitle { letter-spacing: 0.16em; }

/* Company hero photos, re-shaded for the new ink colour. */
@media (min-width: 769px) {
  html[data-theme="dark"] .hero--company {
    background:
      linear-gradient(90deg, rgba(var(--bp-hero-shade), 0.95) 0%, rgba(var(--bp-hero-shade), 0.74) 42%, rgba(var(--bp-hero-shade), 0.30) 100%),
      url("bg-desktop-dark.webp?v=2") center / cover no-repeat;
  }
  html[data-theme="light"] .hero--company {
    background:
      linear-gradient(90deg, rgba(var(--bp-hero-shade), 0.96) 0%, rgba(var(--bp-hero-shade), 0.74) 42%, rgba(var(--bp-hero-shade), 0.22) 100%),
      url("bg-desktop-light-toronto.webp") center / cover no-repeat;
  }
}
@media (max-width: 768px) {
  html[data-theme="dark"] .hero--company {
    background:
      linear-gradient(180deg, rgba(var(--bp-hero-shade), 0.92) 0%, rgba(var(--bp-hero-shade), 0.70) 45%, rgba(var(--bp-hero-shade), 0.36) 100%),
      url("bg-mobile-dark.webp?v=2") center / cover no-repeat;
  }
  html[data-theme="light"] .hero--company {
    background:
      linear-gradient(180deg, rgba(var(--bp-hero-shade), 0.95) 0%, rgba(var(--bp-hero-shade), 0.82) 45%, rgba(var(--bp-hero-shade), 0.30) 100%),
      url("bg-mobile-light-toronto-film.webp") center bottom / cover no-repeat;
  }
}
/* The photo hero fades into the page instead of stopping at a hard edge. */
.hero--company::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 1;
}

/* Registration marks framing the hero, and a coordinate readout. */
.bp-frame {
  position: absolute;
  inset: clamp(16px, 3vw, 36px);
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(var(--bp-mark), var(--bp-mark)) top left / 22px 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) top left / 1px 22px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) top right / 22px 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) top right / 1px 22px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom left / 22px 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom left / 1px 22px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom right / 22px 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom right / 1px 22px;
  background-repeat: no-repeat;
}
.bp-coords {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--color-text-faint);
  opacity: 0.85;
  white-space: nowrap;
}

/* ─── CIRCUIT ART (generated by blueprint.js) ─────── */
.bp-circuit {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: min(62%, 860px);
  z-index: 0;
  pointer-events: none;
  /* Fully transparent across the left 40%, where the text column runs, and
     only reaching full strength around the chip on the right. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0,0,0,0.3) 62%, #000 85%);
          mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0,0,0,0.3) 62%, #000 85%);
  opacity: 0.6;
}
.hero .bp-circuit { opacity: 0.6; }
.page-hero .container, .hero .container { position: relative; z-index: 2; }
.bp-circuit svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bp-trace {
  fill: none;
  stroke: var(--bp-trace);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 0;
}
.bp-pulse {
  fill: none;
  stroke: var(--bp-signal);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 5 95;
  stroke-dashoffset: 100;
  opacity: 0;
  filter: drop-shadow(0 0 2px var(--bp-signal));
}
.bp-node { fill: var(--color-bg); stroke: var(--color-primary); stroke-width: 1.2; }
.bp-pad  { fill: var(--color-primary); opacity: 0.4; }
.bp-chip { fill: color-mix(in srgb, var(--color-surface) 80%, transparent); stroke: var(--bp-mark); stroke-width: 1; }
.bp-chip-pin { stroke: var(--bp-mark); stroke-width: 1; }
/* The page's subject, marked under the chip. A halo in the page colour keeps
   the traces that pass behind it from striking through the letters. */
.bp-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em;
  fill: var(--color-text-muted);
  paint-order: stroke; stroke: var(--color-bg); stroke-width: 5px; stroke-linejoin: round;
}

html.bp-js .bp-circuit .bp-trace { animation: bp-draw 1800ms cubic-bezier(0.65, 0, 0.35, 1) both; animation-delay: calc(var(--d, 0) * 1ms); }
html.bp-js .bp-circuit .bp-node,
html.bp-js .bp-circuit .bp-pad { animation: bp-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--d, 0) * 1ms + 1300ms); transform-box: fill-box; transform-origin: center; }
html.bp-js .bp-circuit .bp-pulse { animation: bp-flow var(--t, 4000ms) linear infinite; animation-delay: calc(var(--d, 0) * 1ms + 1800ms); }
@keyframes bp-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes bp-pop  { from { transform: scale(0); opacity: 0; } }
@keyframes bp-flow {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  8%   { opacity: 1; }
  60%  { stroke-dashoffset: 0; opacity: 1; }
  64%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
.bp-node.bp-live { animation: bp-node-live 3.2s ease-in-out infinite !important; }
@keyframes bp-node-live { 50% { fill: var(--bp-signal); stroke: var(--bp-signal); } }

.bp-circuit.bp-circuit--portrait,
.hero .bp-circuit.bp-circuit--portrait {
  right: auto; bottom: auto;
  width: 900px; height: 800px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 80%);
          mask-image: radial-gradient(closest-side, #000 25%, transparent 80%);
}

/* ─── INNER PAGE HERO ────────────────────────────── */
.page-hero { overflow: hidden; }
.page-title { letter-spacing: -0.035em; }
/* The first paragraph on every page runs the full content width, like the
   paragraphs after it, at the same 1.7 line height (phones keep 1.6). The
   circuit art moves into the band above it, beside the title; blueprint.js
   sets that band's height. */
.page-hero .bp-circuit--title { bottom: auto; width: min(62%, 620px); }
.page-hero:not(.photo-hero) .page-subtitle,
.hero-description { max-width: none; }
@media (min-width: 1025px) {
  .page-hero:not(.photo-hero) .page-title { max-width: 16ch; }
}
@media (min-width: 641px) {
  .page-subtitle { line-height: 1.7; }
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  letter-spacing: 0.08em;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow 300ms, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, var(--bp-signal)));
  border-color: transparent;
  box-shadow: 0 6px 20px -6px var(--color-primary-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), color-mix(in srgb, var(--color-primary-hover) 60%, var(--bp-signal)));
  border-color: transparent;
  box-shadow: 0 10px 28px -6px var(--color-primary-glow), 0 0 0 4px var(--color-primary-dim);
}
/* A light sweep crosses a button on hover. */
.btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg) translateX(0);
  opacity: 0;
  pointer-events: none;
}
.btn:hover::after { animation: bp-btn-sweep 700ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes bp-btn-sweep { 0% { opacity: 1; transform: skewX(-20deg) translateX(0); } 100% { opacity: 0; transform: skewX(-20deg) translateX(420%); } }
.btn-ghost, .btn-outline { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ─── CARDS ──────────────────────────────────────── */
/* Every card gets registration marks at its corners, which extend on hover,
   and a border glow that follows the cursor (--bp-x/--bp-y from the JS). */
.skill-card,
.skill-block,
.interest-card,
.edu-card,
.edu-block,
.contact-channel,
.contact-card {
  position: relative;
  isolation: isolate;
  background: var(--bp-card);
  border-color: var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
/* The degree blocks became cards in the redesign but kept their old
   vertical-only padding, so their text ran to the card edge and onto the
   background grid. Pad all four sides; listing
   the first-of-type selector outranks style.css's padding-top: 0. */
.edu-block,
main > .page-hero + section .edu-block:first-of-type {
  border: 1px solid var(--color-border);
  padding: var(--space-8);
}
/* The old 1px rule between degrees doubles the card borders; it becomes the gap. */
.edu-divider { height: var(--space-6); background: none; }
@media (max-width: 640px) {
  .edu-block,
  main > .page-hero + section .edu-block:first-of-type { padding: var(--space-5); }
  .edu-divider { height: var(--space-4); }
}
.skill-block--highlight {
  background:
    radial-gradient(120% 90% at 100% 0%, var(--color-primary-dim), transparent 60%),
    var(--bp-card);
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.skill-card::before,
.skill-block::before,
.interest-card::before,
.edu-card::before,
.edu-block::before,
.contact-channel::before,
.contact-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: -5px;
  --m: 10px;
  background:
    linear-gradient(var(--bp-mark), var(--bp-mark)) top left / var(--m) 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) top left / 1px var(--m),
    linear-gradient(var(--bp-mark), var(--bp-mark)) top right / var(--m) 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) top right / 1px var(--m),
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom left / var(--m) 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom left / 1px var(--m),
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom right / var(--m) 1px,
    linear-gradient(var(--bp-mark), var(--bp-mark)) bottom right / 1px var(--m);
  background-repeat: no-repeat;
  opacity: 0.55;
  transition: opacity 300ms, inset 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-card:hover::before,
.skill-block:hover::before,
.interest-card:hover::before,
.edu-card:hover::before,
.edu-block:hover::before,
.contact-channel:hover::before,
.contact-card:hover::before { opacity: 1; inset: -8px; }

.skill-card::after,
.skill-block::after,
.interest-card::after,
.edu-card::after,
.edu-block::after,
.contact-channel::after,
.contact-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--bp-x, 50%) var(--bp-y, 0%), var(--color-primary), color-mix(in srgb, var(--bp-signal) 60%, transparent) 30%, transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 350ms;
}
.skill-card:hover::after,
.skill-block:hover::after,
.interest-card:hover::after,
.edu-card:hover::after,
.edu-block:hover::after,
.contact-channel:hover::after,
.contact-card:hover::after { opacity: 1; }

.skill-card:hover,
.skill-block:hover,
.interest-card:hover,
.edu-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  box-shadow: var(--shadow-md), 0 0 36px -8px var(--color-primary-glow);
  transform: translateY(-3px);
}
html.js-reveal .skill-card.is-visible:hover,
html.js-reveal .skill-block.is-visible:hover,
html.js-reveal .interest-card.is-visible:hover,
html.js-reveal .edu-card.is-visible:hover { transform: translateY(-3px); }

/* Icons become chips: a bordered die with pins down both sides. */
.skill-icon, .domain-icon {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  background:
    linear-gradient(135deg, var(--color-primary-dim), transparent 70%),
    var(--color-surface-2);
  box-shadow: inset 0 0 14px var(--color-primary-dim), 0 0 0 4px color-mix(in srgb, var(--color-bg) 60%, transparent);
  border-radius: 9px;
  overflow: visible;
}
.skill-icon::before, .skill-icon::after,
.domain-icon::before, .domain-icon::after {
  content: "";
  position: absolute;
  top: 9px; bottom: 9px;
  width: 4px;
  background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--color-primary) 70%, transparent) 0 2px, transparent 2px 6px);
  transition: background 300ms;
}
.skill-icon::before, .domain-icon::before { left: -6px; }
.skill-icon::after,  .domain-icon::after  { right: -6px; }
.skill-card:hover .skill-icon::before, .skill-card:hover .skill-icon::after {
  background: repeating-linear-gradient(to bottom, var(--bp-signal) 0 2px, transparent 2px 6px);
}
.skill-icon svg { transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.skill-card:hover .skill-icon svg { transform: scale(1.1); }

.skill-block-label, .timeline-period, .exp-period { letter-spacing: 0.12em; }
.skill-tags .tag, .tag, .course-chip {
  border-radius: 4px;
  border-style: dashed;
}

/* Experience teaser rows: a node sits on each divider. */
.exp-item { position: relative; border-bottom-color: var(--color-border); }
.exp-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3.5px;
  width: 6px; height: 6px;
  border: 1px solid var(--color-primary);
  background: var(--color-bg);
  transform: rotate(45deg);
}

/* ─── TIMELINE ───────────────────────────────────── */
/* The rail is a trace; a signal travels down it on a loop. */
.timeline::before {
  width: 1px;
  background:
    linear-gradient(to bottom, transparent, var(--bp-signal), transparent) no-repeat,
    linear-gradient(to bottom, var(--color-primary), var(--color-border) 30%, var(--color-border) 80%, transparent);
  background-size: 100% 140px, 100% 100%;
  background-position: 0 -140px, 0 0;
  animation: bp-rail 6s linear infinite;
}
@keyframes bp-rail { to { background-position: 0 calc(100% + 140px), 0 0; } }
.timeline-marker {
  width: 13px; height: 13px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--color-bg);
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-bg), 0 0 14px var(--color-primary-glow);
}
.timeline-item.is-visible .timeline-marker { animation: bp-marker 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes bp-marker { 0% { transform: rotate(45deg) scale(0); } 60% { background: var(--color-primary); } 100% { transform: rotate(45deg) scale(1); } }
.timeline-bullets li::before { content: "▸"; color: var(--bp-signal); font-size: 0.8em; top: 0.18em; }
.company-logo-wrap { border-radius: 8px; box-shadow: var(--shadow-sm); }

/* ─── MEDIA ──────────────────────────────────────── */
.media-video, .bilibili-mobile-card, .media-placeholder {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.media-video { border-radius: 12px; }

/* ─── CTA STRIP ──────────────────────────────────── */
.cta-strip { background: var(--bp-panel); overflow: hidden; }
.cta-strip .bp-circuit { width: min(48%, 560px); opacity: 0.4; }
.cta-strip-inner { position: relative; z-index: 2; }

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer { position: relative; border-top: none; }
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 22px;
  pointer-events: none;
  opacity: 0.8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='22' viewBox='0 0 240 22'%3E%3Cg fill='none' stroke='%235cb4ff' stroke-opacity='.35' stroke-width='1'%3E%3Cpath d='M0 .5h40l10 10h60l8-10h52l12 12h30l8-12h20'/%3E%3Cpath d='M70 10.5v8M150 .5v6M205 12.5v7' stroke-dasharray='2 2'/%3E%3C/g%3E%3Cg fill='%235cb4ff' fill-opacity='.5'%3E%3Ccircle cx='70' cy='20' r='1.8'/%3E%3Ccircle cx='150' cy='8' r='1.8'/%3E%3Ccircle cx='205' cy='21' r='1.8'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0;
}
.footer-nav a { position: relative; }
.footer-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.footer-nav a:hover::after { transform: scaleX(1); }

/* ─── PHOTOGRAPHY ────────────────────────────────── */
.photo-hero .bp-circuit { display: none; }  /* the Cover Flow is the art here */
.photo-item { border-radius: 10px; }

/* ─── PHONE ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* On a phone the text spans the full width, so there is nowhere for the
     chip to sit that is not behind a heading. The grid paper stays; the
     circuit art only remains around the Team page headshot, above the text. */
  .bp-circuit { display: none; }
  .hero .bp-circuit.bp-circuit--portrait { display: block; }
  .hero .bp-circuit.bp-circuit--portrait { width: 440px; height: 320px; opacity: 0.4; }
  .hero-label { border-radius: 14px; }
  /* With the label 20px under the header there is no room for the frame's
     top marks, and at phone width they crowd the label's pill. */
  .bp-frame { display: none; }
  body::before { background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; }
  /* Section title reveals stay, but without the blur: it costs frames on phones. */
  html.bp-js .bp-reveal { filter: none; }
}

/* ─── REDUCED MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-title .accent,
  .label-dot,
  .timeline::before { animation: none !important; }
  .bp-pulse { display: none; }
  html.bp-js .bp-reveal { opacity: 1; transform: none; filter: none; }
  html.bp-js main > section + section:not(.bp-drawn)::before,
  html.bp-js .section-label:not(.bp-in)::after { transform: none; }
  @view-transition { navigation: none; }
}
