/* =============================================================================
   Gautham Ashok — site stylesheet
   Mobile-first. One variable font. No framework. No build step.

   Colour is entirely semantic tokens, so the dark and light themes are two
   token sets and nothing else. Dark is the default; [data-theme="light"]
   overrides it; a visitor's choice is remembered in localStorage.

   Motion follows one idea: things extend left to right, the way a schedule
   bar does. Gantt bars, section rules and nav underlines all use it. Nothing
   fades up, nothing slides sideways, nothing parallaxes.

   Order: font · tokens · reset · motion · layout · header · hero · gantt ·
          sections · contact · footer · breakpoints · print
   ========================================================================== */

/* ---------- Font ---------------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: dark (default) ---------------------------------------- */
:root {
  --bg:        #0D1A1F;   /* deep sea-slate */
  --bg-2:      #122229;   /* alternating band */
  --fg:        #E9EEEB;   /* body text */
  --fg-2:      #AFC0C5;   /* secondary */
  --fg-3:      #7C8F96;   /* meta, labels */
  --line:      #20343B;
  --line-2:    #344A52;
  --rule-strong: #E9EEEB;

  --accent:      #4E9C7A; /* khareef green — data */
  --accent-soft: #1D3B31;
  --accent-2:    #C99B45; /* frankincense gold — live / focus */

  --invert-bg: #060F13;   /* contact band */
  --invert-fg: #E9EEEB;
  --invert-fg-2: #90A5AC;
  --invert-line: rgba(233, 238, 235, .14);

  --btn-bg: #E9EEEB;
  --btn-fg: #0D1A1F;
  --btn-bg-hover: #FFFFFF;

  --shell: rgba(13, 26, 31, .88);
  --focus: #E7C57F;

  --wrap:   72rem;
  --gutter: 1.25rem;

  --fs-xs:   0.8125rem;
  --fs-sm:   0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md:   1.1875rem;
  --fs-lg:   1.375rem;
  --fs-xl:   1.75rem;

  --rule: 1px solid var(--line);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Tokens: light ------------------------------------------------- */
:root[data-theme="light"] {
  --bg:        #F2F4F2;   /* limestone */
  --bg-2:      #E8ECEA;
  --fg:        #12252E;
  --fg-2:      #3E555F;
  --fg-3:      #566A70;   /* 4.77:1 on the alt band — AA at small sizes */
  --line:      #D1D8D6;
  --line-2:    #B5BFBC;
  --rule-strong: #12252E;

  --accent:      #2F6B54;
  --accent-soft: #CCDDD4;
  --accent-2:    #8A6118;

  --invert-bg: #12252E;
  --invert-fg: #F2F4F2;
  --invert-fg-2: #B7C6CC;
  --invert-line: rgba(242, 244, 242, .16);

  --btn-bg: #12252E;
  --btn-fg: #F2F4F2;
  --btn-bg-hover: #000000;

  --shell: rgba(242, 244, 242, .92);
  --focus: #8A6118;
}

/* ---------- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
p, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }

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

.skip {
  position: absolute; top: 0; left: 0; z-index: 100;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  background: var(--invert-bg); color: var(--invert-fg);
  padding: .75rem 1rem; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 600;
}
.skip:focus { width: auto; height: auto; overflow: visible; clip-path: none; }

/* =============================================================================
   Motion — one idea: extension along the horizontal axis.
   Everything here is opt-in and disabled wholesale under reduced motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* The hero and the Gantt are pure CSS animations on load. They need no
     JavaScript at all, so no real content can ever be stranded invisible. */
  @keyframes ga-extend { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes ga-rise   { from { opacity: 0; transform: translateY(.4rem); }
                         to   { opacity: 1; transform: none; } }
  @keyframes ga-fade   { from { opacity: 0; } to { opacity: 1; } }

  .hero-name    { animation: ga-rise .6s var(--ease) both; }
  .hero-lede    { animation: ga-rise .6s .08s var(--ease) both; }
  .hero-actions { animation: ga-rise .6s .16s var(--ease) both; }

  /* Bars draw along the time axis, top to bottom, once. */
  .gantt-bar {
    transform-origin: left center;
    animation: ga-extend .8s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 250ms);
  }
  .gantt-bar::after {
    animation: ga-fade .3s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 800ms);
  }

  /* The only scroll-triggered effect: a section's rule extends before its
     heading. Purely decorative — the heading itself is never hidden, so if
     the script fails the rule simply appears without drawing. */
  .js .section-head::before { transform: scaleX(0); transition: transform .7s var(--ease); }
  .js .section-head.is-in::before { transform: scaleX(1); }
}

/* ---------- Layout -------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: 3.5rem; border-top: var(--rule); }
.band-alt { background: var(--bg-2); transition: background-color .35s var(--ease); }

/* A section opens with a rule that extends, then its heading. */
.section-head { position: relative; padding-top: 1.25rem; }
.section-head::before {
  content: "";
  position: absolute; inset-inline: 0; top: 0;
  height: 2px; background: var(--rule-strong);
  transform-origin: left center;
}
.section-title { font-size: var(--fs-xl); font-stretch: 108%; }
.section-intro {
  margin-top: .75rem; max-width: 46ch;
  color: var(--fg-2); font-size: var(--fs-md);
}
.aside-title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--fg-3);
  padding-bottom: .5rem; border-bottom: var(--rule);
}
.aside-title-spaced { margin-top: 2.25rem; }
.plain { margin-top: .75rem; color: var(--fg-2); max-width: 40ch; }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: .7rem 1.25rem;
  font-size: var(--fs-sm); font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--btn-bg);
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease);
}
.btn-solid { background: var(--btn-bg); color: var(--btn-fg); }
.btn-solid:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-quiet { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn-quiet:hover { border-color: var(--fg); }

/* ---------- Masthead ------------------------------------------------------ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--shell);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: var(--rule);
  transition: background-color .35s var(--ease);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; min-height: 3.75rem;
}
.wordmark { display: inline-flex; align-items: center; gap: .625rem; text-decoration: none; }
.wordmark-mark {
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem;
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .6875rem; font-weight: 700;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.wordmark-name { font-weight: 600; font-size: var(--fs-sm); }

.masthead-tools { display: flex; align-items: center; gap: .5rem; }

/* Theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  background: none; border: 1px solid var(--line-2);
  color: var(--fg); cursor: pointer; padding: 0;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 1rem; height: 1rem; display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: none; border: 1px solid var(--line-2);
  padding: .45rem .7rem;
  font: inherit; font-size: var(--fs-xs); font-weight: 600;
  color: var(--fg); cursor: pointer;
}
.nav-toggle-bars { display: grid; gap: 4px; width: 14px; }
.nav-toggle-bars span { display: block; height: 1.5px; background: currentColor; }

.nav { display: none; }
.nav.is-open {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-bottom: var(--rule);
  box-shadow: 0 14px 28px -20px rgba(0, 0, 0, .7);
}
.nav.is-open ul { max-width: var(--wrap); margin-inline: auto; padding: .5rem var(--gutter) 1rem; }
.nav a {
  display: block; padding: .7rem 0;
  font-size: var(--fs-sm); font-weight: 600;
  text-decoration: none; border-bottom: var(--rule);
}
.nav li:last-child a { border-bottom: 0; }
.nav .nav-cta { color: var(--accent); }

/* ---------- Hero ---------------------------------------------------------- */
.hero { padding-block: 2.75rem 0; }
.hero-name {
  font-size: clamp(3rem, 14vw, 5rem);
  font-stretch: 112%; font-weight: 600;
  letter-spacing: -0.035em; line-height: .95;
}
.hero-lede { margin-top: 1.5rem; max-width: 34ch; font-size: var(--fs-md); color: var(--fg-2); }
.hero-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Gantt --------------------------------------------------------- */
.gantt { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--rule-strong); }
.gantt-title { font-size: var(--fs-sm); font-weight: 600; color: var(--fg-3); }

.gantt-axis {
  position: relative; height: 1.25rem; margin-top: 1.25rem;
  font-size: var(--fs-xs); color: var(--fg-3);
}
.gantt-axis span {
  position: absolute; left: var(--x); top: 0;
  padding-left: .3rem; border-left: 1px solid var(--line-2);
  line-height: 1.25rem;
}

.gantt-rows { display: grid; gap: .875rem; }
.gantt-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; column-gap: 1rem;
  padding-top: .625rem; border-top: var(--rule);
}
.gantt-label { grid-column: 1; grid-row: 1; font-size: var(--fs-sm); font-weight: 600; }
.gantt-dates {
  grid-column: 2; grid-row: 1;
  font-size: var(--fs-xs); color: var(--fg-3);
  white-space: nowrap; text-align: right;
}
.gantt-track {
  grid-column: 1 / -1; grid-row: 2;
  position: relative; display: block;
  height: .875rem; margin-top: .5rem;
  background: linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 20% 100%;
}
.gantt-bar {
  position: absolute; top: 0; bottom: 0;
  left: var(--start); width: var(--span);
  background: var(--accent);
}
.is-live .gantt-bar::after {
  content: "";
  position: absolute; right: -.5rem; top: 0; bottom: 0;
  width: .5rem; background: var(--accent-2);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.gantt-key {
  margin-top: 1.5rem; display: flex; align-items: center; gap: .5rem;
  font-size: var(--fs-xs); color: var(--fg-3);
}
.gantt-key-live {
  width: .5rem; height: .625rem; background: var(--accent-2);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* ---------- Figures ------------------------------------------------------- */
.figures { padding-block: 2.5rem; border-top: var(--rule); margin-top: 3rem; }
.figures-grid { display: grid; gap: 1.5rem; }
.figure { padding-top: .75rem; border-top: 2px solid var(--accent); }
.figure-value {
  font-size: 1.625rem; font-weight: 600;
  font-stretch: 105%; letter-spacing: -0.02em;
}
.figure-label { margin-top: .25rem; font-size: var(--fs-sm); color: var(--fg-2); max-width: 24ch; }

/* ---------- Capabilities -------------------------------------------------- */
.capabilities { margin-top: 2.5rem; display: grid; gap: 2rem; }
.capability { padding-top: 1rem; border-top: var(--rule); }
.capability h3 { font-size: var(--fs-lg); max-width: 22ch; }
.capability p { margin-top: .625rem; color: var(--fg-2); max-width: 54ch; }

/* ---------- Projects ------------------------------------------------------ */
.projects { margin-top: 2.5rem; display: grid; gap: 2.25rem; }
.project {
  padding-top: 1.125rem;
  border-top: var(--rule);
  transition: border-color .25s var(--ease);
}
.project:hover { border-top-color: var(--accent); }
.project-name { font-size: var(--fs-lg); font-stretch: 104%; }
.project-meta { margin-top: .375rem; font-size: var(--fs-xs); color: var(--fg-3); }
.project-body { margin-top: .875rem; color: var(--fg-2); max-width: 60ch; }

.tag {
  display: inline-block; margin-right: .375rem;
  padding: .1rem .4rem; font-size: .6875rem; font-weight: 700;
  letter-spacing: .02em; border: 1px solid currentColor;
}
.tag-live { color: var(--accent); }

/* ---------- Experience ---------------------------------------------------- */
.experience-layout { display: grid; gap: 3rem; }
.roles { margin-top: 2.5rem; display: grid; gap: 2.25rem; }
.role { padding-top: 1.125rem; border-top: var(--rule); }
.role-when { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.role-title { margin-top: .5rem; font-size: var(--fs-lg); }
.role-org { margin-top: .25rem; font-size: var(--fs-sm); color: var(--fg-3); }
.role-points { margin-top: 1rem; display: grid; gap: .625rem; }
.role-points li {
  position: relative; padding-left: 1.125rem;
  color: var(--fg-2); font-size: var(--fs-sm); max-width: 62ch;
}
.role-points li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: .5rem; height: 1px; background: var(--line-2);
}

.portrait { margin: 0; background: var(--bg-2); }
.portrait img { width: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.tools { margin-top: 2.25rem; }
.tool-list { margin-top: 1rem; display: grid; gap: .5rem; }
.tool-list li {
  font-size: var(--fs-sm); color: var(--fg-2);
  padding-bottom: .5rem; border-bottom: var(--rule);
}

/* ---------- Credentials --------------------------------------------------- */
.credentials-grid { margin-top: 2.5rem; display: grid; gap: 2.5rem; }
.cred-list { margin-top: 1rem; display: grid; gap: 1.125rem; }
.cred dt { font-size: var(--fs-sm); font-weight: 600; max-width: 34ch; }
.cred dd { margin: .125rem 0 0; font-size: var(--fs-xs); color: var(--fg-3); }
.cred-ref { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

.cred-badged {
  display: grid; grid-template-columns: 3.5rem 1fr;
  align-items: start; column-gap: 1rem;
}
.cred-badge {
  width: 3.5rem; height: auto;
  /* The badge is printed for white stock; give it a chip in dark mode. */
  background: #FFFFFF; padding: .25rem; border-radius: 2px;
}
:root[data-theme="light"] .cred-badge { background: none; padding: 0; }

/* ---------- Contact ------------------------------------------------------- */
.contact {
  background: var(--invert-bg); color: var(--invert-fg);
  padding-block: 3.5rem;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.contact a { color: var(--invert-fg); text-decoration-color: var(--invert-line); }
.contact a:hover { text-decoration-color: currentColor; }
.contact-layout { display: grid; gap: 2.5rem; }
.contact-title { font-size: var(--fs-xl); font-stretch: 106%; max-width: 16ch; }
.contact-lede { margin-top: 1rem; color: var(--invert-fg-2); max-width: 42ch; }
.channels { display: grid; gap: 1rem; }
.channels li {
  display: grid; gap: .125rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--invert-line);
}
.channels li:last-child { border-bottom: 0; padding-bottom: 0; }
.channel-label { font-size: var(--fs-xs); color: var(--invert-fg-2); }
.channel-value { font-size: var(--fs-md); font-weight: 600; }

/* ---------- Footer -------------------------------------------------------- */
.footer { padding-block: 2rem; border-top: var(--rule); }
.footer-inner { display: grid; gap: .25rem; }
.footer-name { font-size: var(--fs-sm); font-weight: 600; }
.footer-meta { font-size: var(--fs-xs); color: var(--fg-3); }

/* =============================================================================
   Tablet — 40rem
   ========================================================================== */
@media (min-width: 40rem) {
  :root { --gutter: 2rem; }

  .band { padding-block: 4.5rem; }
  .hero { padding-block: 4rem 0; }
  .hero-lede { font-size: var(--fs-lg); max-width: 38ch; }
  .section-title { font-size: 2.125rem; }

  .gantt-row {
    grid-template-columns: 11rem 1fr 9.5rem;
    align-items: center; column-gap: 1.25rem; padding-top: .75rem;
  }
  .gantt-track { grid-column: 2; grid-row: 1; margin-top: 0; height: 1rem; }
  .gantt-dates { grid-column: 3; grid-row: 1; }
  .gantt-axis { margin-left: 12.25rem; margin-right: 10.75rem; }

  .figures-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .capabilities { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
  .credentials-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
  .contact-layout { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: baseline; }
  .footer-meta { text-align: right; }

  .role { display: grid; grid-template-columns: 9rem 1fr; column-gap: 2rem; }
  .role-when { padding-top: .2rem; }
  .role-title { margin-top: 0; }
}

/* =============================================================================
   Desktop — 60rem
   ========================================================================== */
@media (min-width: 60rem) {
  :root { --gutter: 3rem; }

  .nav-toggle { display: none; }
  .nav { display: block; }
  .nav ul { display: flex; align-items: center; gap: 1.75rem; }
  .nav a {
    position: relative; padding: 0; border-bottom: 0;
    font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
  }
  /* Underlines extend from the left, like everything else that moves here. */
  .nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -.4em;
    height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: left center;
    transition: transform .3s var(--ease);
  }
  .nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
  .nav .nav-cta {
    color: var(--btn-fg); background: var(--btn-bg);
    padding: .5rem .9rem; font-weight: 600;
    transition: background-color .2s var(--ease);
  }
  .nav .nav-cta::after { display: none; }
  .nav .nav-cta:hover { background: var(--btn-bg-hover); }

  .band { padding-block: 5.5rem; }
  .hero { padding-block: 5rem 0; }
  .hero-name { font-size: clamp(5rem, 8.5vw, 7.25rem); }
  .hero-lede { font-size: 1.5rem; max-width: 40ch; }

  .figures-grid { grid-template-columns: repeat(4, 1fr); }
  .capabilities { gap: 3rem 4rem; }
  .capability h3 { font-size: 1.5rem; }

  .projects { grid-template-columns: 1fr 1fr; gap: 3rem 4rem; }

  .experience-layout { grid-template-columns: minmax(0, 1fr) 18rem; gap: 5rem; }
  .experience-aside { padding-top: 1rem; }
  .role { grid-template-columns: 11rem 1fr; }

  .contact { padding-block: 6rem; }
  .contact-layout { grid-template-columns: 1fr 22rem; gap: 6rem; }
  .contact-title { font-size: 2.75rem; }
}

/* =============================================================================
   Print — always light, no motion, no chrome
   ========================================================================== */
@media print {
  :root {
    --bg: #fff; --bg-2: #fff; --fg: #000; --fg-2: #222; --fg-3: #555;
    --line: #bbb; --line-2: #999; --rule-strong: #000;
    --invert-bg: #fff; --invert-fg: #000; --invert-fg-2: #333;
    --invert-line: #bbb; --accent: #2F6B54;
  }
  .masthead, .nav, .hero-actions, .skip, .theme-toggle { display: none; }
  body { font-size: 11pt; }
  .band, .contact { padding-block: 1rem; }
  .hero-name, .hero-lede, .hero-actions, .gantt-bar, .gantt-bar::after,
  .section-head::before { animation: none !important; transform: none !important; opacity: 1 !important; }
}
