:root {
  --bg-primary: #FFF9F5; /* Cream */
  --bg-secondary: #FFEFE5;
  --text-primary: #4A3028; /* Warm Dark Brown */
  --text-secondary: #7A5C53;
  --accent: #FF8C42; /* Warm Orange */
  --accent-secondary: #FF8FA3; /* Warm Light Pink */
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 140, 66, 0.2);
  --glass-bg: rgba(255, 249, 245, 0.85);
}

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

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease;
  /* Containing block for .bg-shorts so it can span the full page height */
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

/* Background animated glow */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 20s infinite alternate;
}

.glow-orb.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -100px;
  left: -100px;
}

.glow-orb.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-secondary);
  bottom: -200px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(100px, 100px) scale(1.1); }
  100% { transform: translate(-50px, 150px) scale(0.9); }
}

/* Ambient background shorts: muted YouTube shorts drifting behind the
   content. The layer is positioned absolutely over the FULL page height
   (not the viewport), so each short is anchored to a depth of the page and
   scrolls into view with the surrounding sections. Hidden until the visitor
   scrolls past the hero — index.html toggles `is-scrolled` on <body>. */
.bg-shorts {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  overflow: hidden;
}

body.is-scrolled .bg-shorts {
  opacity: 1;
}

/* One floating phone-shaped short. The cream tint + reduced opacity keep
   the motion non-distracting behind the glass cards without blurring. */
.bg-short {
  position: absolute;
  width: 336px;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  opacity: 0.5;
  animation: drift 16s infinite alternate ease-in-out;
}

.bg-short iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* Warm cream tint over each video so the footage blends with the palette */
.bg-short::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 249, 245, 0.35), rgba(255, 239, 229, 0.5));
}

/* Stagger position, speed and phase so the shorts never move in lockstep.
   `top` percentages are depths of the WHOLE page, so each short appears as
   the visitor scrolls through that part of the site, alternating sides all
   the way down: skills, experience, projects and education. */
.bg-short-1 {
  top: 16%;
  left: 3%;
  animation-duration: 13s;
}

.bg-short-2 {
  top: 30%;
  right: 4%;
  animation-duration: 17s;
  animation-delay: -12s;
}

.bg-short-3 {
  top: 44%;
  left: 6%;
  animation-duration: 20s;
  animation-delay: -7s;
}

.bg-short-4 {
  top: 58%;
  right: 8%;
  animation-duration: 15s;
  animation-delay: -4s;
}

.bg-short-5 {
  top: 72%;
  left: 4%;
  animation-duration: 18s;
  animation-delay: -10s;
}

.bg-short-6 {
  top: 85%;
  right: 5%;
  animation-duration: 14s;
  animation-delay: -6s;
}

@keyframes drift {
  0% { transform: translate(0, 0) rotate(-2deg); }
  50% { transform: translate(50px, -70px) rotate(2deg); }
  100% { transform: translate(-40px, 50px) rotate(3deg); }
}

/* Motion-sensitive visitors get the calm static background instead */
@media (prefers-reduced-motion: reduce) {
  .bg-shorts {
    display: none;
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / Nav */
nav {
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

/* Hero Section */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-size: 64px;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-text h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.btn {
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  box-shadow: 0 8px 25px rgba(255, 140, 66, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 140, 66, 0.4);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
  border: 2px solid var(--accent-secondary);
}

.btn-outline:hover {
  background: var(--accent-secondary);
  color: white;
  transform: translateY(-3px);
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  max-width: 450px;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(122, 92, 83, 0.15);
  position: relative;
  z-index: 1;
  border: 4px solid white;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(45deg, var(--accent), var(--accent-secondary));
  z-index: 0;
  opacity: 0.6;
  filter: blur(25px);
}

/* Sections */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 42px;
  margin-bottom: 60px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: 2px;
}

/* Small helper line shown under a section title (e.g. "click to expand" hint) */
.section-hint {
  text-align: center;
  color: var(--text-secondary);
  margin: -40px 0 40px;
  font-size: 16px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid white;
  border-radius: 24px;
  padding: 40px;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(122, 92, 83, 0.05);
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-secondary);
  box-shadow: 0 20px 40px rgba(255, 140, 66, 0.15);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* Skills */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.skill-tag {
  background: white;
  border: 1px solid var(--card-border);
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.skill-tag:hover {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: white;
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(255, 140, 66, 0.2);
}

/* Timeline / Experience */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.timeline-item {
  position: relative;
  padding-left: 50px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-secondary));
  opacity: 0.3;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--accent);
  box-shadow: 0 0 15px rgba(255, 140, 66, 0.4);
}

.timeline-date {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-block;
  background: rgba(255, 140, 66, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.timeline-title {
  font-size: 26px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.timeline-company {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 18px;
}

.timeline-item ul {
  color: var(--text-secondary);
  padding-left: 20px;
  line-height: 1.8;
}

.timeline-item li {
  margin-bottom: 10px;
}

/* Expandable experience cards (native <details>/<summary>) */
.experience-card > summary {
  cursor: pointer;
  list-style: none; /* hide the default disclosure triangle */
}

.experience-card > summary::-webkit-details-marker {
  display: none; /* Safari/Chrome default marker */
}

.experience-blurb {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* "click to expand" affordance under the collapsed card header */
.expand-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  background: rgba(255, 140, 66, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.experience-card > summary:hover .expand-hint {
  background: rgba(255, 140, 66, 0.2);
}

.expand-chevron {
  display: inline-block;
  transition: transform 0.3s ease;
}

.experience-card[open] .expand-chevron {
  transform: rotate(180deg);
}

/* Revealed body: role highlights + related projects */
.experience-body {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--card-border);
  animation: reveal 0.35s ease;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.related-heading {
  margin: 28px 0 16px;
  font-size: 18px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.related-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.related-project {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.related-project:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 8px 20px rgba(255, 140, 66, 0.1);
}

.related-project h4 {
  font-size: 17px;
  margin-bottom: 10px;
}

.related-project p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 10px;
}

/* Projects */
.projects-grid {
  display: grid;
  /* min(340px, 100%) keeps cards from overflowing on very narrow screens */
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 32px;
}

.project-card h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

/* Technology tag pills shown on project cards */
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tech-tag {
  background: rgba(255, 140, 66, 0.1);
  color: var(--accent);
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.project-company {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: block;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.project-card ul {
  padding-left: 20px;
  color: var(--text-secondary);
}

.project-card li {
  margin-bottom: 8px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.video-card {
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}

.video-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(255, 140, 66, 0.15);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.short-container {
  position: relative;
  padding-bottom: 177.77%; /* 9:16 for shorts */
  height: 0;
  overflow: hidden;
}

.video-container iframe, .short-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-info {
  padding: 24px;
}

.video-info h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.video-info p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Pulse Animation for Guide Button */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 140, 66, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 140, 66, 0); }
}

.btn-pulse {
  animation: pulse 2s infinite;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Footer */
footer {
  padding: 80px 0 40px;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 100px;
  background: linear-gradient(to bottom, transparent, rgba(255, 140, 66, 0.05));
}

.social-links {
  display: flex;
  /* Wrap so all links stay visible on narrow screens instead of clipping */
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
}

.social-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 12px 24px;
  border-radius: 30px;
  background: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.social-links a:hover {
  color: white;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text p {
    margin: 0 auto 40px auto;
  }
  
  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .hero-image {
    margin-top: 40px;
    display: flex;
    justify-content: center;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    gap: 16px;
  }
  
  .nav-links a {
    font-size: 14px;
  }

  .related-projects {
    grid-template-columns: 1fr;
  }

  /* Phones show the same shorts at the same page depths as desktop —
     only smaller, so the layout stays a single source of truth. */
  .bg-short {
    width: 267px;
  }
}

/* Narrow phones: tighten card padding and the timeline gutter */
@media (max-width: 600px) {
  .glass-card {
    padding: 28px 22px;
  }

  .social-links {
    gap: 12px;
  }

  .social-links a {
    font-size: 15px;
    padding: 10px 18px;
  }

  .timeline-item {
    padding-left: 36px;
  }

  .timeline-item::after {
    left: -2px;
  }

  .hero-text h1 {
    font-size: 42px;
  }

  .section-title {
    font-size: 32px;
  }
}
