:root {
  --bg-dark: #111111;
  --bg-lighter: #1a1a1a;
  --text-primary: #ffffff;
  --text-muted: #878787;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --accent-color: #38bdf8;
  --accent-solid: #38bdf8;
  --border-color: rgba(255, 255, 255, 0.15);
  --font-heading: 'PP Neue Montreal Medium', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fragment Mono', monospace;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: clip;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

h1, h2, h3, h4, h5, h6, .heading {
  font-family: var(--font-heading);
  font-weight: 500;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Utilities */
.text-outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--text-primary);
}

.text-muted {
  color: var(--text-muted);
}

.section-padding {
  padding: 120px 5%;
}

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: all;
  background-color: transparent;
}

.preloader-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  -webkit-filter: url(#goo);
  filter: url(#goo);
}

.preloader-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: var(--accent-solid);
  transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.preloader-top {
  top: 0;
  transform-origin: top;
}

.preloader-bottom {
  bottom: 0;
  transform-origin: bottom;
}

.split-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--accent-solid);
  border-radius: 50%;
  transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

#blob1 { width: 300px; height: 300px; margin-left: -150px; }
#blob2 { width: 350px; height: 350px; margin-left: 150px; }

.preloader.split .preloader-top {
  transform: translateY(-120%);
}

.preloader.split .preloader-bottom {
  transform: translateY(120%);
}

.preloader.split #blob1 {
  transform: translate(-50%, -100vh) scale(0);
}

.preloader.split #blob2 {
  transform: translate(-50%, 100vh) scale(0);
}

.preloader-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bg-dark);
  font-family: var(--font-heading);
  transition: opacity 0.5s ease;
}

.liquid-morph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background-color: var(--bg-lighter);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  animation: liquidMorph 4s linear infinite;
  z-index: -1;
  opacity: 0.2;
}

@keyframes liquidMorph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  33% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  66% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

.preloader.split .preloader-content {
  opacity: 0;
}

.preloader-counter {
  font-size: 4rem;
  margin-bottom: 20px;
}

.preloader-bar-wrapper {
  width: 200px;
  height: 2px;
  background-color: rgba(17, 17, 17, 0.2);
  overflow: hidden;
  border-radius: 2px;
}

.preloader-bar {
  width: 0%;
  height: 100%;
  background-color: var(--bg-dark);
  transition: width 0.1s linear;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: none;
}

.btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 32px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: transparent;
}

.nav-logo-box {
  background-color: var(--accent-color);
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  border-radius: 4px;
  font-weight: bold;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.right-link {
  margin-left: auto;
}

.nav-link:hover {
  color: var(--accent-color);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5%;
  background-color: var(--bg-dark);
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  overflow: hidden;
}
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.7;
}
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 50%;
  background: linear-gradient(to top, var(--bg-dark), transparent);
}

.hero-main-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: -10vh;
}

.hero-visual {
  position: relative;
  width: 50%;
  max-width: 700px;
  overflow: hidden;
}
.hero-visual img {
  width: 100%; height: auto; display: block;
  filter: grayscale(100%);
}
.hero-visual-overlay {
  position: absolute;
  top: 20px; right: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: white;
  text-align: right;
  line-height: 1.4;
}

.hero-text-block {
  max-width: 700px;
}
.hero-heading {
  font-size: 4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  display: inline-block;
  margin-right: 16px;
  vertical-align: middle;
}

.hero-bottom-bar {
  position: absolute;
  bottom: 40px; left: 5%; right: 5%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.btn-pill {
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: var(--transition);
}
.btn-pill:hover {
  background: var(--text-primary);
  color: var(--bg-dark);
}

/* Marquee Section */
.marquee-section {
  background-color: var(--bg-dark);
  padding: 50px 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll-marquee 25s linear infinite;
}

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

.marquee-group {
  display: flex;
  align-items: center;
  gap: 50px;
  padding-right: 50px;
}

.marquee-group span {
  font-family: var(--font-heading);
  font-size: 7rem;
  text-transform: uppercase;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease, -webkit-text-stroke 0.3s ease;
  cursor: default;
}

.marquee-group span.text-outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.4);
}

.marquee-group span:hover {
  color: var(--accent-color);
  -webkit-text-stroke: 2px var(--accent-color);
  transform: scale(1.05) skewX(-10deg);
}

.marquee-icon {
  width: 70px;
  height: 70px;
  color: var(--accent-color);
  animation: spin 8s linear infinite;
  flex-shrink: 0;
}

@keyframes scroll-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Works Section Redesign */
.works-section {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  padding: 80px 0 0 0;
  
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.works-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 5% 40px 5%;
}

.works-title {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.works-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.works-divider {
  width: 90%;
  margin: 0 auto;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
}

.works-content {
  display: flex;
  padding: 40px 5%;
  justify-content: space-between;
}

.works-left {
  width: 40%;
  display: flex;
  flex-direction: column;
}

.works-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

#canvas-3d-asterisk {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-right {
  width: 55%;
}

.works-list {
  display: flex;
  flex-direction: column;
}

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: padding-left 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  color: var(--text-primary);
}

.work-row:hover {
  padding-left: 20px;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.work-num, .work-year {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.work-row:hover .work-num, .work-row:hover .work-year {
  color: var(--accent-color);
}

.work-name {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
  font-family: var(--font-body);
}

/* Works Bottom Quote */
.works-quote-wrapper {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin-top: 40px;
}

.works-quote-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.5;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%);
  mask-image: linear-gradient(to bottom, transparent, black 40%);
}

.works-quote {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 5.5vw;
  line-height: 0.95;
  letter-spacing: -0.05em;
  padding: 0 5%;
  font-weight: 700;
}

.text-gray {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.4);
}

/* Horizontal Scroll */
.horizontal-wrapper {
  
  width: 100%;
  height: 300vh; /* Allows scrolling for 3 slides */
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.horizontal-track {
  display: flex;
  flex-wrap: nowrap;
  height: 100%;
  width: max-content;
}

.horizontal-slide {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.canvas-showcase {
  position: absolute;
  width: 60%;
  height: 60%;
  z-index: 1;
}

.slide-content {
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 5%;
}

.slide-title {
  font-size: 6rem;
  font-family: var(--font-heading);
  margin-bottom: 24px;
}

.slide-desc {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

/* Skills Section (Two Column) */
.skills-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 80vh;
  background-color: var(--bg-lighter);
  
  overflow: hidden;
  gap: 40px;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.skills-text-area {
  flex: 1;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.skills-globe-container {
  flex: 1;
  height: 80vh;
  position: relative;
}

.skills-title {
  font-size: 5.5rem;
  font-family: var(--font-heading);
  line-height: 0.95;
  margin-bottom: 40px;
}

.skills-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 0;
}

/* About Section */
.about {
  background-color: var(--bg-dark);
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.about-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.about-image {
  flex: 0 0 450px;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  filter: grayscale(100%) brightness(0.5) contrast(1.1);
  transition: var(--transition);
}

.about-image:hover img {
  filter: grayscale(0%) brightness(0.8) contrast(1.1);
}

.about-text-wrapper {
  flex: 1;
}

.about-title {
  font-size: 3rem;
  margin-bottom: 40px;
}

.about-desc {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* Services Section */
.services {
  background-color: var(--bg-lighter);
  
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.services-title {
  font-size: 3rem;
  margin-bottom: 60px;
}

.service-list {
  display: flex;
  flex-direction: column;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  cursor: none;
}

.service-item::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.4s ease;
}

.service-item:hover::after {
  width: 100%;
}

.service-name {
  font-size: 2.5rem;
  font-family: var(--font-heading);
}

.service-num {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Experience Section */
.experience {
  background-color: var(--bg-dark);
  
  box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}

.experience-title {
  font-size: 3rem;
  margin-bottom: 60px;
}

.timeline {
  border-left: 1px solid var(--border-color);
  padding-left: 60px;
}

.timeline-item {
  position: relative;
  padding-bottom: 60px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -64px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.timeline-date {
  font-family: var(--font-mono);
  color: var(--accent-color);
  margin-bottom: 16px;
  display: block;
}

.timeline-role {
  font-size: 2rem;
  font-family: var(--font-heading);
  margin-bottom: 8px;
}

.timeline-company {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Footer */
.footer {
  padding: 160px 5% 40px;
  background-color: transparent;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 20;
  color: var(--text-primary);
  overflow: hidden;
}

#footer-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: auto; /* Needs to receive mouse events */
}

/* Ensure text is above canvas and clickable */
.footer-cta, .btn, .footer-bottom {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.footer-cta {
  font-size: 8vw;
  font-family: var(--font-heading);
  margin-bottom: 60px;
  line-height: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 120px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.footer-socials {
  display: flex;
  gap: 24px;
}

.footer-socials a {
  transition: var(--transition);
}

.footer-socials a:hover {
  color: var(--text-primary);
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.in-view,
.fade-up.is-inview {
  opacity: 1;
  transform: translateY(0);
}

.split-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.split-text.in-view span,
.split-text.is-inview span {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .about {
      flex-direction: column;
      gap: 60px;
  }
  
  .work-title {
      font-size: 3rem;
  }
  
  .slide-title {
      font-size: 4rem;
  }
}

@media (max-width: 768px) {
  .section-padding {
      padding: 80px 5%;
  }

  .nav-links {
      display: none; /* Hide on mobile for now */
  }

  .hero-main-content {
      flex-direction: column;
      gap: 40px;
      margin-top: 0;
  }
  
  .hero-heading {
      font-size: 2.5rem;
  }
  
  .hero-visual {
      width: 100%;
      height: 250px;
  }
  
  .hero-bottom-bar {
      flex-direction: column;
      align-items: center;
      gap: 16px;
      bottom: 20px;
  }
  
  .marquee-group span {
      font-size: 3.5rem;
  }
  .marquee-icon {
      width: 40px;
      height: 40px;
  }
  .marquee-group {
      gap: 30px;
      padding-right: 30px;
  }
  
  .works-content {
      flex-direction: column;
      gap: 40px;
  }
  .works-left, .works-right {
      width: 100%;
  }
  .works-top {
      flex-direction: column;
      align-items: flex-start;
      gap: 20px;
  }
  .works-title {
      font-size: 3rem;
  }
  .works-quote {
      font-size: 3rem;
  }
  
  .service-item {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
  }
  
  .service-name {
      font-size: 2rem;
  }
  
  .timeline {
      padding-left: 30px;
  }
  
  .timeline-item::before {
      left: -34px;
  }
  
  .footer-bottom {
      flex-direction: column;
      gap: 24px;
      align-items: center;
  }
}

/* =========================================
   ASCII Fluid Section
   ========================================= */
.ascii-fluid-section {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: #050100;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#ascii-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.ascii-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ascii-text span {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  color: #ffffff;
  letter-spacing: -0.05em;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ascii-text.is-visible span {
  opacity: 1;
  transform: translateY(0);
}

.ascii-text.is-visible span:nth-child(1) { transition-delay: 0.1s; }
.ascii-text.is-visible span:nth-child(2) { transition-delay: 0.25s; }
.ascii-text.is-visible span:nth-child(3) { transition-delay: 0.4s; }

/* RTL Support */
[dir="rtl"] .timeline {
  border-left: none;
  border-right: 1px solid var(--border-color);
  padding-left: 0;
  padding-right: 60px;
}

[dir="rtl"] .timeline-item::before {
  left: auto;
  right: -64px;
}

/* Noise Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

@media (max-width: 768px) {
  [dir="rtl"] .timeline {
      padding-right: 30px;
  }
  
  [dir="rtl"] .timeline-item::before {
      right: -34px;
  }
}

/* Custom Cursor */
.custom-cursor {
  width: 20px;
  height: 20px;
  background-color: var(--accent-color);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
  mix-blend-mode: difference;
}

.custom-cursor.hovering {
  width: 60px;
  height: 60px;
  background-color: white;
}
