/* ============================================================
   nirajguhan.com
   Vanilla CSS, no framework. Self-hosted on Raspberry Pi
   behind Cloudflare. Aggressively cacheable.
   ============================================================ */

:root {
  --bg:        #0B1220;
  --bg-1:      #0F1730;
  --bg-2:      #131C36;
  --fg:        #E6EDF6;
  --muted:     #8B95A7;
  --hair:      rgba(230,237,246,0.08);
  --hair-2:    rgba(230,237,246,0.14);
  --accent:    #2DD4BF;
  --accent-2:  #5EEAD4;
  --glow:      rgba(45,212,191,0.16);
  --maxw:      1060px;
  --pad-x:     clamp(20px, 5vw, 48px);
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:      ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* -------- Reset ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: -25vh -25vw auto auto;
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

/* -------- Nav ------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad-x);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(11,18,32,0.6);
  border-bottom: 1px solid var(--hair);
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); font-weight: 600; letter-spacing: -0.01em; }
.nav__mark {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #818CF8);
  box-shadow: 0 0 24px var(--glow);
}
.nav__name { font-size: 15px; }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav__links a:hover { color: var(--fg); }
.nav__cta {
  color: var(--fg) !important;
  padding: 8px 14px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  transition: border-color .2s ease, background .2s ease;
}
.nav__cta:hover { border-color: var(--accent); background: rgba(45,212,191,0.06); }
@media (max-width: 640px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* -------- Layout helpers ------------------------------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); }
.section { padding: 96px 0 24px; border-top: 1px solid var(--hair); }
.section--contact { padding-bottom: 120px; }
.section__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 40px; }
.section__index { font-family: var(--mono); color: var(--accent); font-size: 13px; letter-spacing: 0.1em; }
.section__title { font-size: clamp(28px, 4vw, 40px); font-weight: 600; }

/* -------- Hero (centered, no portrait) ---------------------- */
.hero { padding: clamp(72px, 11vw, 130px) 0 clamp(56px, 9vw, 110px); }
.hero__center {
  max-width: 720px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.display {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #FFFFFF 0%, #C9D4E8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin-top: 26px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: #C5CDDD;
  max-width: 58ch;
  line-height: 1.65;
}
.lede strong { color: var(--fg); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dashed var(--hair);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
}
.hero__tags li { position: relative; padding-right: 14px; }
.hero__tags li:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 3px; height: 3px; border-radius: 50%; background: var(--hair-2);
  transform: translateY(-50%);
}

/* -------- Buttons ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #3DECD7, #1CB8A4);
  color: #0B1220;
  box-shadow: 0 10px 24px -10px rgba(45,212,191,0.5);
}
.btn--primary:hover { color: #0B1220; box-shadow: 0 14px 30px -10px rgba(45,212,191,0.7); }
.btn--ghost {
  border-color: var(--hair-2);
  color: var(--fg);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--fg); background: rgba(45,212,191,0.05); }

/* -------- Callout panel ------------------------------------- */
.callout {
  position: relative;
  margin: 88px 0 8px;
  padding: 36px 36px 36px 56px;
  border-radius: 16px;
  border: 1px solid var(--hair-2);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(45,212,191,0.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.callout::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent 90%);
}
.callout__lede {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.callout__body {
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 1.6;
  color: #E2E8F2;
  letter-spacing: -0.01em;
  max-width: 54ch;
  margin: 0;
}
.callout__visual {
  width: 100%;
  max-width: 360px;
  justify-self: end;
}
.callout__visual svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) {
  .callout { grid-template-columns: 1fr; padding: 32px 28px 32px 40px; }
  .callout__visual { max-width: 320px; justify-self: start; }
}
@media (max-width: 640px) {
  .callout { padding: 28px 22px 28px 32px; }
}

/* -------- Prose --------------------------------------------- */
.prose p { color: #C5CDDD; max-width: 72ch; font-size: 17px; line-height: 1.75; }
.prose p + p { margin-top: 18px; }
.muted { color: var(--muted); font-weight: 500; }

/* -------- Stats strip --------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.stats li {
  padding: 22px 22px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--hair);
}
.stats li:last-child { border-right: none; }
@media (max-width: 720px) {
  .stats li { border-right: none; border-bottom: 1px solid var(--hair); padding: 18px 0; }
  .stats li:last-child { border-bottom: none; }
}
.stats strong {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  background: linear-gradient(180deg, #FFFFFF, #C9D4E8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stats span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  max-width: 28ch;
}

/* -------- Cards -------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid var(--hair);
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover {
  border-color: var(--hair-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  transform: translateY(-2px);
}
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.card p { color: #BCC5D7; font-size: 14.5px; line-height: 1.65; }
.card__eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.chips li {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 9px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* Interest card icon */
.interest-icon {
  margin-bottom: 14px;
  opacity: 0.85;
}

/* -------- Cert cards --------------------------------------- */
.cards--certs {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card--cert {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.cert-badge { flex: 0 0 auto; }
.card--cert__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card--cert h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--fg);
}
.card--cert .card__eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11.5px;
}

/* -------- Contact cards ------------------------------------ */
.cards--contact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 380px;
}
.card--contact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-align: left;
  text-decoration: none;
  color: var(--fg);
}
.card--contact:hover { color: var(--fg); }
.card--contact:hover .card__eyebrow { color: var(--accent); }
.card--contact__icon { flex: 0 0 auto; width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.card--contact__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card--contact h3 { font-size: 14.5px; font-weight: 600; line-height: 1.3; margin: 0; color: var(--fg); }
.card--contact .card__eyebrow { margin: 0; color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 11.5px; }

/* -------- Contact section ---------------------------------- */
.contact { display: grid; gap: 28px; }
.contact__lede { color: #C5CDDD; font-size: 18px; line-height: 1.7; max-width: 52ch; }

/* -------- Footer ------------------------------------------- */
.foot {
  border-top: 1px solid var(--hair);
  padding: 28px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
}
.foot__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* -------- Reveal animation --------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .85s cubic-bezier(0.22, 1, 0.36, 1),
    transform .85s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@supports (animation-timeline: view()) {
  html { scroll-behavior: smooth; }

  [data-reveal] {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    animation: scroll-reveal linear both;
    animation-timeline: view();
    animation-range: entry 8% cover 32%;
    will-change: opacity, transform;
    transition: none;
  }
  [data-reveal].is-visible {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }

  @keyframes scroll-reveal {
    0%   { opacity: 0; transform: translateY(28px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0)    scale(1); }
  }

  .cards > .card {
    opacity: 0;
    transform: translateY(22px);
    animation: card-rise linear both;
    animation-timeline: view();
    animation-range: entry 4% cover 28%;
  }
  .cards > .card:nth-child(2) { animation-range: entry 7%  cover 32%; }
  .cards > .card:nth-child(3) { animation-range: entry 10% cover 36%; }
  .cards > .card:nth-child(4) { animation-range: entry 13% cover 40%; }

  @keyframes card-rise {
    0%   { opacity: 0; transform: translateY(22px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  .section__title {
    animation: title-settle linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 18%;
    transform-origin: left center;
  }
  @keyframes title-settle {
    0%   { letter-spacing: 0.005em; }
    100% { letter-spacing: -0.02em; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal],
  .cards > .card,
  .section__title { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media print {
  body::before, .nav, .hero__cta { display: none !important; }
  body { background: white; color: black; }
  .display, .display * { color: black !important; -webkit-text-fill-color: black; }
  .section { page-break-inside: avoid; }
}
