/* ==========================================================
   Dr. Nikhil Bansal — portfolio homepage
   Layout styles live inline in index.html (exported from the
   design). This file holds tokens, animations, the video
   popup and responsive fixes.
   ========================================================== */

:root {
  --accent: #C8F04A;      /* lime — swap here to re-theme (try #5EEAD4, #F5B841, #9DB8FF) */
  --ink: #0C1722;         /* navy */
  --paper: #F3F4F0;       /* off-white background */
  --teal: #0B6B63;        /* secondary accent on light sections */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--teal); }
a:hover { color: #08504A; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Keyframes ---------- */
@keyframes up      { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
@keyframes reveal  { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes float   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes marq    { to { transform: translateX(-50%); } }
@keyframes pulse   { 0% { box-shadow: 0 0 0 0 rgba(200, 240, 74, .7); } 100% { box-shadow: 0 0 0 12px rgba(200, 240, 74, 0); } }
@keyframes vmfade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes vmpop   { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Page-load animations (hero) ---------- */
.a-up     { animation: up .9s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .1s; }  .d2 { animation-delay: .2s; }  .d3 { animation-delay: .3s; }
.d4 { animation-delay: .45s; } .d5 { animation-delay: .6s; }  .d6 { animation-delay: .75s; }
.a-reveal { animation: reveal 1.3s cubic-bezier(.7, 0, .2, 1) .25s both; }
.a-float  { animation: float 6s ease-in-out infinite; }
.d-float  { animation-delay: -3s; }
.a-spin   { animation: spin 28s linear infinite; transform-origin: 50% 50%; }
.a-marq   { animation: marq 38s linear infinite; }
.a-pulse  { animation: pulse 1.8s ease-out infinite; }

/* ---------- Hover ---------- */
.lift { transition: transform .25s ease; }
.lift:hover { transform: translateY(-3px); }
.card { transition: transform .3s ease, box-shadow .3s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(12, 23, 34, .12); }
.a-marq:hover { animation-play-state: paused; }

/* ---------- Scroll reveal (js/main.js adds .in) ---------- */
.js .rv { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Sticky header shadow ---------- */
.site-header { position: sticky; top: 0; z-index: 50; transition: box-shadow .3s ease; }
.site-header.scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }

/* ---------- Video popup ---------- */
.vm { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; animation: vmfade .25s ease both; }
.vm[hidden] { display: none; }
.vm-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: rgba(6, 12, 18, .9); cursor: pointer; }
.vm-panel { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 100%; animation: vmpop .45s cubic-bezier(.2, .7, .2, 1) both; }
.vm-frame { position: relative; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 40px 80px rgba(0, 0, 0, .5); max-width: 92vw; }
.vm-frame.vertical   { height: min(76vh, 760px); aspect-ratio: 9 / 16; }
.vm-frame.horizontal { width: min(86vw, 1000px); aspect-ratio: 16 / 9; }
.vm-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vm-meta { width: 0; min-width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; color: var(--paper); max-width: 92vw; }
.vm-tag { font: 600 12px/1 'Inter', sans-serif; letter-spacing: .12em; color: var(--accent); }
.vm-title { margin-top: 6px; font-family: 'Archivo', sans-serif; font-stretch: 85%; font-weight: 700; font-size: 20px; line-height: 1.2; }
.vm-yt { color: #A9B4BE; font-size: 14px; font-weight: 600; text-decoration: none; }
.vm-yt:hover { color: var(--paper); }
.vm-close { position: absolute; top: -60px; right: 0; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(243, 244, 240, .3); background: rgba(243, 244, 240, .08); color: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: background .2s ease, transform .2s ease; }
.vm-close:hover { background: rgba(243, 244, 240, .18); transform: rotate(90deg); }
body.modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-link { display: none; }
}
@media (max-width: 640px) {
  .site-header { padding: 0 16px !important; }
  .nav-bar { flex-wrap: nowrap !important; min-height: 64px !important; gap: 12px !important; }
  .nav-tag { display: none !important; }
  .nav-name { font-size: 17px !important; white-space: nowrap; }
  .nav-cta { padding: 10px 14px !important; font-size: 13px; min-height: 44px; white-space: nowrap; }
  .hero-stat { left: 12px !important; top: 24px !important; }
  .about-collage { min-height: 480px !important; }
  .vm-frame.vertical { height: min(70vh, 640px); }
}

/* ---------- Respect reduced-motion settings ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; transform: none; }
}
