/* ===================================================
   HOME PAGE STYLES
   =================================================== */

/* --- Hero Section --- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Subtract nav height so hero fits exactly one viewport */
  min-height: calc(100vh - var(--nav-h));
  padding: 0 5%;
  background: linear-gradient(-65deg, var(--clr-bg) 55%, var(--clr-hero-light) 55.2%);
  position: relative;
  overflow: hidden;
}

/* Subtle animated grain overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 45%;
  z-index: 10;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.hero-content h3 {
  font-family: var(--ff-heading);
  font-size: var(--fs-xl);
  color: #333;
  font-weight: 500;
  margin-bottom: var(--sp-xs);
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero-content h1 {
  font-family: var(--ff-heading);
  font-size: var(--fs-4xl);
  line-height: 1.1;
  font-weight: 800;
  color: #000;
  margin-bottom: var(--sp-sm);
  white-space: nowrap;
  animation: fadeInUp 0.8s var(--ease-out) 0.35s both;
}

/* Typewriter cursor for the role */
.hero-role {
  font-size: var(--fs-md);
  color: #555;
  margin-bottom: var(--sp-xl);
  max-width: 500px;
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.hero-role .typewriter {
  display: inline;
  border-right: 2px solid #555;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #555; }
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
  animation: fadeInUp 0.8s var(--ease-out) 0.65s both;
}

.hero-ctas .btn--primary {
  background: #000;
  color: #fff;
}

.hero-ctas .btn--primary:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.hero-ctas .btn--outline {
  border-color: #333;
  color: #333;
}

.hero-ctas .btn--outline:hover {
  border-color: #000;
  color: #000;
}

/* Social Links */
.hero-social {
  display: flex;
  gap: 12px;
  align-items: center;
  animation: fadeInUp 0.8s var(--ease-out) 0.8s both;
}

.hero-social a {
  width: 42px;
  height: 42px;
  background: rgba(0,0,0,0.08);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  transition: all var(--dur-base) var(--ease-out);
}

.hero-social a:hover {
  background: #000;
  color: #fff;
  transform: translateY(-3px);
}

.hero-social .resume-link {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: var(--fs-md) !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Hero Image */
.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  /* Match hero height so image anchors to bottom */
  height: calc(100vh - var(--nav-h));
  z-index: 5;
}

.hero-image img {
  max-height: 90%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(-20px 10px 40px rgba(0,0,0,0.6));
  animation: slideInRight 1s var(--ease-out) 0.4s both;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  z-index: 10;
  animation: fadeIn 1s var(--ease-out) 1.5s both;
}

.scroll-indicator span {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-indicator .scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--clr-text-muted), transparent);
  animation: float 2s ease-in-out infinite;
}

/* --- Services Section --- */
.services {
  background: var(--clr-bg);
  padding: var(--sp-3xl) 5%;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.service-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: var(--sp-2xl);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--dur-base);
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--clr-border-h);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card i {
  font-size: 32px;
  color: var(--clr-text);
  margin-bottom: var(--sp-lg);
  display: block;
}

.service-card h3 {
  font-family: var(--ff-heading);
  font-size: var(--fs-md);
  margin-bottom: var(--sp-md);
  letter-spacing: 0.5px;
}

.service-card p {
  font-size: var(--fs-sm);
  color: var(--clr-text-dim);
  line-height: 1.7;
}

/* --- Featured Section (About Preview) --- */
.featured-about {
  background: var(--clr-surface);
  padding: var(--sp-4xl) 5%;
  text-align: center;
  position: relative;
}

.featured-about .bg-text {
  bottom: -40px;
  right: 2%;
}

.featured-about-inner {
  max-width: 800px;
  margin: 0 auto;
}

.featured-about p {
  font-size: var(--fs-base);
  line-height: 1.9;
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-xl);
}

.featured-about .btn {
  margin-top: var(--sp-md);
}

/* --- Responsive --- */

@media (max-width: 1200px) {
  .hero {
    background: linear-gradient(-65deg, var(--clr-bg) 50%, var(--clr-hero-light) 50.2%);
  }
}

@media (max-width: 1100px) {
  .hero-content h1 {
    font-size: var(--fs-3xl);
    white-space: normal;
  }
}

/* Tablet: 2-column services grid instead of 3 */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    background: var(--clr-bg) !important;
    padding: 0;
    position: relative;
    /* Explicit height needed for absolute children to fill correctly */
    height: calc(100dvh - var(--nav-h));
    min-height: 480px;
  }

  .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }

  .hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.35);
    max-height: 100%;
  }

  .hero-content {
    position: absolute;
    /* iOS safe area support so content isn't behind home bar */
    bottom: max(32px, env(safe-area-inset-bottom, 0px) + 20px);
    left: 24px;
    right: 24px;
    max-width: 100%;
    z-index: 10;
    text-align: left;
  }

  .hero-content h3 {
    font-size: var(--fs-base);
    color: var(--clr-accent);
    margin-bottom: 2px;
  }

  .hero-content h1 {
    font-size: var(--fs-2xl);
    color: var(--clr-text);
    white-space: normal;
    margin-bottom: var(--sp-xs);
  }

  .hero-role {
    font-size: var(--fs-sm);
    color: var(--clr-text-dim);
    margin-bottom: var(--sp-md);
  }

  .hero-role .typewriter {
    border-right-color: var(--clr-text-dim);
  }

  .hero-ctas {
    flex-wrap: wrap;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-md);
  }

  .hero-ctas .btn {
    font-size: var(--fs-xs);
    padding: 10px 20px;
  }

  .hero-ctas .btn--primary {
    background: var(--clr-text);
    color: var(--clr-bg);
  }

  .hero-ctas .btn--outline {
    border-color: rgba(255,255,255,0.4);
    color: var(--clr-text);
  }

  .hero-social a {
    background: rgba(255,255,255,0.1);
    color: var(--clr-text);
    font-size: var(--fs-lg);
  }

  .scroll-indicator {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-lg);
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 420px;
  }

  .hero-content {
    bottom: 24px;
    left: 20px;
    right: 20px;
  }

  .hero-content h1 {
    font-size: 1.65rem;
  }

  .hero-ctas {
    gap: 6px;
  }
}
