/* =========================================================
   CUSTOM FONTS: ETHEREAL DEMO
   ========================================================= */
@font-face {
  font-family: 'Ethereal Demo';
  src: url('assets/fonts/EtherealDemo-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Ethereal Demo';
  src: url('assets/fonts/EtherealDemo-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

/* =========================================================
   PORTFOLIO - INFINITE FLOWING FABRIC MESH (BLACK & WHITE)
   ========================================================= */

:root {
  --font-family-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background-color: #ffffff;
  font-family: var(--font-family-base);
  color: #111111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Locked scroll state until all landing hero elements appear */
html.scroll-locked,
body.scroll-locked {
  overflow-y: hidden !important;
  height: 100vh !important;
  touch-action: pan-x !important;
}

/* Custom Stroked Circle Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-cursor.active {
  opacity: 1;
}

.cursor-ring {
  width: 28px;
  height: 28px;
  border: 2px solid #111111;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-width 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 3.5px;
  height: 3.5px;
  background-color: #111111;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Cursor States */
.custom-cursor.is-dragging .cursor-ring {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
  background-color: rgba(0, 0, 0, 0.08);
}

.custom-cursor.is-hovering .cursor-ring {
  width: 38px;
  height: 38px;
  border-width: 2px;
  border-color: #000000;
  background-color: rgba(0, 0, 0, 0.04);
}

/* Top Navigation Bar: Full width, logo on left, nav on right */
.top-nav-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(1.8rem, 3.5vh, 2.6rem) clamp(2.5rem, 5vw, 4.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
  background: transparent;
}

/* Feathered backdrop blur with smooth gradient dissolving on lower edge */
.top-nav-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -40px; /* Extends past the header so blur fades out gracefully */
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.6) 40%,
    rgba(255, 255, 255, 0.25) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 35%,
    rgba(0, 0, 0, 0.85) 55%,
    rgba(0, 0, 0, 0.45) 75%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 35%,
    rgba(0, 0, 0, 0.85) 55%,
    rgba(0, 0, 0, 0.45) 75%,
    transparent 100%
  );
}

.nav-logo {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 1.8vw, 1.65rem);
  letter-spacing: -0.035em;
  color: #0f172a;
  text-decoration: none;
  pointer-events: auto;
  user-select: none;
}

.logo-dot {
  color: #693bfe;
  font-weight: 800;
  margin-left: 0.5px;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: clamp(1.8rem, 3.6vw, 3.2rem);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: auto;
}

.nav-link {
  position: relative;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  letter-spacing: -0.01em;
  padding: 0.35rem 0.1rem;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: #0f172a;
}

/* Purple Animated Underline for Nav */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: #693bfe;
  transform: scaleX(0);
  transform-origin: left bottom;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: #0f172a;
  font-weight: 600;
}

/* Fullscreen Canvas Stage */
.stage-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  overflow: hidden;
  z-index: 1;
}

#fabricCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Controls Overlay / Replay Button */
.controls-wrapper {
  position: fixed;
  bottom: 2rem;
  right: 2.8rem;
  z-index: 50;
  pointer-events: auto;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #18181b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0, 0.2, 1);
}

.replay-btn:hover {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.replay-btn svg {
  transition: transform 0.4s ease;
}

.replay-btn:hover svg {
  transform: rotate(-180deg);
}

/* Subtle Drag Hint Badge (Bottom Left) */
.drag-hint {
  position: fixed;
  bottom: 2.2rem;
  left: 2.8rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  pointer-events: none;
  user-select: none;
}

.drag-hint svg {
  color: #64748b;
}

/* Selected Work Prompt (Hidden so the philosophy statement occupies the bottom cleanly) */
.bottom-scroll-prompt {
  display: none !important;
}

.bottom-scroll-prompt.visible {
  opacity: 1;
}

.bottom-scroll-prompt:hover {
  color: #693bfe;
  transform: translateX(-50%) translateY(2px);
}

.bottom-scroll-prompt .scroll-arrow {
  font-size: 1.05rem;
  transition: transform 0.25s ease;
}

/* Fade out drag hint and scroll prompt when user scrolls into content */
body.is-scrolled .bottom-scroll-prompt {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(14px) !important;
}

body.is-scrolled .drag-hint {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
}

/* Center Hero Stage: Side-by-side flex composition */
.hero-container {
  position: relative;
  min-height: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  user-select: none;
  -webkit-user-select: none;
  padding: clamp(5rem, 8vh, 6.8rem) clamp(2rem, 5vw, 6rem) clamp(1rem, 2vh, 1.8rem);
}

/* =========================================================
   SCROLLABLE PAGE CONTENT & WORKS MARQUEE SHOWCASE
   (Shifted up right below Studied At with subtle gap)
   ========================================================= */
.page-content {
  position: relative;
  width: 100%;
  z-index: 25;
  pointer-events: auto;
  padding: 0 0 clamp(4rem, 6vh, 6rem);
  background: transparent;
}

.works-showcase-section {
  width: 100%;
  max-width: 100vw;
  min-height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 1vh, 1.2rem) 0;
  opacity: 0; /* Hidden initially until all text and illustration finish */
  transform: translateY(24px);
  will-change: opacity, transform;
}

/* Modern Sans-Serif Philosophy Statement between Hero and Works Showcase */
.works-statement-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  /* Generous, luxurious breathing space above and below so it never looks cramped */
  padding: clamp(4.5rem, 8vh, 7rem) clamp(1rem, 2.5vw, 2.5rem) clamp(4rem, 7vh, 6rem);
  text-align: center;
  position: relative;
  z-index: 5;
}

.works-statement-text {
  font-family: var(--font-display);
  font-size: clamp(0.88rem, 1.4vw, 1.38rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #0f172a;
  white-space: nowrap; /* Strict single unbroken line */
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  user-select: none;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .works-statement-text {
    font-size: clamp(0.75rem, 2.8vw, 0.95rem);
    white-space: nowrap;
  }
}

/* =========================================================
   SPACIOUS 3-COLUMN PHONE CAROUSEL SHOWCASE
   Left: Personal Introduction ("HOW I SEE")
   Center: Phone Carousel + Synchronized Caption (with Lavender & Grid Backdrop)
   Right: Design Approach ("HOW I DESIGN")
   ========================================================= */

.carousel-hero-container {
  position: relative;
  width: 100%;
  max-width: 1380px;
  margin: clamp(1.5rem, 4vh, 3.5rem) auto clamp(2.5rem, 5vh, 4.5rem) auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  box-sizing: border-box;
}

/* Subtle Lavender Background Glow & Architectural Grid Mesh */
.carousel-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 920px;
  height: 620px;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Pale lavender radial glow fading smoothly into surrounding white page */
.carousel-lavender-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 62% 52% at 50% 48%,
    rgba(238, 230, 255, 0.75) 0%,
    rgba(246, 241, 255, 0.45) 45%,
    rgba(255, 255, 255, 0) 75%
  );
}

/* Barely visible architectural grid mesh fading out at its edges */
.carousel-grid-mesh {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 620px;
  height: 520px;
  background-image: url('grid svg.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse 58% 50% at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 58% 50% at 50% 50%, #000 20%, transparent 75%);
}

/* Spacious 3-Column Layout */
.carousel-columns-wrapper {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3.5vw, 4.5rem);
  width: 100%;
}

/* Text Columns (Left & Right) - Strictly outside the moving screens area */
.carousel-text-col {
  display: flex;
  flex-direction: column;
  z-index: 3;
}

.carousel-text-left {
  text-align: left;
  max-width: 380px;
  justify-self: end;
}

.carousel-text-right {
  text-align: left;
  max-width: 380px;
  justify-self: start;
}

/* Small violet labels: “HOW I SEE”, “HOW I DESIGN” */
.carousel-sublabel {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #693bfe;
  margin-bottom: 0.85rem;
  display: block;
  user-select: none;
}

/* Headings */
.carousel-heading {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: #0f172a;
  margin: 0 0 0.85rem 0;
}

/* Body Copy */
.carousel-body {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  font-weight: 400;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* Center Phone Carousel Column */
.carousel-phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* Phone Stage Container */
.stage {
  position: relative;
  overflow: hidden;
  background: transparent;
  width: clamp(340px, 36vw, 540px);
  margin: 0 auto;
  height: 540px;
  isolation: isolate;
  touch-action: pan-y;
  outline: none;
  mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.outside {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(50% - var(--sw) / 2),
    transparent calc(50% - var(--sw) / 2),
    transparent calc(50% + var(--sw) / 2),
    #000 calc(50% + var(--sw) / 2),
    #000 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(50% - var(--sw) / 2),
    transparent calc(50% - var(--sw) / 2),
    transparent calc(50% + var(--sw) / 2),
    #000 calc(50% + var(--sw) / 2),
    #000 100%
  );
}

.screen {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--off-y, 0px));
  width: var(--sw);
  height: var(--sh);
  border-radius: 14px;
  overflow: hidden;
  will-change: transform, opacity;
  transform-origin: center;
  background: #ffffff;
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #ffffff;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Inside Phone Window Opening */
.window {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--off-y, 0px));
  width: var(--sw);
  height: var(--sh);
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: calc(var(--sw) * 38 / 390);
  background: #ffffff;
  z-index: 2;
  pointer-events: none;
}

.window .screen {
  top: 50%;
  border-radius: 0;
  box-shadow: none;
}

/* Stationary Phone Frame Overlay */
.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--fw);
  height: var(--fh);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

/* Single Short Caption Centered ~20px Beneath Phone */
.carousel-caption-container {
  margin-top: 20px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  user-select: none;
}

.carousel-caption-text {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.5;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  transform: translateY(0);
}

.carousel-caption-text.is-fading {
  opacity: 0;
  transform: translateY(3px);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Stacking on Mobile and Tablet */
@media (max-width: 1024px) {
  .carousel-columns-wrapper {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    text-align: center;
  }

  .carousel-text-col {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
  }

  .carousel-text-left,
  .carousel-text-right {
    justify-self: center;
    text-align: center;
  }

  .stage {
    width: 100%;
    max-width: 440px;
  }

  .carousel-backdrop {
    max-width: 100%;
    height: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    will-change: auto;
  }
  .carousel-caption-text {
    transition: none !important;
  }
}

.hero-center-anchor {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(1.6rem, 3.4vw, 3.6rem);
  will-change: transform;
  margin-top: clamp(3.2rem, 7vh, 5.6rem);
}

/* Center-aligned Text Column */
.hero-text-wrapper {
  position: relative;
  top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  transform: translate(0, 0);
  will-change: transform;
  width: 100%;
  max-width: 580px;
}

/* Kicker tag above Hi, I'm Rushabh - Revealed one-by-one at the end */
.hero-kicker {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.92rem, 1.15vw, 1.05rem);
  font-weight: 600;
  color: #693bfe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.kicker-word,
.kicker-dot {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  will-change: transform, opacity;
}

.kicker-dot {
  color: #693bfe;
  font-size: 0.85em;
  opacity: 0;
}

.hero-line-1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.hero-line-2 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.3rem, 2.2vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  white-space: nowrap;
  min-height: 1.2em;
  text-align: center;
}

.line-2-prefix {
  color: #475569;
  font-weight: 500;
  font-style: normal;
  margin-right: 0.3em;
}

.line-2-highlight {
  color: #693bfe !important;
  font-style: italic !important;
  font-weight: 400 !important;
}

.type-cursor {
  display: inline-block;
  width: 3.5px;
  height: 0.88em;
  background-color: #0f172a;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 2px;
  animation: cursorBlink 0.85s infinite ease-in-out;
}

.type-cursor.cursor-2 {
  background-color: #693bfe;
}

.type-cursor.hidden {
  display: none !important;
}

.hero-subdescription {
  margin-top: clamp(0.9rem, 1.8vh, 1.3rem);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  font-weight: 500;
  line-height: 1.5;
  color: #64748b;
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  will-change: transform, opacity;
}

/* Previously Worked With Firm Showcase */
.firms-showcase {
  margin-top: clamp(1.5rem, 2.6vh, 2.2rem);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  will-change: transform, opacity;
  align-self: center;
}

/* Subtle separator hairline fading out on left and right */
.firms-divider {
  width: 100%;
  max-width: 340px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.28) 25%, rgba(148, 163, 184, 0.28) 75%, transparent 100%);
  margin: 0 auto clamp(0.2rem, 0.6vh, 0.4rem);
}

/* Clean label without any capsule boundary */
.firms-label {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.72rem, 0.85vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b99ad;
  text-align: center;
  margin: 0 auto;
  display: block;
}

/* Shorter running line: comfortably shows ~4 logos with edge blur, centered */
.firms-marquee-container {
  position: relative;
  width: 100%;
  max-width: 390px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0;
  margin: 0 auto;
  /* Blurred fade out at left and right ends */
  mask-image: linear-gradient(to right, transparent 0%, black 16%, black 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 16%, black 84%, transparent 100%);
}

.firms-track {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 2.6vw, 2.8rem);
  width: max-content;
  animation: firmsScrollLeftToRight 20s linear infinite;
  will-change: transform;
}

.firms-marquee-container:hover .firms-track {
  animation-play-state: paused;
}

@keyframes firmsScrollLeftToRight {
  0% {
    transform: translateX(-33.333%);
  }
  100% {
    transform: translateX(0%);
  }
}

.firm-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.firm-logo {
  height: clamp(26px, 2.5vw, 34px);
  width: auto;
  object-fit: contain;
  opacity: 0.88;
  filter: grayscale(100%) contrast(1.25);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.firm-logo:hover {
  opacity: 1;
  filter: grayscale(0%) contrast(1);
  transform: scale(1.06);
}

.firm-logo.logo-dar {
  height: clamp(24px, 2.3vw, 32px);
}

.firm-logo.logo-atkins {
  height: clamp(30px, 3.0vw, 40px);
}

.firm-logo.logo-bes {
  height: clamp(28px, 2.7vw, 36px);
}

/* Studied At Showcase (Static Education Logos) */
.education-showcase {
  margin-top: clamp(1.1rem, 1.8vh, 1.5rem);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  will-change: transform, opacity;
  align-self: center;
}

.education-logos-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2.4rem, 3.6vw, 4.2rem);
  padding: 0.2rem 0;
  width: 100%;
}

.education-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.education-logo {
  height: clamp(42px, 4.2vw, 52px);
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.9;
  filter: grayscale(100%) contrast(1.15);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
  display: block;
}

.education-logo:hover {
  opacity: 1;
  filter: grayscale(0%) contrast(1);
  transform: scale(1.06);
}

.education-logo.logo-vnit {
  height: clamp(48px, 4.6vw, 58px);
}

.education-logo.logo-nid {
  height: clamp(44px, 4.2vw, 54px);
}

/* Right: Portrait with Pastel Background Shapes (Mint, Lavender, Peach) */
.portrait-wrapper {
  position: relative;
  width: clamp(260px, 24vw, 360px);
  height: clamp(260px, 24vw, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
  overflow: visible !important;
}

/* Independent, absolutely positioned pastel shapes background layer */
.portrait-bg-shapes {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 124%;
  height: auto;
  aspect-ratio: 900 / 840;
  display: block;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.portrait-svg {
  position: relative;
  z-index: 2;
  width: 86%;
  height: auto;
  display: block;
  shape-rendering: geometricPrecision;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateY(7%);
}

.portrait-svg path {
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Mobile & Touch Devices: Disable custom cursor and restore native pointer */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  *,
  *::before,
  *::after,
  html,
  body {
    cursor: auto !important;
  }
  .custom-cursor {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Responsive Adjustments for Mobile & Tablets */
@media (max-width: 900px) {
  .top-nav-header {
    padding: 0.85rem 1rem;
    gap: 0.6rem;
  }
  .nav-logo {
    font-size: 1.22rem;
    flex-shrink: 0;
  }
  .nav-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.2rem 0;
    flex-shrink: 1;
    max-width: 100%;
  }
  .nav-container::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 0.25rem 0.15rem;
    flex-shrink: 0;
  }
  .hero-container {
    padding: clamp(3.8rem, 6vh, 4.5rem) 1rem 1.2rem;
  }
  .hero-center-anchor {
    flex-direction: column-reverse;
    gap: 1.4rem;
    margin-top: 1.2rem;
    width: 100%;
  }
  .hero-text-wrapper {
    top: 0;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
  }
  .hero-line-1 {
    font-size: clamp(1.85rem, 6.8vw, 2.35rem);
  }
  .hero-line-2 {
    font-size: clamp(1.4rem, 5.2vw, 1.85rem);
  }
  .hero-subdescription {
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    padding: 0 0.5rem;
  }
  .portrait-wrapper {
    width: 200px;
    height: 200px;
    max-width: 62vw;
    max-height: 62vw;
  }
  .firms-showcase,
  .education-showcase {
    width: 100%;
    max-width: 320px;
  }
}

/* =========================================================
   HALF-SCREEN SPACER (Reserved for upcoming animation)
   ========================================================= */
.upcoming-animation-spacer {
  width: 100%;
  height: 50vh;
  min-height: 380px;
  background: transparent;
  position: relative;
  pointer-events: none;
}

/* =========================================================
   PROJECTS SHOWCASE SECTION (Figma Rectangle Reveal)
   ========================================================= */
.projects-section {
  width: 100%;
  background-color: #ffffff;
  position: relative;
  z-index: 20;
  padding: clamp(2rem, 5vh, 4rem) 0 clamp(6rem, 10vh, 10rem);
  overflow: visible;
}

/* Dotted Software Canvas Grid Background (Figma-Style Dotted Workspace)
   Only visible when reader scrolls down to this section; not above */
.projects-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Crisp, subtle dotted grid points like design software canvas */
  background-image: radial-gradient(
    circle at center,
    rgba(105, 59, 254, 0.18) 1.25px,
    transparent 1.25px
  );
  background-size: 28px 28px;
  background-position: center top;
  /* Soft vertical edge falloff so it emerges smoothly from the spacer above */
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 70px,
    #000 calc(100% - 60px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 70px,
    #000 calc(100% - 60px),
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active software grid state: visible only when scrolled till this point */
.projects-section.is-software-grid-active::before {
  opacity: 1;
}

.projects-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(4.5rem, 9vh, 8rem);
  position: relative;
  z-index: 1;
}

.project-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(2.5rem, 5.5vw, 5.5rem);
}

/* Left: 52% of available row width */
.project-showcase-column {
  flex: 0 0 52%;
  max-width: 52%;
  width: 52%;
  position: relative;
  margin-top: 1.75rem;
  margin-bottom: 2.25rem;
}

/* Image frame: strictly 6 / 5 aspect ratio */
.project-frame-container {
  width: 100%;
  aspect-ratio: 6 / 5;
  position: relative;
  background: transparent;
  overflow: visible;
  border-radius: 2px;
}

/* Figma Frame Reference Metadata: Top (01 / SAJAG & 2026) and Bottom (326 × 413) */
.figma-frame-meta-top {
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 22;
  line-height: 1;
}

.figma-meta-label {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: uppercase;
  user-select: none;
}

.figma-meta-year {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f172a;
  user-select: none;
}

.figma-frame-meta-bottom {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 22;
}

.figma-dimension-badge {
  display: inline-block;
  background: #0066ff;
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2.5px 7px;
  border-radius: 3px;
  line-height: 1.3;
  white-space: nowrap;
  user-select: none;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  box-shadow: 0 1px 3px rgba(0, 102, 255, 0.25);
}

.project-thumbnail-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  z-index: 5;
  pointer-events: auto;
}

.project-thumbnail-link:focus-visible {
  outline: 2px solid #0066ff;
  outline-offset: 3px;
  border-radius: 2px;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  visibility: hidden;
  will-change: opacity;
  border-radius: 2px;
  user-select: none;
  pointer-events: none;
}

/* Figma Zoom Expanding Rectangle Transition Overlay */
.figma-zoom-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
  background-color: transparent;
}

.figma-zoom-card {
  position: fixed;
  background-color: #ffffff;
  overflow: visible;
  box-sizing: border-box;
  border: 2.5px solid #0066ff;
  will-change: top, left, width, height, border-radius;
  transform: translateZ(0);
}

.figma-zoom-card .figma-zoom-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.figma-zoom-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 2px solid #0066ff;
  box-sizing: border-box;
  z-index: 12;
  will-change: opacity;
}

.figma-zoom-handle.handle-tl { top: -4px; left: -4px; }
.figma-zoom-handle.handle-tr { top: -4px; right: -4px; }
.figma-zoom-handle.handle-bl { bottom: -4px; left: -4px; }
.figma-zoom-handle.handle-br { bottom: -4px; right: -4px; }

/* Figma-Style Selection Box */
.figma-selection-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 0%;
  border: 2.5px solid #0066ff;
  background: rgba(0, 102, 255, 0.04);
  pointer-events: none;
  z-index: 20;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  overflow: visible;
}

/* Small square corner handles */
.figma-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 2px solid #0066ff;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 22;
}

.handle-tl { top: -5px; left: -5px; }
.handle-tr { top: -5px; right: -5px; }
.handle-bl { bottom: -5px; left: -5px; }
.handle-br { bottom: -5px; right: -5px; }

/* Figma Crosshair tool cursor attached to bottom-right moving corner */
.figma-crosshair {
  position: absolute;
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
  width: 19px;
  height: 19px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 25;
}

.figma-crosshair svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Right: Information column */
.project-info-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px);
  will-change: opacity, transform;
}

/* Explicit Sequence States: idle -> drawing -> revealing -> complete */
.project-row[data-state="idle"] .project-image,
.project-row[data-state="drawing"] .project-image {
  opacity: 0 !important;
  visibility: hidden !important;
}

.project-row[data-state="idle"] .project-info-column,
.project-row[data-state="drawing"] .project-info-column {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.project-row[data-state="idle"] .figma-selection-box {
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0% !important;
  height: 0% !important;
}

.project-row[data-state="idle"] .figma-crosshair {
  opacity: 0 !important;
  visibility: hidden !important;
}

.project-row[data-state="idle"] .figma-handle,
.project-row[data-state="drawing"] .figma-handle {
  opacity: 0 !important;
  visibility: hidden !important;
}

.project-row[data-state="idle"] .figma-frame-meta-top,
.project-row[data-state="drawing"] .figma-frame-meta-top,
.project-row[data-state="idle"] .figma-frame-meta-bottom,
.project-row[data-state="drawing"] .figma-frame-meta-bottom {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Drawing state: empty rectangle and crosshair visible */
.project-row[data-state="drawing"] .figma-selection-box {
  opacity: 1 !important;
  visibility: visible !important;
}

.project-row[data-state="drawing"] .figma-crosshair {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Completed state: everything visible and interactable */
.project-row[data-state="complete"] .project-image {
  opacity: 1 !important;
  visibility: visible !important;
}

.project-row[data-state="complete"] .figma-selection-box {
  opacity: 1 !important;
  visibility: visible !important;
  width: 100% !important;
  height: 100% !important;
  background-color: transparent !important;
}

.project-row[data-state="complete"] .figma-handle {
  opacity: 1 !important;
  visibility: visible !important;
}

.project-row[data-state="complete"] .figma-crosshair {
  opacity: 0 !important;
  visibility: hidden !important;
}

.project-row[data-state="complete"] .figma-frame-meta-top,
.project-row[data-state="complete"] .figma-frame-meta-bottom {
  opacity: 1 !important;
  visibility: visible !important;
}

.project-row[data-state="complete"] .project-info-column {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.project-row[data-state="complete"] .project-title,
.project-row[data-state="complete"] .project-lead,
.project-row[data-state="complete"] .project-description,
.project-row[data-state="complete"] .project-description p,
.project-row[data-state="complete"] .project-metadata,
.project-row[data-state="complete"] .project-tags,
.project-row[data-state="complete"] .project-tags .project-tag,
.project-row[data-state="complete"] .project-cta-wrapper {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.project-title,
.project-lead,
.project-description p,
.project-metadata,
.project-tags .project-tag,
.project-cta-wrapper {
  will-change: opacity, transform;
}

.project-title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin: 0 0 0.65rem 0;
  line-height: 1.1;
}

.project-lead {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.05rem, 1.25vw, 1.22rem);
  font-weight: 500;
  color: #334155;
  margin: 0 0 1.25rem 0;
  line-height: 1.45;
}

.project-description {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.65rem;
}

.project-description p {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  line-height: 1.65;
  color: #64748b;
  margin: 0;
}

.project-metadata {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 1.45rem;
  font-weight: 400;
}

.metadata-separator {
  color: #94a3b8;
  font-weight: 300;
}

.project-tags {
  width: 100%;
  max-width: 520px;
  margin-top: -1.35rem;
  margin-bottom: 0.35rem;
  margin-left: -9px;
  position: relative;
  overflow: visible;
  line-height: 0;
}

.keyword-pills-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.project-cta-wrapper {
  margin-top: 0.2rem;
}

.project-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  border-bottom: 1.5px solid #0f172a;
  padding-bottom: 3px;
  transition: all 0.2s ease;
}

.project-cta-link:hover {
  color: #0066ff;
  border-bottom-color: #0066ff;
  transform: translateX(2px);
}

.cta-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.project-cta-link:hover .cta-arrow {
  transform: translate(2px, -2px);
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 860px) {
  .project-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.2rem;
  }
  .project-showcase-column {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
  .project-info-column {
    width: 100%;
  }
  .project-frame-container {
    aspect-ratio: 6 / 5;
  }
}
