/* ============================================================
   Yohan Abhishek — Portfolio
   Modern minimal, navy accent. Shared across all pages.
   ============================================================ */

:root {
  --navy: #1F3D5C;
  --navy-700: #16314a;
  --navy-900: #0f2236;
  --link: #2A5DB0;
  --grey: #5A5A5A;
  --grey-light: #8a8f98;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-card: #ffffff;
  --border: #e6eaf0;
  --shadow: 0 1px 2px rgba(16,34,54,.04), 0 8px 24px rgba(16,34,54,.06);
  --shadow-lg: 0 12px 40px rgba(16,34,54,.12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: #1d2733;
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, border-color .3s ease;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  height: 64px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--navy);
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: #3a4654;
  font-size: .95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--navy); text-decoration: none; }
.theme-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--navy);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  transition: border-color .2s ease, transform .15s ease, color .3s ease, background .3s ease;
}
.theme-toggle:hover { border-color: var(--navy); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 4px 0; transition: .25s; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 24px; width: 100%; border-top: 1px solid var(--border); }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 96px 0 72px;
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(31,61,92,.08), transparent 60%),
    var(--bg);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 0 0 14px;
  color: var(--navy);
}
.hero .tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: #46535f;
  max-width: 38ch;
  margin: 0 0 24px;
}
.hero .eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--link);
  background: rgba(42,93,176,.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-photo {
  width: 220px; height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--navy), var(--link));
  display: grid; place-items: center;
  color: #fff; font-size: 3.4rem; font-weight: 700; letter-spacing: -.02em;
}
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { width: 140px; height: 140px; font-size: 2.2rem; order: -1; }
}

/* buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--navy); }

/* ---------------- Sections ---------------- */
section { padding: 64px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { margin-bottom: 36px; max-width: 60ch; }
.section-head .kicker {
  font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--link); margin-bottom: 8px;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -.02em; color: var(--navy); margin: 0 0 10px;
}
.section-head p { color: var(--grey); margin: 0; font-size: 1.05rem; }

.lead { font-size: 1.12rem; color: #3c4753; max-width: 70ch; }

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d4ddea; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1; }
.stat .lbl { color: var(--grey); font-size: .92rem; margin-top: 6px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------------- Project grid ---------------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d4ddea; text-decoration: none; }
.card .tag {
  align-self: flex-start;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--link); background: rgba(42,93,176,.08);
  padding: 5px 10px; border-radius: 999px; margin-bottom: 14px;
}
.card .tag.award { color: #8a5a00; background: rgba(214,158,46,.14); }
.card h3 { margin: 0 0 8px; font-size: 1.22rem; color: var(--navy); letter-spacing: -.01em; }
.card p { margin: 0 0 16px; color: #4a5663; font-size: .98rem; }
.card .meta { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; color: var(--grey); font-size: .85rem; }
.card .arrow { color: var(--link); font-weight: 600; font-size: .92rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip {
  font-size: .8rem; color: #41506a; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
}

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 0 0 28px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--navy);
}
.tl-item h4 { margin: 0 0 2px; font-size: 1.08rem; color: var(--navy); }
.tl-item .when { color: var(--link); font-size: .85rem; font-weight: 600; }
.tl-item .where { color: var(--grey); font-size: .92rem; margin: 2px 0 8px; }
.tl-item ul { margin: 0; padding-left: 18px; color: #4a5663; }
.tl-item ul li { margin: 3px 0; }

/* ---------------- Publications ---------------- */
.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub {
  display: flex; gap: 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pub:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d4ddea; }
.pub .yr {
  flex-shrink: 0; font-weight: 800; color: var(--navy);
  background: var(--bg-soft); border-radius: 8px; padding: 8px 12px; height: fit-content;
  font-size: .9rem;
}
.pub .body h4 { margin: 0 0 6px; font-size: 1.04rem; color: #1d2733; line-height: 1.35; }
.pub .body .authors { color: var(--grey); font-size: .9rem; margin-bottom: 8px; }
.pub .body .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; font-weight: 600; }
.pub .badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #8a5a00; background: rgba(214,158,46,.14);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px;
}

/* ---------------- Project detail page ---------------- */
.proj-hero { padding: 80px 0 36px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: .9rem; color: var(--grey); margin-bottom: 18px; }
.proj-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--navy); letter-spacing: -.02em; margin: 0 0 12px; }
.proj-hero .summary { font-size: 1.15rem; color: #3c4753; max-width: 72ch; }

.proj-body { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .proj-body { grid-template-columns: 1fr; } }
.proj-main h2 { color: var(--navy); font-size: 1.4rem; letter-spacing: -.01em; margin: 36px 0 12px; }
.proj-main h2:first-child { margin-top: 0; }
.proj-main p { color: #3c4753; }
.proj-main ul { color: #3c4753; padding-left: 20px; }
.proj-main ul li { margin: 6px 0; }

.proj-aside {
  position: sticky; top: 88px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.proj-aside h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey); }
.proj-aside .row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.proj-aside .row:last-child { border-bottom: 0; }
.proj-aside .val { color: #1d2733; font-weight: 600; font-size: .95rem; }

/* ---------------- Media gallery ---------------- */
.gallery-section { margin-top: 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gallery-grid img, .gallery-grid video {
  width: 100%; height: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--border); box-shadow: var(--shadow); cursor: zoom-in;
  aspect-ratio: 4/3; object-fit: cover; background: var(--bg-soft);
}
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.video-grid video { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: default; aspect-ratio: 16/9; background:#000; }
.media-empty {
  border: 1px dashed #c8d2e0; border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--grey); background: var(--bg-soft); font-size: .95rem;
}
.media-empty code { background: #fff; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--navy); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,16,28,.9); display: none;
  align-items: center; justify-content: center; padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox .close { position: absolute; top: 22px; right: 28px; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: 0; }

/* ---------------- Contact ---------------- */
.contact-card {
  background: linear-gradient(135deg, var(--navy), var(--navy-900));
  color: #fff; border-radius: var(--radius); padding: 48px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.contact-card h2 { color: #fff; margin: 0 0 10px; font-size: 1.9rem; letter-spacing: -.02em; }
.contact-card p { color: #c5d2e2; margin: 0 0 24px; }
.contact-card .btn-primary { background: #fff; color: var(--navy); }
.contact-card .btn-primary:hover { background: #eef2f8; }
.contact-card .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------------- Footer ---------------- */
footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--grey); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner a { color: var(--grey); }
.footer-inner a:hover { color: var(--navy); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Dark mode  (activated by data-theme="dark" on <html>)
   ============================================================ */
[data-theme="dark"] {
  --navy: #c2d8f2;
  --navy-700: #a9c6ea;
  --navy-900: #0a1320;
  --link: #7fb6ff;
  --grey: #9aa7b3;
  --grey-light: #6e7c89;
  --bg: #0e1622;
  --bg-soft: #13202f;
  --bg-card: #16222f;
  --border: #27343f;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.40);
  --shadow-lg: 0 14px 44px rgba(0,0,0,.55);
}
[data-theme="dark"] body { color: #cdd6df; }
[data-theme="dark"] .nav { background: rgba(14,22,34,.82); }
[data-theme="dark"] .nav-links a { color: #aeb9c5; }
[data-theme="dark"] .nav-links a:hover { color: var(--navy); }
[data-theme="dark"] .hero {
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(127,182,255,.12), transparent 60%),
    var(--bg);
}
[data-theme="dark"] .hero .tagline { color: #aab6c2; }
[data-theme="dark"] .lead { color: #b9c4cf; }
[data-theme="dark"] .section-head p { color: #9aa7b3; }
[data-theme="dark"] .card p { color: #a7b3bf; }
[data-theme="dark"] .chip { color: #b9c6d6; }
[data-theme="dark"] .tl-item ul,
[data-theme="dark"] .tl-item .where,
[data-theme="dark"] .proj-main p,
[data-theme="dark"] .proj-main ul,
[data-theme="dark"] .proj-hero .summary { color: #b3bfca; }
[data-theme="dark"] .tl-item::before { background: var(--bg-card); }
[data-theme="dark"] .pub .body h4 { color: #dde4ec; }
[data-theme="dark"] .proj-aside .val { color: #dde4ec; }
[data-theme="dark"] .stat .lbl { color: #9aa7b3; }
[data-theme="dark"] .media-empty code { background: var(--bg-card); }
[data-theme="dark"] .breadcrumb { color: #9aa7b3; }

/* fix contrast on filled elements in dark */
[data-theme="dark"] .btn-primary { background: var(--link); color: #08121f; }
[data-theme="dark"] .btn-primary:hover { background: #9cc6ff; }
[data-theme="dark"] .btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
[data-theme="dark"] .hero-photo { background: linear-gradient(135deg, #21527f, #3f7fd6); }
[data-theme="dark"] .contact-card { background: linear-gradient(135deg, #15324c, #0a1626); }
[data-theme="dark"] .contact-card .btn-primary { background: #fff; color: #0e2236; }
[data-theme="dark"] .contact-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
[data-theme="dark"] .tag.award,
[data-theme="dark"] .pub .badge { color: #f0c460; background: rgba(214,158,46,.16); }
[data-theme="dark"] .proj-hero span.eyebrow[style] { color: #f0c460 !important; background: rgba(214,158,46,.18) !important; }

/* ============================================================
   Motion & interactivity
   ============================================================ */

/* scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 70;
  background: linear-gradient(90deg, var(--link), #7db4ff);
  box-shadow: 0 0 10px rgba(42,93,176,.55);
  transition: width .08s linear;
}

/* hero canvas — full-bleed behind content */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero .container { position: relative; z-index: 2; }

/* flowing gradient headline */
.grad-text {
  background: linear-gradient(90deg, #2A5DB0, #5a8de0, #1F3D5C, #2A5DB0);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}
[data-theme="dark"] .grad-text {
  background: linear-gradient(90deg, #7fb6ff, #a9c6ea, #c2d8f2, #7fb6ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* hero entrance */
.hero .eyebrow, .hero h1, .hero .tagline, .hero .btns, .hero-photo {
  animation: fadeUp .7s cubic-bezier(.2,.7,.2,1) both;
}
.hero .eyebrow { animation-delay: .05s; }
.hero h1 { animation-delay: .15s; }
.hero-photo { animation-delay: .25s; }
.hero .tagline { animation-delay: .3s; }
.hero .btns { animation-delay: .42s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* animated nav underline */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--link); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 720px) { .nav-links a::after { display: none; } }

/* card shine sweep on hover */
.card::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 65%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .75s ease; pointer-events: none;
}
.card:hover::after { left: 150%; }
[data-theme="dark"] .card::after { background: linear-gradient(110deg, transparent, rgba(255,255,255,.07), transparent); }

/* primary button shine */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.38), transparent);
  transform: skewX(-18deg); transition: left .6s ease;
}
.btn-primary:hover::after { left: 170%; }

/* pulsing marker on current (first) timeline item */
.tl-item:first-child::before { animation: pulse 2.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(42,93,176,.45); }
  70% { box-shadow: 0 0 0 12px rgba(42,93,176,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,93,176,0); }
}

/* gentle hover on hero photo */
@media (hover: hover) {
  .hero-photo { transition: transform .4s ease; }
  .hero-photo:hover { transform: scale(1.03) rotate(1deg); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grad-text, .hero .eyebrow, .hero h1, .hero .tagline, .hero .btns, .hero-photo,
  .tl-item:first-child::before { animation: none !important; }
  .scroll-progress { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
