:root {
  --bg: #050505;
  --accent: #ccff00; 
  --font-display: 'Oswald', sans-serif;
  --font-ui: 'Space Grotesk', monospace;
  color-scheme: dark;
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overscroll-behavior: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── Stage ── */
#stage {
  position: relative;
  width: 100vw; 
  height: 100vh;
  height: 100dvh; 
  overflow: hidden;
}

/* ── Layers ── */
.layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; 
}

/* ── Layer 1: Background / Image ── */
.background {
  z-index: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-img {
  height: 110vh; width: auto;
  min-width: 60vw;
  object-fit: cover;
  filter: grayscale(1) contrast(1.3) brightness(0.7);
  opacity: 0.7;
  transform: scale(1.05); 
  pointer-events: none;

  -webkit-mask-image: linear-gradient(to right, transparent 5%, black 40%), radial-gradient(circle at 75% 40%, black 30%, transparent 85%);
  mask-image: linear-gradient(to right, transparent 5%, black 40%); 
  mix-blend-mode: luminosity;
  
  will-change: transform;
  animation: drift 15s infinite alternate ease-in-out;
}

@keyframes drift {
  0%   { transform: scale(1.05) translate3d(0, 0, 0); }
  20%  { transform: scale(1.05) translate3d(1.5px, -1.0px, 0); }
  40%  { transform: scale(1.05) translate3d(-1.2px, 1.0px, 0); }
  60%  { transform: scale(1.05) translate3d(1.0px, 1.5px, 0); }
  80%  { transform: scale(1.05) translate3d(-1.5px, -1.0px, 0); }
  100% { transform: scale(1.05) translate3d(0, 0, 0); }
}

@keyframes drift-mobile {
  0%   { transform: scale(1.05) translate3d(0, 0, 0); }
  20%  { transform: scale(1.05) translate3d(0.7px, -0.5px, 0); }
  40%  { transform: scale(1.05) translate3d(-0.6px, 0.5px, 0); }
  60%  { transform: scale(1.05) translate3d(0.5px, 0.7px, 0); }
  80%  { transform: scale(1.05) translate3d(-0.7px, -0.5px, 0); }
  100% { transform: scale(1.05) translate3d(0, 0, 0); }
}


.noise {
  position: absolute; inset: -50%;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E"); 
  
  mix-blend-mode: normal; 
  opacity: 0.08; 
  z-index: 3;
  
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform; 
  animation: noiseGrain 0.2s steps(3) infinite; 
}

@keyframes noiseGrain {
  0%   { transform: translate3d(0, 0, 0); }
  10%  { transform: translate3d(-5%, -5%, 0); }
  20%  { transform: translate3d(-10%, 5%, 0); }
  30%  { transform: translate3d(5%, -10%, 0); }
  40%  { transform: translate3d(-5%, 15%, 0); }
  50%  { transform: translate3d(-10%, 5%, 0); }
  60%  { transform: translate3d(15%, 0, 0); }
  70%  { transform: translate3d(0, 10%, 0); }
  80%  { transform: translate3d(-15%, 0, 0); }
  90%  { transform: translate3d(10%, 5%, 0); }
  100% { transform: translate3d(5%, 0, 0); }
}

/* ── Intro Sequence ── */
.js body:not(.loaded) .noise,
.js body:not(.loaded) h1,
.js body:not(.loaded) .experience-list li,
.js body:not(.loaded) .brutal-link {
  opacity: 0 !important; 
  visibility: hidden;
}

.js .hero-img {
  transition: opacity 1.5s ease-out;
  will-change: opacity;
}
.js .hero-img:not(.ready) {
  opacity: 0 !important;
  visibility: hidden;
}



.js body.loaded .noise {
  transition: opacity 1.5s ease-out;
  transition-delay: 0.1s; 
}

.js body.loaded h1 {
  transition: opacity 1s ease-out 0.5s; 
}

.js body.loaded .scan-line {
  transition: opacity 0.4s ease-out 0.8s; 
  opacity: 1;
  visibility: visible;
}



/* ── Layer 2: Typography (The Monolith) ── */
.typography {
  z-index: 20; 
  display: flex;
  align-items: flex-end;
  justify-content: center; 
  padding: 0;             
  width: 100vw;           
  left: 0;                
  mix-blend-mode: difference; 
}

h1 {
  font-family: var(--font-display);
  font-size: 15.75vw; 
  line-height: 0.8;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: -0.04em;
  white-space: nowrap;
  
  text-align: center;
  width: 100%; 
  margin: 0;
  margin-bottom: -0.3vh; 
  
  position: relative;
}

.name-long { display: none; }
.name-short { display: inline; }

@media (min-width: 1025px) {
  .name-long { display: inline; }
  .name-short { display: none; }
  
  body.lang-hi h1 {
    margin-bottom: 1.5vh;
  }
}

/* ── Layer 3: UI / HUD ── */
.ui {
  z-index: 100;
  padding: 3rem;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start; 
  pointer-events: none;
  will-change: auto;
  transform: translateZ(0); 
}

.meta-top {
  display: block;
  padding-top: 1rem;
  position: relative;
  pointer-events: none;
  --cursor-x: calc(100vw - 14rem);
  --line-dim: 0;
}

.meta-top.interactive {
  pointer-events: auto;
}

.scan-line {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.45); 
  overflow: hidden; 
  opacity: 0;
  visibility: hidden;
}

.scan-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  
  width: 300px; 
  height: 100%;
  
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
  
  transform: translate3d(calc(var(--cursor-x) - 150px), 0, 0);
  
  opacity: var(--line-dim);
  transition: opacity 0.1s ease-out, transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  
  z-index: 10;
  pointer-events: none;
  will-change: transform, opacity;
}

.experience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 2.3rem; 
  margin-left: 2.5rem;  
  padding-bottom: 0;    
  max-width: 50vw; 
  font-family: var(--font-ui);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  pointer-events: auto; 
  cursor: default; 
}

.experience-list.education-list {
  margin-top: 4rem; 
}

.experience-list:not(.education-list) li:last-child::before {
  bottom: -4.4rem; 
}

.experience-list li::before {
  content: '';
  position: absolute;
  top: 0.8rem; 
  bottom: -2.3rem;
  left: -3.99rem; 
  width: 2rem;
  border-right: 1px solid rgba(255,255,255,0.65);
  background: transparent;
  z-index: 5;
  transition: border-color 0.08s ease-out;
}

.experience-list li:hover::before {
  border-color: rgba(204, 255, 0, 0.3);
}

.experience-list.education-list li:last-child::before {
  display: none;
}

.experience-list li {
  position: relative;
  margin-bottom: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.08s ease-out;
  width: fit-content;
  padding-right: 1rem; 
}

.experience-list li::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -3.5rem; right: 0;
}



.experience-list:hover li {
  opacity: 0.2;
  transition: opacity 0.08s;
}

.experience-list li:hover,
.experience-list li.current {
  opacity: 1;
}

.experience-list li:hover .job-main {
  transform: translateX(10px);
}

.experience-list li:hover .exp-role {
  color: var(--accent); 
}

.experience-list li:hover .exp-company,
.experience-list li:hover .sub-period,
.experience-list li:hover .exp-meta {
  color: #fff; 
  opacity: 1;
}

.job-main {
  transition: transform 0.08s ease-out;
}

.timeline-dot {
  position: absolute;
  left: -2.3rem; 
  top: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--bg);
  border: 1px solid #ffffff;
  border-radius: 0;
  transform: rotate(45deg);
  transition: background 0.08s ease-out, border-color 0.08s ease-out, transform 0.08s ease-out; 
  z-index: 10;
}

.experience-list li:hover .timeline-dot,
.experience-list li.current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg) scale(1.5);
}

/* ── Grouped Experience Styling ── */
.roles-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.role-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  opacity: 0.5; 
}

.roles-group .role-row:first-child {
  opacity: 1;
  font-weight: 700; 
}



.sub-period {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6); 
  font-family: var(--font-ui);
}

.group-footer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.group-entry .timeline-dot {
  top: 0.55rem;
}

.job-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.exp-role {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.exp-company {
  color: var(--accent);
}

.exp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
}

.exp-period::before {
  content: '// ';
  color: rgba(255,255,255,0.3);
  margin-right: 0.3rem;
}



@media (max-width: 650px) {
  .experience-list { margin-left: 1rem; padding-left: 1.5rem; max-width: 100%; }
  .experience-list li::after { left: -2.5rem; }
  .timeline-dot { left: -1.8rem; }
  
  .meta-top { pointer-events: none; }
  .scan-line { display: none; } 
  .meta-top { border-top: none; } 
  
  .links {
    position: relative; 
    top: auto; right: auto;
    align-items: flex-start;
    flex-direction: row;
    margin-top: 2rem;
    margin-bottom: 20vh;
  }
}

.links {
  position: absolute; 
  top: 3rem; 
  right: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  pointer-events: auto; 
}

.brutal-link {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 3rem; 
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.6);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: color 0.3s cubic-bezier(0.19, 1, 0.22, 1), -webkit-text-stroke 0.3s cubic-bezier(0.19, 1, 0.22, 1), transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  opacity: 0; 
  visibility: hidden;
}

.brutal-link::before {
  content: '';
  position: absolute; bottom: 0; right: 0; 
  width: 100%; 
  height: 6px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.brutal-link:hover,
.brutal-link:focus {
  color: #fff;
  -webkit-text-stroke: 1px #fff;
  transform: translateX(-20px);
}
.brutal-link:hover::before,
.brutal-link:focus::before { transform: scaleX(1); }

.brutal-link .icon {
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s;
  color: var(--accent);
  stroke: var(--accent);
}
.brutal-link:hover .icon,
.brutal-link:focus .icon {
  opacity: 1; transform: translateX(0);
}

/* Email Copied State */
#email .copied-label,
#email .copied-icon { display: none; }
#email.copied .label:not(.copied-label) { display: none; }
#email.copied .icon:not(.copied-icon) { display: none; }
#email.copied .copied-label { display: inline; color: var(--accent); }
#email.copied .copied-icon { display: inline; opacity: 1; transform: translateX(0); color: var(--accent); stroke: var(--accent); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; }
  to   { opacity: 0.5; } 
}
@keyframes fadeInUpCurrent {
  from { opacity: 0; }
  to   { opacity: 1; } 
}

/* Explicit Reveal States */
.experience-list li.reveal {
  visibility: visible;
  animation: fadeInUp 0.6s ease-out both;
}
.experience-list li.current.reveal {
  animation: fadeInUpCurrent 0.6s ease-out both;
}
.experience-list li:hover {
  opacity: 1;
}

/* Links Animation */

.brutal-link.reveal {
  animation: fadeInUpCurrent 0.6s ease-out both;
  visibility: visible;
}

/* ── Exit Sequence ── */
.js body.is-exiting .experience-list li,
.js body.is-exiting .brutal-link {
  transition: opacity 0.1s ease-out !important;
  opacity: 0 !important;
  animation: none !important;
  transition-delay: 0s !important;
}

.js body.is-exiting .scan-line {
  transition: opacity 0.1s ease-out 0.05s !important;
  opacity: 0 !important;
}

.js body.is-exiting h1 {
  transition: opacity 0.1s ease-out 0.1s !important;
  opacity: 0 !important;
}

.js body.is-exiting .hero-img {
  transition: opacity 0.2s ease-out 0.15s !important;
  opacity: 0 !important;
}

.js body.is-exiting .noise {
  transition: opacity 0.2s ease-out 0.2s !important;
  opacity: 0 !important;
}

/* ── Responsive ── */

/* ── Hindi Localization Overrides ── */
.lang-hi h1 {
  font-family: 'Teko', var(--font-display);
  font-weight: 700;
  font-size: 17.5vw;
  line-height: 0.85;
  margin-bottom: 1.5vh;
  padding-bottom: 0; 
}

@media (max-width: 1024px) and (orientation: portrait) {
  html, body {
    height: 100%;
    height: -webkit-fill-available; 
    overflow: hidden;
    overflow: clip;
    position: fixed; 
    width: 100%;
    overscroll-behavior: none;
  }
  
  #stage {
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh; 
    width: 100vw;
    position: absolute; 
    touch-action: none;
    overflow: clip;
  }

  .experience-list { max-width: 75vw; }
  h1 { font-size: 13vw; bottom: 10%; }
  .lang-hi h1 { font-size: 16vw; margin-bottom: 0; }
  
  .brutal-link { width: max-content; }

  .hero-img {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    width: auto;
    animation-name: drift-mobile;
  }
  
  .noise { opacity: 0.16; }
}

@media (orientation: landscape) {
  html, body {
    position: static !important;
    height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: auto !important;
  }
  #stage {
    position: relative !important;
    touch-action: auto !important;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  h1 { 
    font-size: 23vw; 
    bottom: 2vh;
    white-space: normal;
    word-break: break-word; 
    text-align: left; 
    margin-left: 0.06em;
    width: 100%;
    padding-left: max(1.5rem, env(safe-area-inset-left)); 
    line-height: 0.95;
  }
  .lang-hi h1 { font-size: 28vw; line-height: 0.85; margin-bottom: -2vh; }
  
  .experience-list { display: none; }
  
  .meta-top { border-top: none; }

  .hero-img { 
    width: 160%; 
    right: -30%; 
    height: 100vh;
    opacity: 0.6;
    filter: grayscale(1) contrast(1.3) brightness(0.7); 
  }
  
  .ui {  
    padding: 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    justify-content: flex-start; 
    height: 100%; 
  }
  
  .links { 
    position: relative; 
    top: auto; right: auto; 
    margin-top: 0;
    margin-bottom: 0;
    align-items: flex-start; 
    width: 100%;
    
    flex-direction: column !important;
    gap: 0.5rem; 
  }
  
  .brutal-link:hover,
  .brutal-link:focus {
    transform: translateX(15px) !important;
  }
  .brutal-link:hover .icon,
  .brutal-link:focus .icon {
    transform: translateX(5px) !important;
  }
  
  .brutal-link { font-size: 2.5rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  h1 { 
    display: block !important; 
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important; right: auto !important;
    width: 100% !important;
    text-align: left !important; 
    padding-left: max(2rem, env(safe-area-inset-left)) !important;
    margin-left: 0.035em !important;
    font-size: 15vw !important; 
    line-height: 0.8 !important;
    z-index: 20; 
    pointer-events: none;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-right: 0 !important;
  } 

  .name-long { display: inline; }
  .name-short { display: none; }

  .lang-hi h1 {
    font-size: 18vw !important;
    line-height: 0.85 !important;
    margin-bottom: 0 !important;
  }

  .hero-img { 
    opacity: 0.6;
    width: 80vw !important; 
    min-width: 0 !important;
    height: auto !important; 
    
    position: absolute !important; 
    right: 0 !important; 
    top: -45% !important;
    bottom: auto !important;
    
    filter: grayscale(1) contrast(1.3) brightness(0.7);
    animation-name: drift-mobile;
  }

  .noise { opacity: 0.16 !important; }
  
  .ui {  
    padding: 0.5rem max(2rem, env(safe-area-inset-right)) 0.5rem max(2rem, env(safe-area-inset-left)) !important; 
    display: flex; 
    flex-direction: row; 
    justify-content: flex-start; 
    align-items: flex-start;
    gap: 2rem;
    padding-top: 0.5rem !important; 
    height: 100vh;
    overflow: hidden; 
  }
  
  .meta-top { border: none; padding-top: 0; display: none; }
  
  .links { 
    position: relative; 
    top: 0 !important; 
    left: auto; right: auto;
    margin-top: 0 !important; 
    align-items: flex-start; 
    flex-shrink: 0;
    
    flex-direction: column !important;
    gap: 0.25rem !important; 
  }
  
  .brutal-link {
    font-size: 2rem !important; 
  }

  .brutal-link::before { transform-origin: left center !important; }
  
  .brutal-link:hover,
  .brutal-link:focus {
    transform: translateX(15px) !important;
  }
  .brutal-link:hover .icon,
  .brutal-link:focus .icon {
    transform: translateX(5px) !important;
  }
  
  .experience-list { display: none !important; }
}
