/* =========================================================
   Eshaan Niyas — Portfolio
   Design system: minimal, monochrome, typographic.
   ========================================================= */

:root {
  --black:      #0a0a0a;
  --ink:        #111113;
  --gray-900:   #1c1c1e;
  --gray-700:   #3a3a3e;
  --gray-500:   #6a6a70;
  --gray-400:   #8a8a90;
  --gray-300:   #c8c8cc;
  --gray-200:   #e6e6e8;
  --gray-100:   #f2f2f4;
  --gray-50:    #fafafa;
  --white:      #ffffff;
  --accent:     #0a0a0a;

  --line:       #e8e8ea;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --container: 1120px;
  --pad: clamp(24px, 6vw, 80px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }

::selection { background: var(--ink); color: var(--white); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 0 0 8px 0;
  font-size: 0.85rem;
}
.skip-link:focus { left: 0; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: padding 0.4s var(--ease);
}
.nav-logo {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
  transition: color 0.4s var(--ease);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 34px;
  margin-inline: auto;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 450;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--white); }

.nav-cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  padding: 9px 18px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); opacity: 0.9; }

/* Scrolled state — light bar */
.nav.scrolled {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav.scrolled .nav-inner { padding-block: 15px; }
.nav.scrolled .nav-logo { color: var(--ink); }
.nav.scrolled .nav-links a { color: var(--gray-500); }
.nav.scrolled .nav-links a:hover { color: var(--ink); }
.nav.scrolled .nav-cta { background: var(--ink); color: var(--white); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 120px 24px 80px;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-parallax {
  position: absolute;
  inset: -10% 0 -10% 0;      /* extra height for parallax travel */
  background-image: url("assets/hero.jpg");
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
  /* Cinematic grade */
  filter: grayscale(18%) contrast(1.06) brightness(0.92) saturate(0.92);
  will-change: transform;
}
.hero-grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 20%, rgba(0,0,0,0.15), rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.72)),
    linear-gradient(180deg, rgba(10,10,12,0.35) 0%, rgba(10,10,12,0.25) 42%, rgba(10,10,12,0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.2rem, 11vw, 7.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(24px);
  animation: rise 1s var(--ease) 0.15s forwards;
}
.hero-sub {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(24px);
  animation: rise 1s var(--ease) 0.32s forwards;
}
.hero-content .btn {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 1s var(--ease) 0.5s forwards;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 500;
  padding: 15px 30px;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn-light {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

/* Scroll cue */
.hero-scroll {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.hero-scroll span {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.8);
  animation: scrollcue 1.8s var(--ease) infinite;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(64px, 8.5vw, 116px);
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 28px;
}
.section-head { margin-bottom: clamp(40px, 5vw, 64px); }
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 20ch;
}

/* ---------- About ---------- */
.about { border-bottom: 1px solid var(--line); }
.about-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.2vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  margin-bottom: 40px;
}
.about-lead em { font-style: italic; color: var(--gray-700); }
.about-body {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.75;
  color: var(--gray-500);
  max-width: 58ch;
  margin-left: auto;
}
.about-body p + p { margin-top: 1.4em; }

/* ---------- Featured Projects ---------- */
.project-list { list-style: none; }
.project {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 32px;
  align-items: baseline;
  padding: 40px 8px;
  border-top: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease);
}
.project-list .project:last-child { border-bottom: 1px solid var(--line); }
.project:hover { padding-left: 20px; }
.project-index {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-300);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.project-title {
  font-size: clamp(1.35rem, 3vw, 1.95rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.12;
}
.project-desc {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--gray-500);
  max-width: 54ch;
}
.project-tag {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gray-400);
  white-space: nowrap;
  text-align: right;
}

/* ---------- Achievements (curated honors list) ---------- */
.achievements { background: var(--gray-50); border-block: 1px solid var(--line); }
.honors { list-style: none; }
.honor {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: baseline;
  gap: 20px 32px;
  padding: 28px 8px;
  border-top: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease);
}
.honors .honor:last-child { border-bottom: 1px solid var(--line); }
.honor:hover { padding-left: 16px; }
.honor-index {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-300);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.honor-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.honor-note {
  font-size: 0.85rem;
  color: var(--gray-500);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: right;
}
.honor-status {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Beyond the Classroom ---------- */
.beyond-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: clamp(28px, 3.5vw, 44px);
}
.beyond-item {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.beyond-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}
.beyond-note {
  font-size: 0.85rem;
  color: var(--gray-500);
  letter-spacing: 0.01em;
}

/* ---------- Experience ---------- */
.timeline { list-style: none; }
.tl {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 32px 48px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.timeline .tl:last-child { border-bottom: 1px solid var(--line); }
.tl-role h3 {
  font-size: 1.2rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 6px;
}
.tl-role p {
  font-size: 0.9rem;
  color: var(--gray-400);
  letter-spacing: 0.01em;
}
.tl-desc {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--gray-500);
  max-width: 56ch;
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  background: var(--ink);
  color: var(--white);
}
.contact .eyebrow { color: var(--gray-400); }
.contact-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.contact-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--gray-400);
  max-width: 44ch;
  margin: 0 auto 40px;
}
.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 400;
  color: var(--white);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.contact-email:hover { border-color: var(--white); opacity: 0.85; }

/* Social icon buttons */
.contact-socials {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--white);
  background: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    color 0.3s var(--ease), transform 0.3s var(--ease);
}
.social-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.social-name {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.social-btn:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
  transform: translateY(-2px);
}
.contact-loc {
  margin-top: 40px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--gray-500);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 32px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
}
.footer-top { transition: color 0.3s var(--ease); }
.footer-top:hover { color: var(--white); }

/* ---------- Reveal on scroll (varied) ---------- */
.reveal {
  opacity: 0;
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.r-up    { transform: translateY(30px); }
.reveal.r-left  { transform: translateX(-36px); }
.reveal.r-right { transform: translateX(36px); }
.reveal.r-scale { transform: scale(0.94); }
.reveal.r-blur  { transform: translateY(16px); filter: blur(10px); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Keyframes ---------- */
@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes scrollcue {
  0% { opacity: 0; transform: translateY(-4px); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .about-body { margin-left: 0; }
  .beyond-grid { grid-template-columns: repeat(2, 1fr); }
  .tl { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 560px) {
  .project {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-block: 30px;
  }
  .project-index { display: none; }
  .project-tag { text-align: left; }
  .project:hover { padding-left: 8px; }
  .nav-cta { display: none; }
  .honor {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 24px;
  }
  .honor-index { display: none; }
  .honor-note { text-align: left; white-space: normal; }
  .honor:hover { padding-left: 8px; }
  .beyond-grid { grid-template-columns: 1fr; }
}

/* ---------- Motion / a11y preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .hero-title, .hero-sub, .hero-content .btn { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.contact :focus-visible, .footer :focus-visible, .nav :focus-visible {
  outline-color: currentColor;
}

/* ---- Photo galleries ---- */
.has-gallery {
  cursor: pointer;
}

.project.has-gallery .project-title,
.tl.has-gallery .tl-role h3,
.honor.has-gallery .honor-title,
.beyond-item.has-gallery .beyond-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.has-gallery .project-title::after,
.has-gallery .tl-role h3::after,
.has-gallery .honor-title::after,
.has-gallery .beyond-name::after {
  content: "+";
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #9a9aa0;
  opacity: 0.85;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.has-gallery:hover .project-title::after,
.has-gallery:focus-visible .project-title::after,
.has-gallery:hover .tl-role h3::after,
.has-gallery:focus-visible .tl-role h3::after,
.has-gallery:hover .honor-title::after,
.has-gallery:focus-visible .honor-title::after,
.has-gallery:hover .beyond-name::after,
.has-gallery:focus-visible .beyond-name::after {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  opacity: 1;
}

body.lb-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 64px);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-fade 0.3s var(--ease);
}

.lightbox[hidden] {
  display: none;
}

@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-stage {
  margin: 0;
  max-width: min(1000px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: #111;
}

.lb-caption {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
  flex-wrap: wrap;
  justify-content: center;
}

.lb-caption #lbCount {
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.lb-desc {
  margin: 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.7;
  text-align: center;
}

.lb-desc[hidden] { display: none; }

.lb-img[hidden] { display: none; }

.lightbox.lb-textonly .lb-stage {
  max-width: min(680px, 100%);
  gap: 22px;
}

.lightbox.lb-textonly .lb-caption #lbTitle {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  color: #fff;
  letter-spacing: -0.01em;
}



.lb-close,
.lb-nav {
  position: fixed;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
  line-height: 1;
}

.lb-close:hover,
.lb-nav:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}

.lb-close {
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  width: 44px;
  height: 44px;
  font-size: 1.7rem;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
}

.lb-prev { left: clamp(12px, 2.5vw, 32px); }
.lb-next { right: clamp(12px, 2.5vw, 32px); }

.lb-nav[hidden] { display: none; }

@media (max-width: 560px) {
  .lb-nav { width: 44px; height: 44px; }
  .lb-img { max-height: 68vh; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { animation: none; }
}
