/* ─── Floating Nav ─────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  pointer-events: none;
}

.logo {
  pointer-events: all;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 38px; height: 38px;
  border: 2px solid var(--white);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.logo-mark span {
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  color: var(--white);
  letter-spacing: -1px;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700; font-size: 13px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.3;
}
.logo-text small {
  display: block; font-weight: 400;
  letter-spacing: .35em; font-size: 9px;
  color: var(--mid); text-transform: uppercase;
}

/* ─── Hamburger Button ──────────────────────────────── */
.hamburger {
  pointer-events: all;
  background: none; border: none;
  cursor: none;
  width: 44px; height: 44px;
  display: flex; flex-direction: column;
  align-items: flex-end; justify-content: center; gap: 6px;
  position: relative; z-index: 600;
}
.hamburger span {
  display: block; height: 1.5px;
  background: var(--white);
  transition: transform .5s cubic-bezier(.77,0,.175,1),
              opacity .4s ease, width .4s ease;
  transform-origin: right center;
}
.hamburger span:nth-child(1) { width: 30px; }
.hamburger span:nth-child(2) { width: 20px; }
.hamburger span:nth-child(3) { width: 26px; }

.hamburger.open span:nth-child(1) {
  width: 28px; transform: rotate(-45deg) translateY(1px);
}
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) {
  width: 28px; transform: rotate(45deg) translateY(-1px);
}

/* ─── Menu Overlay ─────────────────────────────────── */
.menu-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(22px) saturate(0.6);
  -webkit-backdrop-filter: blur(22px) saturate(0.6);
  display: flex; flex-direction: column;
  align-items: flex-end;
  padding: 80px 6vw 60px;
  opacity: 0; pointer-events: none;
  transition: opacity .55s cubic-bezier(.77,0,.175,1);
}
.menu-overlay.open { opacity: 1; pointer-events: all; }

.menu-overlay nav {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px;
}

.menu-item {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(32px, 5.5vw, 68px);
  text-decoration: none; color: var(--white);
  line-height: 1.1; letter-spacing: -0.03em;
  position: relative; overflow: hidden;
  display: block;
  opacity: 0;
  transform: translateY(80px) skewY(5deg);
  transition: transform .6s cubic-bezier(.77,0,.175,1),
              opacity .5s ease;
}
.menu-overlay.open .menu-item { opacity: 1; transform: none; }
.menu-overlay.open .menu-item:nth-child(1) { transition-delay: .05s; }
.menu-overlay.open .menu-item:nth-child(2) { transition-delay: .12s; }
.menu-overlay.open .menu-item:nth-child(3) { transition-delay: .19s; }
.menu-overlay.open .menu-item:nth-child(4) { transition-delay: .26s; }
.menu-overlay.open .menu-item:nth-child(5) { transition-delay: .33s; }

.menu-item::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--white);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s cubic-bezier(.77,0,.175,1);
}
.menu-item:hover::after { transform: scaleX(1); transform-origin: left; }
.menu-item:hover { color: var(--white); }

.menu-item .num {
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 300; letter-spacing: .2em;
  color: var(--mid); vertical-align: super;
  margin-right: 6px;
}

.menu-footer {
  margin-top: auto;
  display: flex; gap: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: all .5s ease .55s;
}
.menu-overlay.open .menu-footer { opacity: 1; transform: none; }
.menu-footer a {
  font-size: 11px; color: var(--mid);
  text-decoration: none; letter-spacing: .15em;
  text-transform: uppercase;
  transition: color .3s;
}
.menu-footer a:hover { color: var(--white); }

/* ─── Hero ─────────────────────────────────────────── */
.hero {
  min-height: auto; /* Allow height to be determined by content */
  position: relative;
  display: flex; flex-direction: column;
  justify-content: flex-start;
  padding: 200px 6vw 120px; /* Adjusted padding */
  overflow: hidden;
}

/* Large BG text */
.hero-bg-text {
  position: absolute; top: 55%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(140px, 30vw, 420px);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,0.06);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: -0.04em;
  user-select: none;
  z-index: 0;
}

/* Vertical divider lines decoration */
.hero::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.07) 30%, rgba(255,255,255,.07) 70%, transparent);
}

.hero-eyebrow {
  font-size: 10px; letter-spacing: .4em;
  text-transform: uppercase; color: var(--mid);
  margin-bottom: 22px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .8s .3s ease forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 7vw, 100px);
  line-height: .92; letter-spacing: -0.04em;
  max-width: 1000px;
  opacity: 0; transform: translateY(40px);
  animation: fadeUp 1s .5s cubic-bezier(.25,.46,.45,.94) forwards;
}
.hero-title em {
  font-style: normal;
  -webkit-text-stroke: 1.5px var(--white);
  color: transparent;
}

.hero-sub {
  margin-top: 28px;
  font-size: clamp(12px, 1.2vw, 14px);
  color: var(--mid); max-width: 450px;
  line-height: 1.7; font-weight: 300;
  min-height: 72px; /* Reserve space for typewriter */
}

.hero-cta {
  margin-top: 40px; display: flex; gap: 16px; align-items: center;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp .8s 1.1s ease forwards;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  background: var(--white); color: var(--black);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none; font-weight: 500;
  transition: transform .3s ease, box-shadow .3s ease;
  cursor: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(245,242,238,.15);
}
.btn-ghost {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--mid); text-decoration: none; cursor: none;
  transition: color .3s;
  display: flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { color: var(--white); }
.btn-ghost i { font-size: 10px; }

/* Scroll hint */
.scroll-hint {
  position: absolute; right: 40px; bottom: 50px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; animation: fadeUp .8s 1.4s ease forwards;
}
.scroll-hint span {
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--mid); writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,.3), transparent);
  animation: scrollPulse 2s 2s infinite ease;
}
@keyframes scrollPulse {
  0%,100% { opacity: .3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(.6); }
}

/* ─── About Section ─────────────────────────────────── */
.section {
  padding: 120px 40px;
  position: relative;
}
.section-label {
  font-size: 9px; letter-spacing: .4em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 60px;
  display: flex; align-items: center; gap: 16px;
}
.section-label::before {
  content: ''; width: 40px; height: 1px;
  background: var(--mid); display: block;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: start;
}
.about-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.03em; line-height: 1.0;
}
.about-title em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 1.5px var(--white);
}
.about-body {
  padding-top: 12px;
}
.about-body p {
  font-size: 14px; line-height: 1.9; color: #aaa;
  margin-bottom: 20px; font-weight: 300;
  min-height: 80px; /* Reserve space for typewriter */
}
.stat-row {
  display: flex; gap: 50px; margin-top: 50px;
}
.stat h3 {
  font-family: var(--font-display);
  font-size: 52px; font-weight: 800; letter-spacing: -0.04em;
}
.stat p { font-size: 10px; color: var(--mid); letter-spacing: .15em; text-transform: uppercase; margin-top: 4px; }

/* ─── Services ──────────────────────────────────────── */
.services {
  padding: 80px 40px 120px;
  border-top: 1px solid var(--border);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  margin-top: 60px;
}
.service-card {
  padding: 50px 36px;
  border-right: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: background .3s;
}
.service-card:last-child { border-right: none; }
.service-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 0;
  background: var(--white);
  transition: height .5s cubic-bezier(.77,0,.175,1);
  z-index: 0;
}
.service-card:hover::before { height: 100%; }
.service-card > * { position: relative; z-index: 1; transition: color .3s; }
.service-card:hover > * { color: var(--black); }

.service-num {
  font-size: 10px; letter-spacing: .25em;
  color: var(--mid); margin-bottom: 30px;
}
.service-icon {
  font-size: 28px; margin-bottom: 24px;
  color: var(--white);
  transition: color .3s;
}
.service-card:hover .service-icon { color: var(--black); }
.service-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 16px;
}
.service-desc {
  font-size: 12px; line-height: 1.8; color: #888;
  font-weight: 300;
  transition: color .3s;
}
.service-card:hover .service-desc { color: rgba(0,0,0,.7); }
.service-arrow {
  margin-top: 32px; font-size: 18px;
}

/* ─── Scroll Profile Image ──────────────────────────── */
.scroll-profile-wrap {
  position: fixed; /* Keep it fixed to the viewport */
  right: 6vw;
  bottom: 80px; /* Position it from the bottom */
  width: clamp(280px, 30vw, 450px);
  height: auto;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: transform, opacity;
}

.profile-img-inner {
  position: relative;
  width: 100%;
  padding-bottom: 125%; /* Aspect ratio for the portrait images */
}

.profile-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}

.profile-img.with-bg {
  opacity: 0;
}

.profile-img.no-bg {
  opacity: 1;
}

/* Adjust for responsive screens */
@media (max-width: 900px) {
  .scroll-profile-wrap {
    display: none; /* Hide photo on small screens and tablets */
  }
}

@media (max-width: 600px) {
  .nav {
    padding: 15px 20px; /* Tighter padding on mobile */
  }
  .logo-mark {
    width: 32px; height: 32px; /* Slightly smaller logo */
  }
  .logo-text {
    font-size: 11px; /* Smaller text */
  }
  .hero {
    padding-top: 120px; /* Less top padding on phones */
  }
  .hero-title {
    font-size: 38px; /* Slightly smaller title on mobile */
  }
}

/* ─── Marquee ────────────────────────────────────────── */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0; overflow: hidden;
  white-space: nowrap;
}
.marquee-inner {
  display: inline-flex; gap: 0;
  animation: marquee 20s linear infinite;
}
.marquee-inner:hover { animation-play-state: paused; }
.marquee-inner span {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--mid);
  padding: 0 40px;
}
.marquee-inner span b { color: var(--white); font-weight: 700; }
.marquee-sep {
  color: var(--mid); opacity: .4;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── Work/Projects ─────────────────────────────────── */
.work {
  padding: 120px 40px;
  border-top: 1px solid var(--border);
}
.work-list { margin-top: 60px; }
.work-item {
  border-bottom: 1px solid var(--border);
  cursor: none;
}
.work-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  position: relative;
}
.work-item-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 0;
  background: rgba(255,255,255,.04);
  transition: width .4s ease;
}
.work-item:hover .work-item-header::before { width: 100%; }

.work-item-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .8s cubic-bezier(.77,0,.175,1);
  padding: 0 40px;
}
.work-item.open .work-item-content {
  max-height: 1200px; /* Increased for preview */
  padding: 40px 40px 60px;
  border-top: 1px solid var(--border);
}
.work-item-inner {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}
.work-item-desc {
  flex: 1;
  max-width: 400px;
}
.work-item-desc p {
  font-size: 15px;
  line-height: 1.8;
  color: #aaa;
  margin-bottom: 24px;
  min-height: 80px;
}
.work-item-preview {
  flex: 1.5;
  perspective: 1000px;
}

/* Browser Mockup */
.browser-mockup {
  background: #1a1a1a;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  transform: rotateY(-10deg) rotateX(5deg);
  transition: transform .6s cubic-bezier(.165, .84, .44, 1);
}
.work-item:hover .browser-mockup {
  transform: none;
}
.browser-header {
  height: 30px;
  background: #252525;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.browser-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.browser-body {
  position: relative;
  background: #000;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.browser-carousel {
  display: flex;
  width: 300%; /* 3 images */
  height: 100%;
  transition: transform 10s linear infinite;
}
.work-item:hover .browser-carousel {
  animation: scrollBrowser 15s linear infinite;
}
.browser-carousel img {
  width: 33.333%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity .4s;
}
.work-item:hover .browser-carousel img {
  opacity: 1;
}

@keyframes scrollBrowser {
  0% { transform: translateX(0); }
  100% { transform: translateX(-66.666%); }
}

@media (max-width: 1100px) {
  .work-item-inner {
    flex-direction: column;
    gap: 40px;
  }
  .work-item-desc {
    max-width: 100%;
  }
  .browser-mockup {
    transform: none;
  }
}

.work-arrow {
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}
.work-item.open .work-arrow {
  transform: rotate(180deg);
}

.tooltip {
  position: fixed;
  display: none;
  background: var(--black);
  color: var(--white);
  padding: 10px;
  border-radius: 5px;
  pointer-events: none;
  z-index: 1000;
  font-size: 12px;
  border: 1px solid var(--border);
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 80px 40px 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px; margin-bottom: 80px;
}
.footer-brand .logo-text { font-size: 15px; margin-bottom: 20px; }
.footer-brand p {
  font-size: 12px; color: var(--mid); line-height: 1.8;
  font-weight: 300; max-width: 260px;
}
.footer-col h4 {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 24px;
}
.footer-col a {
  display: block; font-size: 13px; color: #aaa;
  text-decoration: none; margin-bottom: 12px;
  transition: color .3s; font-weight: 300;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.footer-bottom p { font-size: 11px; color: var(--mid); letter-spacing: .1em; }
.footer-bottom a { font-size: 11px; color: var(--mid); text-decoration: none; transition: color .3s; }
.footer-bottom a:hover { color: var(--white); }

/* ─── Floating Social Button ─────────────────────────── */
.social-float {
  position: fixed; right: 28px;
  top: 50%; transform: translateY(-50%);
  z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
}
.social-trigger {
  width: 46px; height: 46px;
  background: var(--white); color: var(--black);
  border: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; cursor: none;
  transition: transform .3s, box-shadow .3s;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}
.social-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.social-trigger .fa-xmark { display: none; }
.social-float.open .social-trigger .fa-share-nodes { display: none; }
.social-float.open .social-trigger .fa-xmark { display: inline-block; }

.social-links {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  overflow: hidden; max-height: 0;
  transition: max-height .5s cubic-bezier(.77,0,.175,1),
              opacity .4s ease;
  opacity: 0;
}
.social-float.open .social-links { max-height: 260px; opacity: 1; }

.social-link {
  width: 40px; height: 40px;
  background: var(--black);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--white); text-decoration: none;
  font-size: 14px; cursor: none;
  transition: background .25s, transform .25s, border-color .25s;
  opacity: 0; transform: scale(.6) translateY(20px);
}
.social-float.open .social-link {
  opacity: 1; transform: none;
}
.social-float.open .social-link:nth-child(1) { transition-delay: .05s; }
.social-float.open .social-link:nth-child(2) { transition-delay: .10s; }
.social-float.open .social-link:nth-child(3) { transition-delay: .15s; }
.social-float.open .social-link:nth-child(4) { transition-delay: .20s; }
.social-float.open .social-link:nth-child(5) { transition-delay: .25s; }
.social-link:hover {
  background: var(--white); color: var(--black);
  border-color: var(--white); transform: scale(1.12);
}
.social-label {
  font-size: 8px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--mid); margin-top: 6px; text-align: center;
}

/* ─── Scroll Progress ────────────────────────────────── */
.scroll-progress-wrap {
  position: fixed; right: 14px; bottom: 60px;
  z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}
.scroll-progress-track {
  width: 2px; height: 90px;
  background: rgba(255,255,255,.1);
  border-radius: 2px; overflow: hidden;
  position: relative;
}
.scroll-progress-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--white); border-radius: 2px;
  height: 0%;
  transition: height .1s linear;
}
.scroll-pct {
  font-size: 8px; letter-spacing: .1em;
  color: var(--mid); text-align: center;
}

/* ─── Keyframes ──────────────────────────────────────── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Scroll reveal ──────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.25,.46,.45,.94);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .nav { padding: 22px 24px; }
  .hero { padding: 120px 24px 60px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card { border-right: none; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .section { padding: 80px 24px; }
  .work { padding: 80px 24px; }
  .services { padding: 60px 24px 80px; }
  .social-float { right: 16px; }
  .scroll-progress-wrap { right: 6px; bottom: 50px; }
}

@media (max-width: 600px) {
  .hero-title { font-size: clamp(42px, 13vw, 80px); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-row { gap: 28px; }
  .menu-overlay { padding: 100px 30px 50px; }
  .menu-item { font-size: clamp(38px, 11vw, 64px); }
  .work-tag { display: none; }
  .btn-primary { padding: 12px 24px; font-size: 10px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
