/* =========================================================
   About extras (about-extra.js): the local time, the career path that
   follows the pointer, and snapshots that lean toward it.
   ========================================================= */

/* ---------- Local time ----------
   A small line under the intro: the time in Bengaluru and a guess at what
   I'm doing. The dot is green in working hours, amber outside them, and
   breathes gently (Lively only). */
.ab-now-time { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; padding: 0.375rem 0.75rem 0.375rem 0.625rem; border: 1px solid var(--hairline); border-radius: 999px; background: color-mix(in srgb, var(--ink) 3%, var(--bg)); font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft); }
.ab-now-time:has(.ab-now-text:empty) { visibility: hidden; } /* its space is kept until the time is in */
.ab-now-time b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ab-now-dot { position: relative; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #1f9d55; }
.ab-now-time.is-off .ab-now-dot { background: #d08a12; }
@media (prefers-reduced-motion: no-preference) {
  .ab-now-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: now-breathe 2.4s ease-out infinite; }
}
@keyframes now-breathe { from { transform: scale(1); opacity: 0.55; } to { transform: scale(2.6); opacity: 0; } }

/* ---------- Career path ----------
   Pointing at a job draws a bolder line along the path from
   the start up to that job and lifts its dot; the other jobs step back. */
.pl-trace { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len, 0) 99999; transition: stroke-dasharray 0.6s cubic-bezier(0.23, 1, 0.32, 1); pointer-events: none; }
.ab-path .pl-node.is-focus { transform: scale(1.45); }
.ab-path.is-tracing .path-grid li { transition: opacity 0.25s ease; }
.ab-path.is-tracing .path-grid li:not(.is-focus) { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .pl-trace { transition: none; } }
/* Dark theme: the line glows softly, the bold trace a little more, and the
   "now" dot (and any dot you point at) carries a bright halo, with the
   pulsing ring glowing as it spreads. */
:root[data-theme="dark"] .ab-path .pl-main { filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.35)) drop-shadow(0 0 8px rgba(170, 185, 255, 0.22)); }
:root[data-theme="dark"] .ab-path .pl-trace { filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45)) drop-shadow(0 0 12px rgba(170, 185, 255, 0.3)); }
:root[data-theme="dark"] .ab-path .pl-now, :root[data-theme="dark"] .ab-path .pl-node.is-focus { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 12px rgba(170, 185, 255, 0.45)); }
:root[data-theme="dark"] .ab-path .pl-ring { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5)); }
@media (forced-colors: active) { .ab-path .pl-main, .ab-path .pl-trace, .ab-path .pl-node, .ab-path .pl-ring { filter: none !important; } }

/* ---------- Snapshots lean in ----------
   On the wide table, each photo near the pointer drifts a few pixels
   toward it and lifts a little (transform only; its own turn, size and
   scroll depth live in rotate, scale and translate). */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ab-pile .ab-snap.is-landed { transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s ease; }
  .ab-pile .ab-snap.is-near { box-shadow: 0 0.25rem 0.5rem rgba(13, 13, 13, 0.08), 0 1.5rem 2.75rem -1rem rgba(13, 13, 13, 0.4); }
}

/* ---------- The first screen arrives as one ----------
   The title, the intro and the time rise in one after another as the
   snapshots start to drop (.ab-table.is-in), and the numbers and At a glance
   just under them follow on the same beat, instead of the words showing at
   once and the rest fading in a second later. */
@media (prefers-reduced-motion: no-preference) {
  .ab-table :is(.ab-title .hl, .ab-lede, .ab-now-time) { transition: opacity 0.8s var(--ease-out), translate 0.8s var(--ease-out); }
  .js .ab-table:not(.is-in) :is(.ab-title .hl, .ab-lede, .ab-now-time) { opacity: 0; translate: 0 0.75rem; }
  .ab-table .ab-title .hl:nth-child(2) { transition-delay: 80ms; }
  .ab-table .ab-lede { transition-delay: 160ms; }
  .ab-table .ab-now-time { transition-delay: 240ms; }
  .ab-table ~ .ab-stats.ab-r { transition-delay: 320ms; }
  .ab-table ~ .ab-glance > .ab-h2.ab-r { transition-delay: 400ms; }
  .ab-table ~ .ab-glance > .ab-facts.ab-r { transition-delay: 480ms; }
}

/* "Outside the brief": its typed last word (about-extra.js). A thin caret
   in the ink colour blinks on and off while it waits, and holds solid while
   typing. With motion reduced or in Calm there is no caret. */
.ab-rot { white-space: nowrap; }
/* The changing word, and its caret, in the site's blue (lighter in the
   dark theme). */
.ab-rot { color: var(--blue-500); }
:root[data-theme="dark"] .ab-rot { color: var(--blue-300); }
@media (forced-colors: active) { .ab-rot { color: CanvasText; } .ab-caret { background: CanvasText; } }
.ab-caret { display: inline-block; width: 0.06em; height: 0.82em; margin-left: 0.05em; vertical-align: -0.04em; background: currentColor; animation: ab-caret 1.05s steps(1) infinite; }
.ab-rot.is-typing .ab-caret { animation: none; }
@keyframes ab-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ab-caret { display: none; } }

/* ---------- At a glance: who ----------
   The photo (once the Home signature) at its old size, with the
   name and role beside it, heading the facts column above "Based in".
   Pointing at the photo swaps it for the second one, as it did on Home
   (not with reduced motion or Calm, not on touch). */
@media (min-width: 641px) {
  .ab-glance .ab-h2 { grid-column: 1; grid-row: 1 / span 2; }
  .ab-glance .ab-sig { grid-column: 2; grid-row: 1; }
  .ab-glance .ab-facts { grid-column: 2; grid-row: 2; }
}
.ab-glance { row-gap: 1.25rem; }
.ab-sig { display: flex; align-items: center; gap: 0.875rem; margin: 0; }
.ab-sig-dp { position: relative; flex: none; width: 3.25rem; height: 3.25rem; }
.ab-sig-dp img { display: block; width: 100%; height: 100%; border-radius: 0.8125rem; object-fit: cover; }
.ab-sig-alt { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html:not([data-motion="calm"]) .ab-sig-dp:hover .ab-sig-alt { opacity: 1; }
}
.ab-sig-text b { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: 0.012em; color: var(--ink); }
.ab-sig-text span { display: block; margin-top: 0.1875rem; font-size: 0.9375rem; line-height: 1.4; letter-spacing: 0.015em; color: var(--ink-soft); }
/* Phones: the cards are a plain swipeable row; touching one doesn't dim
   the others. */
@media (max-width: 640px) {
  .ab-path.is-tracing .path-grid li:not(.is-focus) { opacity: 1; }
  .ab-path .path-grid li { transition: none; }
}
