/* ============================================================
   Ravi Agarwal — personal brand · BLUE EDITION
   Direction: light editorial · architectural label-rail ·
   royal-blue primary · Bricolage Grotesque + Newsreader
   Committed light theme (deliberate contrast to the dark edition)
   ============================================================ */

/* Self-hosted Inter — single variable file, latin subset, covers 400–700 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Cool-biased neutrals — chosen, not warm-cream default */
  --paper:     #f4f6f9;
  --paper-2:   #ffffff;
  --ink:       #0c1626;
  --ink-soft:  #566072;
  --ink-faint: #6b7482; /* 4.72:1 on white — WCAG AA */

  /* Primary — royal blue */
  --blue:      #1a53f0;
  --blue-deep: #0b34c0;

  --line:      #e2e6ec;
  --line-2:    #d3d9e2;

  --radius:    4px;
  --radius-lg: 10px;
  --max: 1180px;

  --display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --body:    "Inter", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* faint architectural dot grid */
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 30px 30px;
  background-attachment: fixed;
}

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }

::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
/* Blue band — the default blue ring would be invisible against it */
.mission :focus-visible { outline-color: #fff; }
main:focus { outline: none; }

/* Skip link — off-screen until focused (fixed + px offset so it can't depend
   on the containing block's height) */
.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  background: var(--paper-2); color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
  padding: 0.7rem 1.1rem; border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 10px 30px -12px rgba(12, 22, 38, 0.4);
  transition: top 0.2s var(--ease);
}
.skip-link:focus, .skip-link:focus-visible { top: 1rem; }

/* <picture> must fill its shell so the inner img can size to 100% */
.hero-avatar picture, .portrait-shell picture { display: block; width: 100%; height: 100%; }

/* Shared label */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; color: var(--blue);
  margin-bottom: 1.3rem;
}
.tag-tick { width: 22px; height: 2px; background: var(--blue); margin-right: 0.7rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display); font-weight: 600; font-size: 0.92rem;
  padding: 0.9rem 1.6rem; border-radius: var(--radius);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -10px rgba(26, 83, 240, 0.6); }
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(26, 83, 240, 0.7); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 246, 249, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-color: var(--line); background: rgba(244, 246, 249, 0.92); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }

.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.22rem; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 2.2rem; }
.nav a { font-family: var(--display); font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); transition: color 0.2s; }
.nav a:not(.nav-cta):hover { color: var(--ink); }
.nav-idx { color: var(--blue); font-size: 0.7rem; font-weight: 600; margin-right: 0.15rem; vertical-align: 2px; }
.nav-cta {
  background: var(--ink); color: #fff !important;
  padding: 0.55rem 1.15rem; border-radius: var(--radius);
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--blue); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: 0.3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* visibility:hidden keeps the closed panel's links out of the tab order */
.mobile-nav { display: none; flex-direction: column; padding: 0 1.25rem; overflow: hidden; max-height: 0; visibility: hidden; transition: max-height 0.35s ease, visibility 0.35s ease; background: var(--paper-2); }
.mobile-nav a { padding: 0.95rem 0; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 500; }
.mobile-nav.open { max-height: 320px; padding-bottom: 1rem; visibility: visible; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem); text-align: center; }
.hero-center { display: flex; flex-direction: column; align-items: center; }

.hero-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  margin: 0.4rem auto 1.9rem;
  overflow: hidden;
  border: 3px solid var(--paper-2);
  box-shadow: 0 0 0 2px var(--blue), 0 14px 30px -12px rgba(12, 22, 38, 0.4);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; display: block; }

.hero .tag { justify-content: center; }
.tag-tick { animation: none; }
.hero h1 { font-size: clamp(2.8rem, 6.5vw, 5.2rem); letter-spacing: -0.03em; max-width: 18ch; }
.hero h1 .name { position: relative; display: inline-block; color: var(--blue); }
.underline {
  position: absolute; left: 0; bottom: -0.14em; width: 100%; height: 0.36em;
  color: var(--blue); overflow: visible;
}
.underline path { stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw 1.1s var(--ease) 0.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.roles {
  font-family: var(--display); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  color: var(--ink-soft);
  margin: 1.5rem 0 1.4rem;
}
.lead { font-size: 1.18rem; line-height: 1.6; color: var(--ink-soft); max-width: 40ch; margin-bottom: 2.2rem; }
.hero .lead { max-width: 52ch; margin-inline: auto; }
.actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero .actions { justify-content: center; }

/* Vertical rule connector */
.hero-rule { width: 1px; height: 60px; background: var(--line-2); margin: clamp(2rem,4vw,3.2rem) auto clamp(1.6rem,3vw,2.2rem); position: relative; }
.hero-rule::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

/* Wide featured portrait plate with blue offset block */
.hero-plate { position: relative; width: min(100%, 620px); margin: 0 auto; }
.portrait-block {
  position: absolute; z-index: 0;
  top: 22px; left: 22px; right: -22px; bottom: -22px;
  background: var(--blue);
  border-radius: var(--radius-lg);
}
.portrait-shell {
  position: relative; z-index: 1;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  box-shadow: 0 30px 60px -30px rgba(12, 22, 38, 0.4);
  aspect-ratio: 16 / 10;
}
.portrait-shell img { width: 100%; height: 100%; object-fit: cover; object-position: center 26%; display: block; }
.badge {
  position: absolute; z-index: 2; right: -22px; bottom: 34px;
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 0.85rem 1.1rem; border-radius: var(--radius);
  box-shadow: 0 18px 40px -18px rgba(12, 22, 38, 0.35);
}
.badge strong { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--ink); }
.badge strong span { color: var(--blue); }
.badge-txt { font-family: var(--display); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); line-height: 1.45; }

/* ============================================================
   Editorial sections — label rail
   ============================================================ */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-line { border-top: 1px solid var(--line); }

.editorial { display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.rail { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 0.6rem; }
.rail-idx { font-family: var(--display); font-weight: 700; font-size: 2.2rem; color: var(--blue); line-height: 1; }
.rail-label { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--ink); }
.rail-line { height: 2px; width: 46px; background: var(--blue); margin-top: 0.4rem; }

.editorial-body h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); max-width: 20ch; margin-bottom: 1.75rem; }
.prose { max-width: 60ch; }
.prose p { font-size: 1.08rem; line-height: 1.7; color: #3a4453; margin-bottom: 1.25rem; }
.prose p:last-child { margin-bottom: 0; }
.inline-link {
  color: var(--blue); font-weight: 600;
  background-image: linear-gradient(var(--blue), var(--blue));
  background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.3s var(--ease), color 0.2s;
}
.inline-link:hover { color: var(--blue-deep); background-size: 100% 2px; }

/* Ledger (experience list) */
.ledger { list-style: none; margin-top: 3rem; border-top: 1px solid var(--line); }
.ledger-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem;
  padding: 1.9rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.ledger-row:hover { padding-left: 0.6rem; }
.ledger-year { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; color: var(--blue); padding-top: 0.35rem; }
.ledger-main h3 { font-size: 1.55rem; }
.ledger-role { font-family: var(--display); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin: 0.3rem 0 0.7rem; }
.ledger-desc { color: var(--ink-soft); font-size: 1.02rem; max-width: 52ch; }

/* ============================================================
   Mission — inverted blue band (the bold moment)
   ============================================================ */
.mission {
  position: relative; overflow: hidden;
  background: var(--blue);
  color: #fff;
  padding: clamp(5rem, 11vw, 8.5rem) 0;
}
.mission::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(120deg, #000, transparent 65%);
          mask-image: linear-gradient(120deg, #000, transparent 65%);
  opacity: 0.6;
}
.mission-inner { position: relative; max-width: 760px; }
.mission-label { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.8rem; line-height: 1.4; color: #fff; margin-bottom: 1.5rem; }
.mission blockquote { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.12; letter-spacing: -0.02em; color: rgba(255,255,255,0.88); text-wrap: balance; }
.mission blockquote em { font-style: normal; color: #fff; }
.mission-attrib { margin-top: 2.25rem; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; }

/* ============================================================
   Contact
   ============================================================ */
.contact { text-align: center; border-top: 1px solid var(--line); }
.contact-inner { max-width: 44ch; margin-inline: auto; }
.contact .tag { justify-content: center; }
.contact h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 1.2rem; }
.contact .lead { margin-inline: auto; margin-bottom: 2.2rem; }
.contact .actions { justify-content: center; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line-2); background: var(--paper-2); padding: 2.5rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.footer-note { font-family: var(--display); font-weight: 500; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.footer-copy { font-size: 0.85rem; color: var(--ink-faint); }
.footer-credit { flex-basis: 100%; text-align: center; font-size: 0.82rem; color: var(--ink-soft); padding-top: 1rem; margin-top: 0.4rem; border-top: 1px solid var(--line); }
.footer-credit a { color: var(--blue); font-weight: 600; transition: color 0.2s; }
.footer-credit a:hover { color: var(--blue-deep); }

/* ============================================================
   Motion
   ============================================================ */
/* Default is fully visible. Every animation below is gated on .js, so if the
   scripts are disabled or fail the page still renders complete. */
.reveal { opacity: 1; transform: none; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Hero entrance — short, near-zero delay so it never gates LCP */
.js .reveal { opacity: 0; transform: translateY(20px); animation: rise 0.55s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 0.05s); }
/* In-section reveals wait for the IntersectionObserver in script.js */
.js .section .reveal, .js .mission .reveal { animation: none; opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .section .reveal.in, .js .mission .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .underline path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .editorial { grid-template-columns: 1fr; gap: 1.75rem; }
  .rail { position: static; flex-direction: row; align-items: center; gap: 0.9rem; }
  .rail-idx { font-size: 1.4rem; }
  .rail-line { display: none; }
  .footer-inner { justify-content: flex-start; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .badge { right: 8px; bottom: 14px; }
  .ledger-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .portrait-block { right: -14px; bottom: -14px; top: 16px; left: 16px; }
}
