/* ── Base ─────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
strong { font-weight: 600; }

/* ── Hero entrance animations ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.photo-wrap        { animation: fadeUp .6s ease .1s both; }
.hero-links        { animation: fadeUp .6s ease .2s both; }
.hero-badge-anim   { animation: fadeUp .6s ease .2s both; }
.hero-name-anim    { animation: fadeUp .6s ease .3s both; }
.hero-sub-anim     { animation: fadeUp .6s ease .4s both; }
.hero-stats-anim   { animation: fadeUp .6s ease .5s both; }
.hero-btns-anim    { animation: fadeUp .6s ease .55s both; }

/* ── Pulse dot ────────────────────────────────────────────── */
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.75)} }
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #1e40af;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.dark .pulse-dot { background: #60a5fa; }

/* ── Card top-border hover effect ─────────────────────────── */
.card-tw, .pop-card { position: relative; overflow: hidden; }
.card-tw::before, .pop-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #1e40af, #0ea5e9);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.card-tw:hover::before, .pop-card:hover::before { transform: scaleX(1); }

/* ── Active nav link ──────────────────────────────────────── */
.nl.active { color: #0f172a !important; background: #f1f5f9 !important; }
.dark .nl.active { color: #f1f5f9 !important; background: #1e293b !important; }

/* ── Section title accent bar ─────────────────────────────── */
.sec-title { position: relative; display: inline-block; padding-bottom: 14px; }
.sec-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 44px; height: 3px; background: #1e40af; border-radius: 2px;
}


/* ── Scroll reveal ────────────────────────────────────────── */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity .65s ease, transform .65s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── CV Modal show/hide ───────────────────────────────────── */
.modal[aria-hidden="false"], .modal.open { display: flex !important; }

/* ── Event-camera scroll effect (event-camera.js) ─────────── */
/* Sits above the content but below the sticky header. On wide screens it is
   full strength in the side margins left and right of the 1280px content
   column and barely visible over the content; narrower screens have no
   margins, so it covers the whole screen (event-camera.js lowers its
   strength there). */
.event-canvas {
  position: fixed; top: 0; left: 0; z-index: 40;
  pointer-events: none;
  image-rendering: pixelated;
}
@media (min-width: 1100px) {
  .event-canvas {
    -webkit-mask-image: linear-gradient(to right, #000 calc(50% - 640px), rgba(0,0,0,.1) calc(50% - 590px), rgba(0,0,0,.1) calc(50% + 590px), #000 calc(50% + 640px));
            mask-image: linear-gradient(to right, #000 calc(50% - 640px), rgba(0,0,0,.1) calc(50% - 590px), rgba(0,0,0,.1) calc(50% + 590px), #000 calc(50% + 640px));
  }
}
.events-off .event-canvas, .events-off .event-bubble { display: none; }

/* Floating on/off switch: top right, below the 60px sticky header (on very
   wide screens it moves just right of the content column, see below) */
.event-toggle {
  position: fixed; right: 20px; top: 72px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 18px;
  border: 1px solid rgba(30,64,175,.2); border-radius: 999px;
  background: #fff; color: #1e40af;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(30,64,175,.22);
  cursor: pointer;
  transition: background-color .15s ease;
}
.event-toggle:hover { background: #f4f6fc; }  /* opaque, so events never show through */
.dark .event-toggle { background: #1e293b; border-color: #334155; color: #60a5fa; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.dark .event-toggle:hover { background: #0f172a; }
.menu-open .event-toggle { display: none; }   /* don't cover the open mobile menu */

.event-switch {
  position: relative; width: 44px; height: 24px; border-radius: 12px;
  background: #1e40af; transition: background-color .2s ease;
}
.event-switch::after {
  content: ''; position: absolute; top: 3px; left: 23px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: left .2s ease;
}
.dark .event-switch { background: #3b82f6; }
.events-off .event-switch { background: #cbd5e1; }
.dark.events-off .event-switch { background: #475569; }
.events-off .event-switch::after { left: 3px; }

/* Phones: a smaller switch, tucked closer to the corner */
@media (max-width: 639px) {
  .event-toggle { right: 12px; top: 68px; gap: 8px; padding: 6px 7px 6px 13px; font-size: 13px; }
  .event-switch { width: 36px; height: 20px; border-radius: 10px; }
  .event-switch::after { top: 3px; left: 19px; width: 14px; height: 14px; }
  .events-off .event-switch::after { left: 3px; }
}

/* Comic speech bubble on the photo, in Bangers, with blue/red offset edges
   as if moving past an event camera */
.photo-wrap { position: relative; }
.event-bubble {
  display: block; position: absolute; top: 10%; left: calc(100% - 30px);
  padding: 10px 17px 7px;
  border: 3px solid #1e40af; border-radius: 50%;
  background: #fff; color: #1e40af;
  font-family: 'Bangers', system-ui, sans-serif;
  font-size: 19px; font-weight: 400; letter-spacing: 1.2px; line-height: 1.15;
  text-align: center; white-space: nowrap;
  text-shadow: 1.5px 1px 0 rgba(214,69,65,.55);
  transform: rotate(-4deg);
  box-shadow: -5px -3px 0 rgba(30,64,175,.45), 5px 4px 0 rgba(214,69,65,.75);
  cursor: help;
}
/* Tail pointing left at the photo: a blue triangle with a white one inside */
.event-bubble::before, .event-bubble::after {
  content: ''; position: absolute; top: 58%;
  border-style: solid; border-color: transparent;
}
.event-bubble::before { left: -18px; margin-top: -9px; border-width: 9px 18px 9px 0; border-right-color: #1e40af; }
.event-bubble::after  { left: -11px; margin-top: -6px; border-width: 6px 12px 6px 0; border-right-color: #fff; }
.dark .event-bubble { background: #1e293b; color: #60a5fa; border-color: #60a5fa; box-shadow: -5px -3px 0 rgba(96,165,250,.45), 5px 4px 0 rgba(248,113,113,.75); }
.dark .event-bubble::before { border-right-color: #60a5fa; }
.dark .event-bubble::after  { border-right-color: #1e293b; }

/* Below 1024px there is no wide gap beside the photo: a smaller bubble sits
   on the photo's top-right corner instead, without a tail */
@media (max-width: 1023px) {
  .event-bubble {
    top: -14px; left: auto; right: -26px;
    padding: 7px 12px 5px; border-width: 2px;
    font-size: 14px; letter-spacing: 1px;
    box-shadow: -3px -2px 0 rgba(30,64,175,.45), 3px 3px 0 rgba(214,69,65,.75);
  }
  .event-bubble::before, .event-bubble::after { display: none; }
}

/* Room in the right margin (content column edge at 50% + 640px, ~134px
   toggle, 16px clearance): float the switch just right of the content */
@media (min-width: 1620px) {
  .event-toggle { right: auto; left: calc(50% + 652px); }
}

/* ── Focus ring ───────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #1e40af; outline-offset: 3px; border-radius: 3px;
}
