/* =============================================================================
   Ari Datta — personal site
   Layered on Bootstrap 5.3. All theming is done by overriding Bootstrap's own
   CSS custom properties; no !important is used anywhere in this file.

   Contents
     01  Design tokens (light + dark)
     02  Bootstrap variable mapping
     03  Base & typography
     04  Section rhythm & headings
     05  Navbar
     06  Buttons & links
     07  Hero, portrait, stats
     08  Prose
     09  Timeline
     10  Achievement cards
     11  Expertise grid
     12  Panels (education) & beyond work
     13  Contact & form
     14  Footer
     15  Motion / reveal
     16  Accessibility & focus
     17  Page grid & reading progress
     18  Motion — hero overture, draw-ins, hover
   ========================================================================== */


/* 01 — DESIGN TOKENS ======================================================= */

:root {
  /* Warm off-white ground, near-black navy ink, one restrained brass accent. */
  --ad-bg:        #fbf8f3;
  --ad-bg-alt:    #f4f0e8;
  --ad-surface:   #ffffff;
  --ad-ink:       #10161e;
  --ad-body:      #3a424c;
  --ad-muted:     #5c6672;
  --ad-accent:    #7d5f22;
  --ad-accent-2:  #8a6a28;
  --ad-line:      #e2dcd1;
  --ad-line-soft: #ece7dd;
  --ad-deep:      #101820;
  --ad-deep-ink:  #f3f0ea;

  --ad-accent-rgb: 125, 95, 34;
  --ad-ink-rgb:    16, 22, 30;

  --ad-serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --ad-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --ad-gutter: clamp(1.25rem, 4vw, 3rem);
  --ad-section-y: clamp(4.5rem, 9vw, 8.5rem);
}

[data-bs-theme="dark"] {
  --ad-bg:        #0d1218;
  --ad-bg-alt:    #111820;
  --ad-surface:   #141b23;
  --ad-ink:       #f2efe9;
  --ad-body:      #c7ced6;
  --ad-muted:     #98a2ad;
  --ad-accent:    #d2ae68;
  --ad-accent-2:  #d2ae68;
  --ad-line:      #262f3a;
  --ad-line-soft: #1d252e;
  --ad-deep:      #080c11;
  --ad-deep-ink:  #f2efe9;

  --ad-accent-rgb: 210, 174, 104;
  --ad-ink-rgb:    242, 239, 233;
}


/* 02 — BOOTSTRAP VARIABLE MAPPING ========================================== */

:root,
[data-bs-theme="dark"] {
  --bs-body-bg: var(--ad-bg);
  --bs-body-color: var(--ad-body);
  --bs-emphasis-color: var(--ad-ink);
  --bs-heading-color: var(--ad-ink);
  --bs-secondary-color: var(--ad-muted);
  --bs-border-color: var(--ad-line);
  --bs-border-radius: 2px;
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 3px;

  --bs-body-font-family: var(--ad-sans);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.75;
  --bs-font-sans-serif: var(--ad-sans);

  --bs-primary: var(--ad-ink);
  --bs-link-color-rgb: var(--ad-accent-rgb);
  --bs-link-hover-color-rgb: var(--ad-ink-rgb);
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color .2s ease;
}

.navbar-brand, .navbar-brand:hover { text-decoration: none; }

:root { --bs-primary-rgb: 16, 22, 30; }
[data-bs-theme="dark"] { --bs-primary-rgb: 242, 239, 233; }


/* 03 — BASE & TYPOGRAPHY =================================================== */

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  background-color: var(--ad-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.container { padding-inline: var(--ad-gutter); max-width: 1180px; }

h1, h2, h3, .h6 {
  font-family: var(--ad-serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--ad-ink);
}

h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.15; margin: 0; }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.3; margin: 0; }

/* Small caps-ish label used for overlines, tags and meta */
.overline,
.section-num,
.card-tag,
.contact-label,
.tl-date,
.beyond-date,
.panel-meta,
.stat-label,
.form-note {
  font-family: var(--ad-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ad-muted);
}


/* 04 — SECTION RHYTHM & HEADINGS =========================================== */

.section { padding-block: var(--ad-section-y); }

.section-alt {
  background-color: var(--ad-bg-alt);
  border-block: 1px solid var(--ad-line-soft);
}

.section-head { margin-bottom: 2.75rem; }

.section-head .section-num {
  display: block;
  color: var(--ad-accent);
  margin-bottom: 0.9rem;
}

.section-head .section-num::after {
  content: "";
  display: inline-block;
  width: 2.25rem;
  height: 1px;
  margin-left: 0.85rem;
  vertical-align: 0.22em;
  background-color: var(--ad-accent);
}

.section-intro {
  max-width: 46ch;
  margin: 1.1rem 0 0;
  color: var(--ad-muted);
  font-size: 1.0625rem;
}


/* 05 — NAVBAR ============================================================== */

.site-nav {
  background-color: transparent;
  padding-block: 1.1rem;
  transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease,
              border-color .3s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.is-scrolled {
  background-color: color-mix(in srgb, var(--ad-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--ad-line);
  box-shadow: 0 1px 24px rgba(16, 22, 30, .06);
  padding-block: 0.7rem;
}

@supports not (background-color: color-mix(in srgb, red 50%, transparent)) {
  .site-nav.is-scrolled { background-color: var(--ad-bg); }
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  color: var(--ad-ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  font-family: var(--ad-serif);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ad-accent);
  border: 1px solid var(--ad-line);
  background-color: var(--ad-surface);
}

.brand-name {
  font-family: var(--ad-serif);
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  color: var(--ad-ink);
}

.site-nav .nav-link {
  font-size: 0.92rem;
  color: var(--ad-muted);
  padding: 0.4rem 0;
  margin-inline: 0.95rem;
  position: relative;
  transition: color .2s ease;
}

.site-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active { color: var(--ad-ink); }
.site-nav .nav-link.active::after { transform: scaleX(1); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  color: var(--ad-ink);
  background-color: var(--ad-surface);
  border: 1px solid var(--ad-line);
  border-radius: 2px;
  transition: border-color .2s ease, color .2s ease;
}

.icon-btn:hover { border-color: var(--ad-accent); color: var(--ad-accent); }
.icon-btn .icon-moon { display: none; }
[data-bs-theme="dark"] .icon-btn .icon-sun { display: none; }
[data-bs-theme="dark"] .icon-btn .icon-moon { display: block; }

.nav-panel {
  --bs-offcanvas-bg: var(--ad-bg);
  --bs-offcanvas-width: 19rem;
  --bs-offcanvas-border-color: var(--ad-line);
}

.nav-panel .panel-title {
  font-family: var(--ad-serif);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.nav-panel .nav-link { font-size: 1.05rem; margin-inline: 0; padding-block: 0.7rem; }
.nav-panel .navbar-nav { border-top: 1px solid var(--ad-line-soft); }
.nav-panel .nav-item { border-bottom: 1px solid var(--ad-line-soft); }

@media (min-width: 992px) {
  .nav-panel .navbar-nav,
  .nav-panel .nav-item { border: 0; }
}


/* 06 — BUTTONS & LINKS ===================================================== */

.btn {
  --bs-btn-padding-x: 1.6rem;
  --bs-btn-padding-y: 0.72rem;
  --bs-btn-font-size: 0.95rem;
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: 2px;
  letter-spacing: 0.01em;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn-primary {
  --bs-btn-bg: var(--ad-ink);
  --bs-btn-border-color: var(--ad-ink);
  --bs-btn-color: var(--ad-bg);
  --bs-btn-hover-bg: var(--ad-accent);
  --bs-btn-hover-border-color: var(--ad-accent);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: var(--ad-accent);
  --bs-btn-active-border-color: var(--ad-accent);
  --bs-btn-active-color: #ffffff;
}

[data-bs-theme="dark"] .btn-primary {
  --bs-btn-hover-color: var(--ad-deep);
  --bs-btn-active-color: var(--ad-deep);
}

.btn-outline-primary {
  --bs-btn-color: var(--ad-ink);
  --bs-btn-border-color: var(--ad-line);
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-color: var(--ad-accent);
  --bs-btn-hover-border-color: var(--ad-accent);
  --bs-btn-active-bg: transparent;
  --bs-btn-active-color: var(--ad-accent);
  --bs-btn-active-border-color: var(--ad-accent);
}


/* 07 — HERO, PORTRAIT, STATS =============================================== */

.hero {
  padding-top: clamp(7rem, 15vh, 10.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}


.hero-name {
  font-size: clamp(3rem, 8.5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0.55rem 0 0;
}

.hero-role {
  font-family: var(--ad-serif);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ad-accent);
  margin: 1rem 0 0;
}

.hero-lead {
  max-width: 46ch;
  margin: 1.4rem 0 0;
  font-size: 1.125rem;
  color: var(--ad-body);
}

.hero-actions { margin-top: 2.1rem; }

/* Two equal, stacked buttons rather than two ragged ones on narrow screens */
@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
}

.portrait {
  margin: 2.5rem 0 0;
  max-width: min(20rem, 72vw);
  position: relative;
}

@media (min-width: 992px) {
  .portrait { margin: 0 0 0 auto; max-width: 26rem; }
}

/* Offset hairline frame — only where the layout has room for it */
@media (min-width: 992px) {
  .portrait::before {
    content: "";
    position: absolute;
    inset: 1.1rem -1.1rem -1.1rem 1.1rem;
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    z-index: 0;
  }
}

.portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  filter: saturate(0.96);
}

/* Proof-point stats row */
.stats {
  list-style: none;
  margin: clamp(3.5rem, 7vw, 5.5rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--ad-line);
}

.stat {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--ad-line-soft);
}

.stat-num {
  display: block;
  font-family: var(--ad-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ad-accent);
}

.stat-label {
  display: block;
  margin-top: 0.6rem;
  line-height: 1.5;
  letter-spacing: 0.09em;
  max-width: 17ch;
}

@media (min-width: 992px) {
  .stats { display: flex; }
  .stat { border-bottom: 0; border-left: 1px solid var(--ad-line-soft); padding-left: 1.5rem; }
  .stat:first-child { border-left: 0; padding-left: 0; }
}


/* 08 — PROSE =============================================================== */

.prose { max-width: 68ch; }
.prose p { margin-bottom: 1.35rem; }
.prose p:last-child { margin-bottom: 0; }

.prose .lead-para {
  font-family: var(--ad-serif);
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.014em;
  color: var(--ad-ink);
  margin-bottom: 1.75rem;
}


/* 09 — TIMELINE ============================================================
   One left-aligned rail at every breakpoint; on lg+ the meta column sits to
   the right of the rail alongside the card, never as a second opposing column. */

.timeline {
  list-style: none;
  position: relative;
  margin: 0;
  padding: 0 0 0 1.9rem;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
}

.timeline::before { bottom: 0; background-color: var(--ad-line); }

/* Filled by --rail from main.js as the section scrolls past */
.timeline::after {
  height: var(--rail, 0%);
  background-color: var(--ad-accent);
}

.tl-item { position: relative; padding-bottom: clamp(2.75rem, 5vw, 4rem); }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -2.28rem;
  top: 0.6rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--ad-bg-alt);
  border: 1px solid var(--ad-accent);
}

.tl-item:first-child::before { background-color: var(--ad-accent); }

.tl-date { margin: 0; color: var(--ad-accent); }
.tl-org { margin: 0.45rem 0 0; font-size: 0.95rem; color: var(--ad-muted); }

.tl-card {
  background-color: var(--ad-surface);
  border: 1px solid var(--ad-line);
  border-radius: 3px;
  padding: clamp(1.35rem, 2.6vw, 2rem);
}

.tl-sub {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--ad-muted);
}

.tl-summary {
  margin: 1rem 0 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ad-line-soft);
  color: var(--ad-body);
}

.tl-points { list-style: none; margin: 0; padding: 0; }

.tl-points li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
  font-size: 1rem;
  line-height: 1.65;
}

.tl-points li:last-child { margin-bottom: 0; }

.tl-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background-color: var(--ad-accent);
}

.tl-points strong { color: var(--ad-ink); font-weight: 600; }
.tl-points-more { margin-top: 0.85rem; }

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.35rem;
  padding: 0;
  font-family: var(--ad-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ad-accent);
  background: none;
  border: 0;
}

.more-btn:hover { text-decoration: underline; }

.more-btn-chev {
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .25s ease;
}

.more-btn[aria-expanded="true"] .more-btn-chev {
  transform: rotate(225deg) translate(-1px, -1px);
}

/* Reclaim measure inside the cards on the smallest screens */
@media (max-width: 575.98px) {
  .timeline { padding-left: 1.35rem; }
  .tl-item::before { left: -1.69rem; }
  .tl-card { padding: 1.15rem; }
}


/* 10 — ACHIEVEMENT CARDS ===================================================
   A hairline grid rather than floating cards: reads as a table of record. */

.cards { border-top: 1px solid var(--ad-line); }

.card-item {
  height: 100%;
  padding: clamp(1.6rem, 3vw, 2.2rem) clamp(1.25rem, 2.4vw, 2rem) clamp(1.8rem, 3vw, 2.4rem) 0;
  border-bottom: 1px solid var(--ad-line-soft);
}

.card-item .card-tag { margin: 0 0 0.9rem; color: var(--ad-accent); }
.card-item h3 { margin-bottom: 0.75rem; }
.card-item p:last-child { margin: 0; font-size: 0.98rem; color: var(--ad-muted); }

@media (min-width: 768px) {
  .cards > [class*="col-"] { border-left: 1px solid var(--ad-line-soft); }
  .cards > [class*="col-"]:nth-child(2n + 1) { border-left: 0; }
  .card-item { padding-left: clamp(1.25rem, 2.4vw, 2rem); }
  .cards > [class*="col-"]:nth-child(2n + 1) .card-item { padding-left: 0; }
}

@media (min-width: 992px) {
  .cards > [class*="col-"]:nth-child(2n + 1) { border-left: 1px solid var(--ad-line-soft); }
  .cards > [class*="col-"]:nth-child(3n + 1) { border-left: 0; }
  .cards > [class*="col-"]:nth-child(2n + 1) .card-item { padding-left: clamp(1.25rem, 2.4vw, 2rem); }
  .cards > [class*="col-"]:nth-child(3n + 1) .card-item { padding-left: 0; }
}


/* 11 — EXPERTISE GRID ====================================================== */

.expertise-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ad-line);
}

.expertise-grid li {
  padding: 1rem 1.25rem 1rem 1.5rem;
  position: relative;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ad-ink);
  border-bottom: 1px solid var(--ad-line-soft);
}

.expertise-grid li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.52rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--ad-accent);
}


/* 12 — PANELS & BEYOND WORK ================================================ */

.panel {
  height: 100%;
  background-color: var(--ad-surface);
  border: 1px solid var(--ad-line);
  border-radius: 3px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

.panel-meta { margin: 0 0 1rem; }
.panel h3 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
.panel-org { margin: 0.5rem 0 1.1rem; color: var(--ad-accent); font-size: 1rem; }
.panel p:last-child { margin: 0; color: var(--ad-muted); font-size: 1rem; }
.panel-tight p:last-child { margin-top: 0.9rem; }

.beyond-item {
  padding-block: 1.9rem;
  border-top: 1px solid var(--ad-line);
}

.beyond-item:first-child { padding-top: 0; border-top: 0; }
.beyond-item:last-child { padding-bottom: 0; }
.beyond-date { margin: 0 0 0.85rem; color: var(--ad-accent); }
.beyond-org { margin: 0.45rem 0 0.9rem; color: var(--ad-muted); font-size: 0.95rem; }
.beyond-item > p:last-child { margin: 0; max-width: 60ch; }


/* 13 — CONTACT & FORM ====================================================== */

.contact-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--ad-line);
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  align-items: baseline;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--ad-line-soft);
}

.contact-label { flex: 0 0 6.5rem; }
.contact-list a { font-size: 1.05rem; }

.contact-form {
  background-color: var(--ad-surface);
  border: 1px solid var(--ad-line);
  border-radius: 3px;
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.form-note {
  margin: 0 0 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ad-line-soft);
  color: var(--ad-accent);
}

.contact-form .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ad-muted);
  margin-bottom: 0.4rem;
}

.contact-form .form-control {
  --bs-border-radius: 2px;
  background-color: var(--ad-bg);
  border-color: var(--ad-line);
  color: var(--ad-ink);
  padding: 0.65rem 0.85rem;
  font-size: 0.98rem;
}

.contact-form .form-control:focus {
  border-color: var(--ad-accent);
  box-shadow: 0 0 0 3px rgba(125, 95, 34, .16);
}

[data-bs-theme="dark"] .contact-form .form-control:focus {
  box-shadow: 0 0 0 3px rgba(210, 174, 104, .2);
}


/* 14 — FOOTER ============================================================== */

.site-footer {
  background-color: var(--ad-deep);
  color: color-mix(in srgb, var(--ad-deep-ink) 78%, transparent);
  padding-block: 2.25rem;
  font-size: 0.9rem;
}

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  .site-footer { color: #d7d3cb; }
}

.site-footer .to-top { color: var(--ad-deep-ink); }
.site-footer .to-top:hover { color: #d2ae68; text-decoration: underline; }


/* 15 — MOTION / REVEAL ===================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms;
    animation-iteration-count: 1;
    transition-duration: .001ms;
  }
}


/* 16 — ACCESSIBILITY & FOCUS =============================================== */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1100;
  padding: 0.7rem 1.2rem;
  background-color: var(--ad-ink);
  color: var(--ad-bg);
  border-radius: 2px;
  transition: top .2s ease;
}

.skip-link:focus { top: 1rem; color: var(--ad-bg); }

:focus-visible {
  outline: 2px solid var(--ad-accent);
  outline-offset: 3px;
}

.btn:focus-visible,
.icon-btn:focus-visible { outline-offset: 2px; }

::selection { background-color: var(--ad-accent); color: #fff; }


/* 17 — PAGE GRID =========================================================
   A set of fixed vertical hairlines behind the page — an editorial column
   grid, not decoration. Because they are fixed, the opaque sections slide
   over them as you scroll. Inert: aria-hidden in the markup, no pointer
   events. Delete the .ledger div in index.html to remove entirely. */

.ledger {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(var(--ad-ink-rgb), .028) 0 1px,
    transparent 1px 25%
  );
  background-position: 12.5% 0;
}

/* Reading-progress hairline */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1040;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background-color: var(--ad-accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}


/* 18 — MOTION ==============================================================
   Two kinds only: things that rise into place once, and things that draw.
   Nothing loops except the rosette, and nothing bounces. Section 15 already
   flattens all of this under prefers-reduced-motion. */

/* Hero overture — runs on load rather than on intersection, so the sequence
   is guaranteed to play in order on a fresh view. */
@keyframes ad-rise {
  from { opacity: 0; transform: translateY(22px); }
}

@keyframes ad-unmask {
  from { transform: translateY(105%); }
}

@keyframes ad-wipe {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

.rise { animation: ad-rise .9s cubic-bezier(.2, .7, .2, 1) both; }

.hero .overline.rise { animation-delay: .05s; }
.hero-role.rise      { animation-delay: .52s; }
.hero-lead.rise      { animation-delay: .62s; }
.hero-actions.rise   { animation-delay: .72s; }

/* Name rises out from behind a mask, a word at a time */
.hero-name .mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
}

.hero-name .mask > span {
  display: inline-block;
  animation: ad-unmask 1s cubic-bezier(.2, .75, .2, 1) both;
  animation-delay: .18s;
}

.hero-name .mask:nth-of-type(2) > span { animation-delay: .3s; }

.portrait img { animation: ad-wipe 1.15s cubic-bezier(.3, .7, .2, 1) .34s both; }

.portrait::before { animation: ad-rise 1s cubic-bezier(.2, .7, .2, 1) .8s both; }

/* Section rules draw themselves in behind the number */
.section-head .section-num::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1) .15s;
}

.section-head.reveal.is-visible .section-num::after { transform: scaleX(1); }

/* Achievement cards: lift, brass heading, and a rule that sweeps the foot */
.card-item {
  position: relative;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.card-item h3 { transition: color .3s ease; }

.card-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background-color: var(--ad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s cubic-bezier(.2, .7, .2, 1);
}

.card-item:hover { transform: translateY(-4px); }
.card-item:hover h3 { color: var(--ad-accent); }
.card-item:hover::after { transform: scaleX(1); }

/* Experience cards warm slightly under the pointer */
.tl-card { transition: border-color .35s ease, box-shadow .35s ease; }

.tl-card:hover {
  border-color: color-mix(in srgb, var(--ad-accent) 40%, var(--ad-line));
  box-shadow: 0 10px 40px rgba(16, 22, 30, .06);
}

[data-bs-theme="dark"] .tl-card:hover { box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }

/* Expertise entries mark themselves as you run down the list */
.expertise-grid li { transition: color .25s ease, padding-left .25s ease; }
.expertise-grid li::before { transition: transform .25s ease; }
.expertise-grid li:hover { padding-left: 1.8rem; color: var(--ad-accent); }
.expertise-grid li:hover::before { transform: scale(1.6); }

/* Small hover details */
.brand-mark { transition: border-color .25s ease, color .25s ease; }
.navbar-brand:hover .brand-mark { border-color: var(--ad-accent); }
.btn span[aria-hidden] { display: inline-block; transition: transform .25s ease; }
.btn-outline-primary:hover span[aria-hidden] { transform: translateY(3px); }
.to-top span[aria-hidden] { display: inline-block; transition: transform .25s ease; }
.to-top:hover span[aria-hidden] { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .rise,
  .hero-name .mask > span,
  .portrait img,
  .portrait::before,
  .card-item,
  .card-item::after,
  .section-head .section-num::after {
    animation: none;
    transition: none;
  }

  .card-item:hover { transform: none; }
  .scroll-progress { display: none; }
}
