:root {
  --bg: #011727;
  --text: #ffffff;
  --accent: #5699e0fa;
  --font-display: 'Oswald', sans-serif;
  --font-ui: 'Space Grotesk', monospace;
}
*, *::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);
}

/* ── 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;
  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 1s ease 1.3s;
  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: 16vw;
  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;
}

h1::before, h1::after {
  content: attr(data-short);
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
}
h1:hover::before {
  opacity: 0.8; color: rgb(100, 174, 239); z-index: -1; transform: translate(-4px, 0);
}
h1:hover::after {
  opacity: 0.8; color: rgb(130, 201, 223); z-index: -2; transform: translate(4px, 0);
}

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

@media (min-width: 1025px) {
  .name-long { display: inline; }
  .name-short { display: none; }
  h1::before, h1::after { content: attr(data-long); }

  body.lang-hi h1 {
    margin-bottom: 6vh;
  }
}

/* ── 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);
}

.experience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;

  margin-left: 2rem;
  padding-left: 2rem;
  padding-bottom: 1rem;

  max-width: 50vw;
}

.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.3);
  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;
}

.section-label {
  display: none;
}

.experience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: none;
  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 {
  padding-top: 0;
  border-top: none;
  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.3s;
  will-change: border-color;
}

.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.3s;
  width: fit-content;
  padding-right: 1rem;
}



.experience-list:hover li {
  opacity: 0.2;
  filter: blur(0.5px);
}

.experience-list li:hover,
.experience-list li.current {
  filter: none;
}

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

.experience-list li:hover .exp-role {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 157, 255, 0.27);
}

.experience-list li:hover .exp-company,
.experience-list li:hover .sub-period,
.experience-list li:hover .exp-meta {
  color: #fff;
  opacity: 1;
  text-shadow: 0 0 1px rgba(0,0,0,0.5);
}

.job-main {
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.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: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 10;
}

.timeline-dot::after {
  content: '';
  position: absolute;
  top: -2rem; bottom: -2rem;
  left: -2rem; width: 8rem;
  background: transparent;
  z-index: 100;
}

.experience-list li:hover .timeline-dot,
.experience-list li.current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px 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;
  transition: color 0.3s;
}



@media (max-width: 650px) {
  .experience-list { margin-left: 1rem; padding-left: 1.5rem; max-width: 100%; }
  .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: white;
  -webkit-text-stroke: 1px rgba(255,255,255,0.6);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 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);
}

/* ── 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 {
  opacity: 0.5;
  visibility: visible;
  animation: fadeInUp 0.6s ease-out both;
}
.experience-list li.current.reveal {
  opacity: 1;
  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;
  opacity: 1;
  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 {
  line-height: 0.9;
  margin-bottom: -0.1vh;
  padding-bottom: 0;
}

@media (max-width: 1024px) and (orientation: portrait) {
  html, body {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    position: fixed;
    width: 100%;
    overscroll-behavior: none;
  }

  #stage {
    height: 100dvh;
    width: 100vw;
    position: absolute;
    touch-action: none;
  }

  .experience-list { max-width: 75vw; }
  h1 { font-size: 13vw; bottom: 10%; }

  .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;
    width: 100%;
    padding-left: 1.5rem;
    line-height: 0.95;
  }

  .experience-list { display: none; }

  .meta-top { border-top: none; }

  .hero-img {
    width: 160%;
    right: -30%;
    height: 100vh;
    opacity: 0.6;
  }

  .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;
    font-size: 15vw !important;
    line-height: 0.8 !important;
    z-index: 20;
    pointer-events: none;
    margin: 0 !important;
  }

  .name-long { display: inline; }
  .name-short { display: none; }
  h1::before, h1::after { content: attr(data-long); }

  .lang-hi h1 {
    line-height: 0.9 !important;
    bottom: 6vh !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;

    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; }
}
