/* ============================================================
   VIVEK BHATIA PORTFOLIO — GLOBAL STYLES
   Inter · White/Grey · Minimal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

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

:root {
  --black:      #111111;
  --g1:         #3D3D3D;
  --g2:         #6B6B6B;
  --g3:         #9B9B9B;
  --g4:         #D4D4D4;
  --g5:         #EBEBEB;
  --g6:         #F5F5F5;
  --white:      #FFFFFF;

  /* Brand accent tokens */
  --cream:      #FAF7F2;
  --cream-2:    #FAF8F5;
  --charcoal:   #1C1C1C;
  --amber:      #C8853A;
  --amber-pale: #FEF3C7;

  --font:  'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 1060px;
  --gap:   clamp(1.25rem, 5vw, 2.5rem);
  --ease:  cubic-bezier(.16, 1, .3, 1);
  --t:     .22s var(--ease);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ── Container ─────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  overflow-x: hidden;
}

/* ── Nav ───────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--g5);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav__logo {
  font-size: .9rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--black); transition: color var(--t);
}
.nav__logo:hover { color: var(--g2); }

.nav__right { display: flex; align-items: center; gap: 1.25rem; }

.nav__back {
  font-size: .8rem; font-weight: 500; color: var(--g2);
  display: inline-flex; align-items: center; gap: .3rem;
  transition: color var(--t);
}
.nav__back:hover { color: var(--black); }

.nav__cv {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  padding: .42rem .95rem;
  border: 1.5px solid var(--black);
  color: var(--black); border-radius: 3px;
  transition: background var(--t), color var(--t);
}
.nav__cv:hover { background: var(--black); color: var(--white); }

.nav__toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: .25rem; flex-direction: column; gap: 5px;
}
.nav__toggle span {
  display: block; width: 22px; height: 1.5px; background: var(--black);
  transition: var(--t);
}
.nav__toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__mobile {
  display: none; flex-direction: column;
  border-top: 1px solid var(--g5); padding: .75rem 0 1rem;
  background: var(--white);
}
.nav__mobile a {
  font-size: .88rem; font-weight: 500; color: var(--g2);
  padding: .6rem var(--gap); transition: color var(--t);
}
.nav__mobile a:hover { color: var(--black); }
.nav__mobile.open { display: flex; }

/* ── Hero ──────────────────────────────────── */
.hero { padding: clamp(4rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 5rem;
  align-items: center;
}
.hero__kicker {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g3);
  margin-bottom: 1rem;
}
.hero__kicker .sep {
  color: var(--g1);
  font-size: 1.15em;
  margin: 0 .05em;
  vertical-align: middle;
}
.hero__name {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700; line-height: 1;
  letter-spacing: -.04em; color: var(--black);
  margin-bottom: 1.25rem;
}
.hero__role {
  font-size: .88rem; font-weight: 500; color: var(--g2);
  letter-spacing: .01em; margin-bottom: 1.25rem;
}
.hero__bio {
  font-size: .93rem; color: var(--g2); line-height: 1.78;
  max-width: 440px; margin-bottom: 2rem;
}
.hero__bio strong { color: var(--g1); font-weight: 500; }

.hero__stats {
  display: flex; width: fit-content;
  border: 1px solid var(--g5); border-radius: 5px; overflow: hidden;
  margin-bottom: 2rem;
}
.hero__stat {
  padding: .8rem 1.4rem;
  border-right: 1px solid var(--g5);
}
.hero__stat:last-child { border-right: none; }
.hero__stat-num {
  font-size: 1.05rem; font-weight: 700; color: var(--black); line-height: 1;
}
.hero__stat-label {
  font-size: .62rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .09em; color: var(--g3); margin-top: .22rem;
}

.hero__actions { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }

.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font); font-size: .8rem; font-weight: 600;
  padding: .62rem 1.25rem;
  background: var(--black); color: var(--white);
  border: 1.5px solid var(--black);
  border-radius: 3px; cursor: pointer;
  transition: opacity var(--t);
}
.btn-primary:hover { opacity: .78; }

.btn-outline {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font); font-size: .8rem; font-weight: 500;
  padding: .62rem 1.25rem;
  background: transparent; color: var(--g2);
  border: 1.5px solid var(--g5);
  border-radius: 3px; cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.btn-outline:hover { border-color: var(--black); color: var(--black); }

.hero__social { display: flex; gap: .45rem; }
.hero__social a {
  width: 32px; height: 32px;
  border: 1px solid var(--g5); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--g3); transition: border-color var(--t), color var(--t);
}
.hero__social a:hover { border-color: var(--black); color: var(--black); }

.hero__photo {
  width: 280px; height: 340px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--g5);
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}

/* ── Open to Work badge ────────────────────── */
.otw-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--g2);
  margin-bottom: 1rem;
}
.otw-badge__dot {
  width: 8px; height: 8px;
  background: #22C55E;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.otw-badge__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #22C55E;
  opacity: .3;
  animation: otw-pulse 1.8s ease-in-out infinite;
}
@keyframes otw-pulse {
  0%, 100% { transform: scale(1); opacity: .3; }
  50%       { transform: scale(1.8); opacity: 0; }
}

/* ── Logo ticker ───────────────────────────── */
.logo-ticker {
  overflow: hidden;
  border-top: 1px solid var(--g5);
  border-bottom: 1px solid var(--g5);
  background: var(--g6);
  padding: 1.1rem 0;
  cursor: default;
}
.logo-ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 3rem;
  animation: logo-scroll 34s linear infinite;
  will-change: transform;
}
.logo-ticker:hover .logo-ticker__track {
  animation-play-state: paused;
}
.logo-ticker__item { flex-shrink: 0; }
.logo-ticker__item img {
  max-height: 36px;
  max-width: 140px;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
  filter: grayscale(1) opacity(.48);
  transition: filter var(--t);
}
.logo-ticker__item img:hover {
  filter: grayscale(0) opacity(1);
}
/* Square / icon logos — rendered larger for visual balance */
.logo-ticker__item.logo--sq img {
  max-height: 46px;
  max-width: 46px;
}
@keyframes logo-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Work section ──────────────────────────── */
.work-section { border-top: 1px solid var(--g5); }

.work-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--g5);
}
.work-header__label {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g3);
}
.work-header__count {
  font-size: .72rem; color: var(--g3);
}

/* ── Panel ─────────────────────────────────── */
.panel {
  display: block;
  border-bottom: 1px solid var(--g5);
  color: inherit; text-decoration: none;
  transition: background var(--t);
}
.panel:hover { background: var(--g6); }
.panel:hover .panel__arrow { transform: translateX(4px); color: var(--black); }
.panel:hover .panel__num   { color: var(--black); }

.panel__inner {
  display: grid;
  grid-template-columns: 3rem 1fr 160px 2rem;
  align-items: center;
  gap: 2rem;
  padding: 1.6rem 0;
}
.panel__num {
  font-size: .68rem; font-weight: 600; letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: var(--g3); transition: color var(--t);
  align-self: start; padding-top: .18rem;
}
.panel__info { min-width: 0; }
.panel__title {
  font-size: 1.1rem; font-weight: 600; color: var(--black);
  margin-bottom: .22rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.panel__meta { font-size: .78rem; color: var(--g2); }

.panel__thumb {
  width: 160px; height: 100px;
  border-radius: 4px; overflow: hidden;
  background: var(--g6); flex-shrink: 0;
}
.panel__thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.panel__arrow {
  font-size: .95rem; color: var(--g4);
  justify-self: end;
  transition: transform var(--t), color var(--t);
}

/* ── Work detail page ──────────────────────── */
.detail-header {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--g5);
}
.detail-breadcrumb {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .75rem; font-weight: 500; color: var(--g2);
  padding: .5rem .9rem;
  border: 1px solid var(--g5); border-radius: 3px;
  margin-bottom: 2rem;
  transition: all var(--t);
}
.detail-breadcrumb:hover { color: var(--black); border-color: var(--black); }

.detail-num {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g3);
  margin-bottom: .6rem;
}
.detail-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  color: var(--black); margin-bottom: 1rem;
}
.detail-meta {
  font-size: .88rem; color: var(--g2);
}
.detail-meta span::after {
  content: '·'; margin: 0 .5rem; color: var(--g4);
}
.detail-meta span:last-child::after { content: ''; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 4rem;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  align-items: start;
}
.detail-body, .detail-sidebar {
  min-width: 0;
}
.detail-body .section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g3);
  padding-bottom: .65rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--g5);
}
.detail-body p {
  font-size: .95rem; color: var(--g2); line-height: 1.82;
  margin-bottom: 1rem;
  word-break: break-word;
}
.detail-body p:last-child { margin-bottom: 0; }
.detail-body ul { padding: 0; }
.detail-body ul li {
  font-size: .95rem; color: var(--g2); line-height: 1.7;
  padding: .55rem 0;
  border-bottom: 1px solid var(--g6);
  display: flex; align-items: flex-start; gap: .75rem;
  word-break: break-word;
}
.detail-body ul li::before {
  content: '—'; color: var(--g4); flex-shrink: 0;
}
.detail-body ul li:last-child { border-bottom: none; }
.detail-body .detail-section { margin-bottom: 2.5rem; }

.detail-sidebar .section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g3);
  padding-bottom: .65rem; margin-bottom: .85rem;
  border-bottom: 1px solid var(--g5);
}
.detail-sidebar .sidebar-block { margin-bottom: 2rem; }
.detail-sidebar .sidebar-val {
  font-size: .88rem; color: var(--g1); font-weight: 500;
  line-height: 1.6;
  word-break: break-word;
}

.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.tag {
  font-size: .7rem; font-weight: 500;
  padding: .22rem .65rem;
  border: 1px solid var(--g5); border-radius: 20px;
  color: var(--g2);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border: 1px solid var(--g5); border-radius: 5px;
  overflow: hidden; margin-top: 1rem;
}
.stat-cell {
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--g5);
}
.stat-cell:last-child { border-right: none; }
.stat-cell__num  { font-size: 1.6rem; font-weight: 700; color: var(--black); line-height: 1; }
.stat-cell__label { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--g3); margin-top: .3rem; }

.detail-image {
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--g5); margin-bottom: 2.5rem;
}
.detail-image img {
  width: 100%; max-height: 460px; object-fit: cover; display: block;
}

/* ── Footer ────────────────────────────────── */
.footer {
  border-top: 1px solid var(--g5);
  padding: 2rem 0;
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer__copy { font-size: .75rem; color: var(--g3); }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a { font-size: .75rem; color: var(--g3); transition: color var(--t); }
.footer__links a:hover { color: var(--black); }

/* ── Animate on scroll ─────────────────────── */
.anim {
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.anim.visible { opacity: 1; transform: translateY(0); }
.anim-d1 { transition-delay: .08s; }
.anim-d2 { transition-delay: .16s; }
.anim-d3 { transition-delay: .24s; }
.anim-d4 { transition-delay: .32s; }

/* ── Carousel global ───────────────────────── */
/* Allow native horizontal scroll on iOS, prevent vertical block */
.work-reel-track,
.spec-work-track {
  touch-action: pan-x;
}

/* Anchor scroll offset — clears sticky nav */
.detail-section,
.work-reel-section,
.spec-work-section {
  scroll-margin-top: 80px;
}

/* ── Responsive ────────────────────────────── */

/* ── Tablet 860px ── */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__photo { width: 200px; height: 240px; }
  /* Thumbnails hidden at tablet; restored at mobile with full layout */
  .panel__inner { grid-template-columns: 2.5rem 1fr 2rem; gap: 1.25rem; }
  .panel__thumb { display: none; }
  .detail-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ── Mobile 768px ── */
@media (max-width: 768px) {

  /* NAV */
  .nav__cv   { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* HERO */
  .hero { padding: 2.5rem 0 2rem; }
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__photo-wrap { order: -1; display: flex; justify-content: center; }
  .hero__photo { width: 160px; height: 160px; border-radius: 50%; }
  .hero__bio { max-width: 100%; }
  .hero__social { justify-content: center; }
  .hero__role { font-size: 1rem; }

  /* STATS — 2-col grid */
  .hero__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    border: 1px solid var(--g5);
    border-radius: 5px;
    overflow: hidden;
  }
  .hero__stat {
    border-right: 1px solid var(--g5);
    border-bottom: 1px solid var(--g5);
    border-radius: 0;
  }
  .hero__stat:nth-child(even) { border-right: none; }
  .hero__stat:last-child { border-bottom: none; }
  .hero__stat:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: none; }
  .hero__stat:nth-last-child(2):nth-child(odd) { border-bottom: none; }

  /* CTA BUTTONS */
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions a { text-align: center; justify-content: center; min-height: 44px; }

  /* TICKER */
  .logo-ticker__item img { max-height: 24px; max-width: 110px; }
  .logo-ticker__track { gap: 2rem; }

  /* WORK PANELS — thumbnail above text */
  .panel__inner {
    display: grid;
    grid-template-areas:
      "thumb thumb thumb"
      "num   info  arrow";
    grid-template-columns: 2.5rem 1fr auto;
    grid-template-rows: auto auto;
    gap: 0;
    padding: 0;
  }
  .panel__thumb {
    grid-area: thumb;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    margin: 0;
  }
  .panel__thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
  }
  .panel__num   { grid-area: num;   padding: .85rem 0 .85rem 1.25rem; align-self: center; }
  .panel__info  { grid-area: info;  padding: .85rem .5rem; }
  .panel__title { font-size: 1rem; white-space: normal; }
  .panel__arrow { grid-area: arrow; align-self: center; padding: .85rem 1.25rem .85rem 0; }

  /* DETAIL PAGES */
  .detail-header { padding: 2rem 0 1.5rem; }
  .detail-grid { grid-template-columns: 1fr; gap: 2rem; }
  .detail-sidebar { padding-top: 1.5rem; border-top: 1px solid var(--g5); }
  .detail-body p, .detail-body ul li { font-size: 15px; }

  /* TOUCH TARGETS */
  .btn-primary, .btn-outline { min-height: 44px; }
  .nav__back { min-height: 44px; display: inline-flex; align-items: center; }
  .detail-breadcrumb { min-height: 44px; }
  .reel-btn { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }

  /* FOOTER */
  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .footer__links { flex-wrap: wrap; justify-content: center; }

  /* CONTAINER */
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* NAV LINKS (new-style nav pages) */
  .nav__links { display: none; }

  /* HERO PHOTO — rectangular like desktop, just smaller */
  .hero__photo {
    width: 180px;
    height: 220px;
    border-radius: 8px;
    margin: 0 auto;
  }

  /* COVER / BANNER IMAGES */
  .metro-banner { max-height: 220px; overflow: hidden; }
  .metro-banner img { max-height: 220px; width: 100%; object-fit: cover; }
  .tikao-banner { max-height: 220px; overflow: hidden; }
  .tikao-banner img { max-height: 220px; width: 100%; object-fit: cover; }
  .detail-image img { max-height: 220px; }

  /* CAROUSELS — single card visible at a time */
  .reel-card,
  .spec-card {
    flex: 0 0 calc(100vw - 2.5rem);
    max-width: calc(100vw - 2.5rem);
  }
}
