/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f3;
  --surface:   #ffffff;
  --accent:    #1a1a2e;
  --accent2:   #4f46e5;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --text:      #111827;
  --text-light:#374151;
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.12);
  --font:      'Inter', sans-serif;
  --font-head: 'Syne', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ─────────────────────────────────────────
   SCROLL DRIVER  (280vh = 3D animation zone)
   Keep in sync with SCROLL_RANGE_PX = innerHeight * 2.8
───────────────────────────────────────── */
#scroll-driver {
  position: relative;
  height: 280vh;
  pointer-events: none;
}

/* ─────────────────────────────────────────
   THREE.JS CANVAS  (fixed, full viewport)
───────────────────────────────────────── */
#three-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

/* ─────────────────────────────────────────
   SCROLL HINT
───────────────────────────────────────── */
#scroll-hint {
  position: fixed;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 1;
  transition: opacity .4s;
  pointer-events: none;
}
#scroll-hint.hidden { opacity: 0; }

.arrow {
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ─────────────────────────────────────────
   PORTFOLIO WRAPPER
───────────────────────────────────────── */
#portfolio {
  position: relative;
  z-index: 60;   /* above crossfade overlay (z:50) and canvas (z:0) */
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
  background: var(--bg);
}
#portfolio.visible {
  opacity: 1;
  pointer-events: all;
}

/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4rem;
  background: rgba(245,245,243,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: -.02em;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent2); }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero-name {
  font-family: var(--font-head);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -.04em;
  margin-bottom: 1.25rem;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 1 2.5rem;
  line-height: 1.6;
}
.btn-primary {
  display: inline-block;
  padding: .875rem 2.5rem;
  background: var(--accent2);
  color: #fff;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  letter-spacing: .02em;
  transition: transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 4px 20px rgba(79,70,229,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79,70,229,.45);
  background: #4338ca;
}

/* ─────────────────────────────────────────
   SECTIONS — shared
───────────────────────────────────────── */
section {
  padding: 7rem 2rem;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--accent);
  margin-bottom: 3rem;
}

/* ─────────────────────────────────────────
   PROJECTS
───────────────────────────────────────── */
#projects { background: var(--bg); }

/* ─────────────────────────────────────────
   CONTACT
───────────────────────────────────────── */
#contact {
  background: var(--accent);
  color: #fff;
}
#contact .section-title { color: #fff; }
.contact-inner { text-align: center; }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
footer {
  background: var(--accent);
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  padding: 2rem;
  color: rgba(255,255,255,.35);
  font-size: .8rem;
}

/* ─────────────────────────────────────────
   NEW ELEMENTS (HERO BTNS, SKILLS CATEGORIES, ACTIONS)
───────────────────────────────────────── */
.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-outline {
  display: inline-block;
  padding: .875rem 2.5rem;
  background: transparent;
  color: var(--accent2);
  border: 1.5px solid var(--accent2);
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  letter-spacing: .02em;
  transition: transform .2s, background .2s, color .2s;
}
.btn-outline:hover {
  transform: translateY(-2px);
  background: var(--accent2);
  color: #fff;
}

/* ─────────────────────────────────────────
   INTRO SCREEN
───────────────────────────────────────── */
.intro-container {
  height: 100vh;
  width: 100vw;
  position: relative;
  background: var(--surface);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-bottom: 64px
}
#intro-line {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height 0.8s cubic-bezier(0.8, 0, 0.2, 1);
  z-index: 10;
}
.intro-container.start-intro #intro-line {
  height: 100vh;
}
#intro-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 4rem 4rem 4rem 2rem;
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease 0.8s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s;
  text-align: right;
}
#intro-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem 2rem 4rem 4rem;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease 0.8s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s;
  text-align: left;
}
.intro-container.start-intro #intro-left,
.intro-container.start-intro #intro-right {
  opacity: 1;
  transform: translateX(0);
}
@media (max-width: 768px) {
  .intro-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 6rem 1.5rem 4rem 1.5rem;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    gap: 3rem;
  }

  /* Left Side: Hero Name, Subtitle, Intro Bio, Buttons */
  #intro-left {
    order: 1;
    align-items: center;
    text-align: center;
    padding: 0;
    transform: translateY(30px);
  }
  .intro-container.start-intro #intro-left {
    transform: translateY(0);
  }

  #intro-left .hero-name {
    font-size: clamp(3rem, 12vw, 4.5rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 1.5rem !important;
  }

  /* Pill-style Subtitle */
  #intro-left .hero-sub:first-of-type {
    display: inline-block;
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent2) !important;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 auto 1.5rem auto !important;
    border: 1px solid rgba(79, 70, 229, 0.15);
  }
  
  /* Bio Paragraph */
  #intro-left .hero-sub:nth-of-type(2) {
    font-size: 1rem !important;
    line-height: 1.6;
    margin: 0 auto 2rem auto !important;
    color: var(--text-light) !important;
  }

  /* Stacked Buttons */
  #intro-left .hero-btns {
    justify-content: center !important;
    gap: 1rem;
    width: 100%;
    flex-direction: column;
  }
  #intro-left .hero-btns a {
    width: 100%;
    text-align: center;
  }
  
  /* Remove the dividing line */
  #intro-line {
    display: none !important;
  }

  /* Right Side: About Me Card */
  #intro-right {
    order: 3;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transform: translateY(30px);
    width: 100%;
    max-width: 500px;
  }
  .intro-container.start-intro #intro-right {
    transform: translateY(0);
  }
  
  #intro-right p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .intro-skills {
    justify-content: center;
    margin-top: 2rem;
  }
}

/* ─────────────────────────────────────────
   PROJECT SHOWCASE GRID
───────────────────────────────────────── */
.projects-inner {
  max-width: 1500px;
}
.projects-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
}
.project-showcase-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform 0.3s;
}
.project-showcase-card:hover {
  transform: translateY(-8px);
}
.project-image-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: calc(var(--radius) * 1.5);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s;
  background: var(--surface);
}
.project-showcase-card:hover .project-image-slider {
  box-shadow: var(--shadow-lg);
}
.project-image-slider .project-showcase-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.project-image-slider .project-showcase-img.active {
  opacity: 1;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.7);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  z-index: 10;
  font-size: 1.2rem;
  color: var(--accent);
}
.project-image-slider:hover .slider-btn {
  opacity: 1;
}
.slider-btn:hover {
  background: rgba(255, 255, 255, 1);
}
.slider-btn-prev {
  left: 10px;
}
.slider-btn-next {
  right: 10px;
}

.slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.slider-dot.active {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.2);
}

.project-showcase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.project-showcase-tags span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
}
.project-showcase-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.project-showcase-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
  cursor: pointer;
}
.project-showcase-title:hover {
  color: var(--accent2);
}
.project-showcase-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}
.project-showcase-content ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.project-showcase-content li {
  position: relative;
  padding-left: 1.5rem;
}
.project-showcase-content li::before {
  content: '▹'; /* Modern bullet point */
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--accent2);
  font-size: 1rem;
  line-height: 1.6;
}
.project-showcase-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.project-showcase-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent2);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.project-showcase-links a:hover {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media (max-width: 900px) {
  .projects-showcase-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* ─────────────────────────────────────────
   CONTACT BENTO BOX
───────────────────────────────────────── */
.contact-bento {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.contact-card {
  background: var(--surface);
  border-radius: calc(var(--radius) * 1.5);
  padding: 3rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.primary-contact h3 {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}
.primary-contact p {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.contact-secondary-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.info-contact {
  padding: 2rem;
  gap: 1.5rem;
}
.info-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.info-val {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}
.social-contact {
  padding: 2rem;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
  align-items: center;
}
.social-bento-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.social-bento-link svg {
  width: 20px;
  height: 20px;
}
.social-bento-link:hover {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .contact-bento {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 768px) {
  section { padding: 4rem 1.25rem; }
  #nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.5rem; }
  
  /* Make project image slider larger on mobile */
  .project-image-slider {
    aspect-ratio: 4/3; /* Taller aspect ratio for mobile */
  }
  
  /* Make slider arrows smaller and visible by default on mobile */
  .slider-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    opacity: 0.9; /* Visible on mobile */
  }
  .slider-btn-prev { left: 8px; }
  .slider-btn-next { right: 8px; }
  
  /* Make slider dots slightly smaller */
  .slider-dot {
    width: 6px;
    height: 6px;
  }
  
  /* Decrease title font size slightly so it doesn't dwarf the image */
  .project-showcase-title {
    font-size: 1.25rem;
  }
}
@media (max-width: 480px) {
  .nav-links { display: none; }
}

/* ─────────────────────────────────────────
   SECTION ENTRY ANIMATIONS
───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   CROSSFADE OVERLAY & HUD (Moved from main.js)
───────────────────────────────────────── */
#crossfade-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #f5f5f3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s linear;
}

#position-finder-hud {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(10, 10, 20, 0.9);
  color: #7ee8a2;
  font: 600 13px/1.7 'Courier New', monospace;
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid rgba(126, 232, 162, 0.3);
  backdrop-filter: blur(8px);
  pointer-events: none;
  text-align: center;
  min-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.hud-label {
  color: #fff;
  font-size: 13px;
  letter-spacing: .08em;
}
.hud-instruction, .hud-title {
  color: #aaa;
  font-size: 11px;
}
.hud-value {
  color: #7ee8a2;
}
.hud-value-look {
  color: #f9c74f;
}
.hud-hint {
  color: #aaa;
  font-size: 10px;
}
.hud-highlight {
  color: #fff;
}

.intro-skills {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUpIn 0.8s ease forwards;
  animation-delay: 0.8s;
}
.intro-skills span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent2);
  padding: 0.5rem 1rem;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 50px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.05);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.intro-skills span i {
  font-size: 0.9rem;
}
.intro-skills span:hover {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
