/* Raj Balgobind, one-page CV.
   Standalone stylesheet, TIF Synergy brand palette + type system.
   Self-contained: no dependency on the main site's CSS. */

/* Self-hosted fonts (no Google Fonts network call: CSP and visitor privacy).
   Source Serif 4 and Inter, matching the main site's typography from the
   2026-10-04 rebuild. Both are variable fonts covering the weights used. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/source-serif-4-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --forest:        #1a4a3a;
  --forest-dk:     #163d30;
  --forest-dk2:    #0f2c22;
  --secondary:     #2d6b55;
  --gold:          #b8963e;
  --gold-dk:       #a8862e;
  --cream:         #f7f5f0;
  --paper:         #f0ede6;
  --white:         #ffffff;
  --ink:           #1a1916;
  --text:          #1a1916;
  --text-2:        #5a5751;
  --text-3:        #9a9690;
  --border:        rgba(0,0,0,0.08);
  --border-light:  rgba(247,245,240,0.14);

  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow:    0 2px 18px rgba(0,0,0,0.07);
  --shadow-lg: 0 22px 60px rgba(0,0,0,0.16);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--secondary);
  margin-bottom: 18px;
}
.eyebrow-gold { color: var(--gold); }

.section-title { font-size: clamp(26px, 3.4vw, 38px); color: var(--ink); margin-bottom: 14px; }
.section-title-light { color: var(--cream); }

.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); line-height: 1.6; }
.lede-center { max-width: 56ch; margin-left: auto; margin-right: auto; }

/* Contact details (email + mobile) on the contact section */
.contact-detail { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px; margin: 26px 0 32px; color: rgba(247,245,240,0.82); font-size: 15.5px; }
.contact-detail a { color: var(--gold); text-decoration: none; }
.contact-detail a:hover { text-decoration: underline; }
.contact-k { color: rgba(247,245,240,0.5); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; margin-right: 6px; }

.text-center { text-align: center; }
.justify-center { justify-content: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 13px 26px; border-radius: 999px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dk); }
.btn-ghost { background: transparent; color: currentColor; border-color: rgba(247,245,240,0.4); }
.section-forest .btn-ghost, .section-ink .btn-ghost { color: var(--cream); }

/* ── Top nav ─────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,245,240,0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--forest); text-decoration: none; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: color .15s ease; }
.nav-links a:hover { color: var(--forest); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% 0%, var(--secondary) 0%, var(--forest) 42%, var(--forest-dk2) 100%);
  color: var(--cream);
  padding: clamp(96px, 16vh, 168px) 0 clamp(90px, 14vh, 150px);
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 56px; align-items: center; }
.hero-text { min-width: 0; }
.hero-name { font-size: clamp(44px, 6vw, 80px); font-weight: 700; line-height: 1.02; margin-bottom: 14px; color: #fff; text-wrap: balance; }
.hero-role { font-size: clamp(18px, 2.4vw, 26px); font-weight: 500; color: var(--gold); margin-bottom: 26px; font-family: var(--font-body); }
.hero-lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: rgba(247,245,240,0.86); margin-bottom: 30px; text-wrap: pretty; }

/* Hero portrait — brand-blended: gold inset ring + forest gradient at the
   base so the image melds into the hero (also softens the lanyard/badge). */
.hero-photo { margin: 0; position: relative; aspect-ratio: 4 / 5; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; border-radius: 18px; box-shadow: 0 28px 64px rgba(0,0,0,0.42); }
.hero-photo::after {
  content: ""; position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(184,150,62,0.55);
  background: linear-gradient(180deg, transparent 50%, rgba(15,44,34,0.55) 100%);
}
/* click-to-play intro video — photo is the poster, video is fetched only on click */
.hero-video { display: none; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; background: #000; }
.hero-play {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px 11px 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--ink); background: var(--gold); white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0,0,0,0.34);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.hero-play:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.42); }
.hero-play:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.hero-photo.is-playing img,
.hero-photo.is-playing .hero-play { display: none; }
.hero-photo.is-playing .hero-video { display: block; }
.hero-photo.is-playing::after { content: none; }
/* Back-to-photo control: the only way back once is-playing hides the photo.
   Hidden until playback starts; top-left so it never collides with the
   video's own control bar at the bottom. */
.hero-back {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  display: none; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--paper); background: rgba(15,44,34,0.72);
  transition: background 0.25s var(--ease);
}
.hero-back:hover { background: rgba(15,44,34,0.88); }
.hero-back:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.hero-photo.is-playing .hero-back { display: inline-flex; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.hero-chip {
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(247,245,240,0.08); border: 1px solid var(--border-light); color: rgba(247,245,240,0.9);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* floating accent orbs */
.hero-orbs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(8px); opacity: 0.5; }
.orb-1 { width: 420px; height: 420px; right: -120px; top: -140px; background: radial-gradient(circle, rgba(184,150,62,0.45), transparent 70%); animation: float1 14s var(--ease) infinite; }
.orb-2 { width: 320px; height: 320px; left: -100px; bottom: -120px; background: radial-gradient(circle, rgba(95,212,202,0.30), transparent 70%); animation: float2 18s var(--ease) infinite; }
.orb-3 { width: 200px; height: 200px; right: 22%; bottom: 8%; background: radial-gradient(circle, rgba(45,107,85,0.55), transparent 70%); animation: float1 20s var(--ease) infinite reverse; }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-26px,30px) scale(1.08); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(34px,-24px) scale(1.12); } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 2; color: rgba(247,245,240,0.6); animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ── Section shells ──────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-cream { background: var(--cream); }
.section-paper { background: var(--paper); }
.section-white { background: var(--white); }
.section-forest { background: linear-gradient(160deg, var(--forest) 0%, var(--forest-dk) 100%); color: var(--cream); }
.section-ink { background: var(--ink); color: var(--cream); }

/* ── About ───────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 48px; align-items: start; margin-top: 30px; }
.about-copy p + p { margin-top: 18px; }
.about-side { position: sticky; top: 92px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.stat { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.stat:last-child { border-bottom: 0; padding-bottom: 0; }
.stat:first-child { padding-top: 0; }
.stat-num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--forest); line-height: 1; }
.stat-label { font-size: 13.5px; color: var(--text-2); }

/* ── Expertise chips ─────────────────────────────────────── */
.chip-block { margin-top: 34px; }
.chip-block:first-of-type { margin-top: 26px; }
.chip-head { font-family: var(--font-body); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  font-size: 14px; font-weight: 500; padding: 9px 16px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border); color: var(--text);
  transition: transform .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.chips li:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--forest); }
.chips-mono li { font-family: var(--font-mono); font-size: 13px; }

/* ── Experience cards ────────────────────────────────────── */
.exp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 34px; }
.exp-card {
  position: relative; background: rgba(247,245,240,0.05);
  border: 1px solid var(--border-light); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 28px 30px;
  transition: transform .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease);
}
.exp-card:hover { transform: translateY(-4px); background: rgba(247,245,240,0.09); box-shadow: var(--shadow-lg); }
.exp-period { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--gold); margin-bottom: 10px; }
.exp-company { font-size: 21px; color: #fff; margin-bottom: 4px; }
.exp-role { font-size: 14.5px; font-weight: 600; color: rgba(247,245,240,0.92); margin-bottom: 12px; }
.exp-note { font-size: 14.5px; line-height: 1.6; color: rgba(247,245,240,0.72); }

/* Hover reveal: the description wipes in left-to-right on hover (xaviro-style).
   Only on hover-capable devices — touch/mobile keeps the text visible. The
   note stays in the DOM and accessibility tree, so screen readers still read
   it. Height is reserved, so no layout shift in the grid. */
@media (hover: hover) {
  .exp-card .exp-note {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transition: clip-path 0.55s var(--ease), opacity 0.35s var(--ease);
  }
  .exp-card:hover .exp-note,
  .exp-card:focus-within .exp-note {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .exp-card .exp-note { transition: none; }
}

/* ── Quotes ──────────────────────────────────────────────── */
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 32px; }
.quote-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.quote-card blockquote { font-size: 15.5px; line-height: 1.6; color: var(--text); position: relative; padding-top: 18px; flex: 1; }
.quote-card blockquote::before { content: "\201C"; position: absolute; top: -10px; left: -4px; font-family: var(--font-display); font-size: 56px; line-height: 1; color: var(--gold); opacity: 0.45; }
.quote-card figcaption { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.q-name { font-weight: 700; color: var(--forest); font-size: 14.5px; }
.q-role { font-size: 13px; color: var(--text-2); }

/* ── Education ───────────────────────────────────────────── */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; margin-top: 32px; }
.edu-head { font-family: var(--font-body); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 16px; }
.edu-list { list-style: none; }
.edu-list li { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.edu-list li:last-child { border-bottom: 0; }
.edu-title { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.edu-org { font-size: 13.5px; color: var(--text-2); }
.edu-year { color: var(--text-3); white-space: nowrap; }
.edu-year::before { content: "· "; }

/* ── Footer ──────────────────────────────────────────────── */
.cv-footer { background: var(--forest-dk2); color: rgba(247,245,240,0.7); padding: 26px 0; }
.cv-footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }

/* ── Scroll-reveal animation ─────────────────────────────── */
/* Gated on html.js, set by cv.js as its first statement. cv.js is loaded
   render-blocking in <head> (not at the bottom of <body>) so that line
   lands before first paint: the hidden starting state only exists once
   cv.js is confirmed running, so a visitor without JS, or with a failed
   cv.js load, sees the page fully visible instead of blank. See cv.js for
   the marker class and the IntersectionObserver that adds .in. */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.js .reveal.in { opacity: 1; transform: translateY(0); }
/* stagger cards / chips / quotes within a group */
.exp-card:nth-child(2) { transition-delay: .06s; }
.exp-card:nth-child(3) { transition-delay: .12s; }
.exp-card:nth-child(4) { transition-delay: .06s; }
.exp-card:nth-child(5) { transition-delay: .12s; }
.exp-card:nth-child(6) { transition-delay: .06s; }
.exp-card:nth-child(7) { transition-delay: .12s; }
.quote-card:nth-child(2) { transition-delay: .1s; }
.quote-card:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Matches the html.js .reveal specificity above so this still wins when
     JS is running; cv.js also short-circuits and adds .in immediately under
     reduced motion, this is the belt-and-braces CSS-only path. */
  html.js .reveal, .reveal { opacity: 1; transform: none; transition: none; }
  .orb, .scroll-cue { animation: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; max-width: 320px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-side { position: static; }
  .exp-grid { grid-template-columns: 1fr; }
  .quote-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  /* The page runs ~11k px on a phone, so the section links stay reachable
     instead of being hidden. A scrolling row beats a drawer here: no JS
     state, no focus trap, and the destinations stay visible. */
  .nav-inner { padding: 0 0 0 20px; gap: 14px; }
  .nav-brand { flex: none; }
  .nav-links {
    display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    padding-right: 20px; margin-left: auto;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  /* flex: none stops the links shrinking to fit; they must overflow so the
     row scrolls instead of clipping the labels. */
  .nav-links a { white-space: nowrap; flex: none; }
  .wrap { padding: 0 20px; }
}

/* Touch targets: 44px minimum per WCAG 2.5.5, scoped to coarse-pointer (touch)
   devices only. Left unscoped these grow the contact row ~24px on desktop and
   widen the short nav labels against the 26px gap, a real layout change the
   old comment claimed didn't happen. Mouse/trackpad visitors already meet the
   AA target size (2.5.8, 24px) from the existing desktop layout, so nothing
   is lost by keeping this rule out of the fine-pointer case. */
@media (pointer: coarse) {
  .nav-brand { display: inline-flex; align-items: center; min-height: 44px; }
  .nav-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .scroll-cue { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .contact-detail a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero-back { min-height: 44px; }
}
