/*
  hero.css
  The first screen: giant name, short intro, availability line,
  the GitHub / LinkedIn buttons, and a portrait.
*/

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;   /* dvh avoids the jump when mobile browser bars show/hide */
  padding-top: calc(var(--navbar-height) + var(--space-6));
}

.hero__inner {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: var(--space-5);
  padding-bottom: var(--space-7);
}

/* Text sits on top of the photo (z-index) so the name can overlap it */
.hero__text {
  grid-column: 1 / span 7;
  grid-row: 1;
  position: relative;
  z-index: 2;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__line {
  display: block;
}

.hero__lead {
  max-width: 40ch;
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* "Learning by building..." with a small accent dot */
.hero__status {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.hero__status-dot {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Quiet text link under the buttons, for visitors who'd rather keep scrolling */
.hero__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* ---------- Portrait ---------- */
.hero__media {
  grid-column: 7 / -1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  height: min(74dvh, 720px);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

/* object-position: crop from near the top so the head keeps its headroom.
   --photo-dim (variables.css) tones down the photo's bright studio backdrop in dark mode. */
.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
  filter: var(--image-filter) brightness(var(--photo-dim));
}

/* Soft fade on the left edge so the photo melts into the background behind the name,
   plus a gentle vignette so the light backdrop doesn't end in a hard bright edge */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-bg) 0%, transparent 45%),
              linear-gradient(0deg, color-mix(in srgb, var(--color-bg) 60%, transparent) 0%, transparent 30%),
              radial-gradient(ellipse 75% 70% at 62% 42%, transparent 50%, color-mix(in srgb, var(--color-bg) var(--photo-vignette), transparent) 100%);
  pointer-events: none;
}

/* ---------- Load-in animation (skipped for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__line,
  .hero__lead,
  .hero__status,
  .hero__actions,
  .hero__more {
    animation: hero-rise var(--duration-slow) var(--ease-out) both;
  }

  .hero__line:nth-child(1) { animation-delay: 120ms; }
  .hero__line:nth-child(2) { animation-delay: 220ms; }
  .hero__lead { animation-delay: 360ms; }
  .hero__status { animation-delay: 420ms; }
  .hero__actions { animation-delay: 480ms; }
  .hero__more { animation-delay: 540ms; }

  .hero__media {
    animation: hero-unveil 1.4s var(--ease-out) 150ms both;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
}

/* The photo opens from bottom to top, like a curtain */
@keyframes hero-unveil {
  from {
    clip-path: inset(100% 0 0 0 round var(--radius-card));
  }
  to {
    clip-path: inset(0 0 0 0 round var(--radius-card));
  }
}

/* ---------- Tablet and phone: stack text above the photo ---------- */
@media (max-width: 899px) {
  .hero__inner {
    grid-template-columns: 1fr;
    align-content: start;
    gap: var(--space-7);
  }

  .hero__text,
  .hero__media {
    grid-column: 1;
    grid-row: auto;
  }

  .hero__title {
    font-size: clamp(3.5rem, 17vw, 7.5rem);
  }

  .hero__media {
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: 70dvh;
  }

  .hero__media::after {
    background: linear-gradient(0deg, color-mix(in srgb, var(--color-bg) 60%, transparent) 0%, transparent 30%),
                radial-gradient(ellipse 80% 75% at 50% 42%, transparent 50%, color-mix(in srgb, var(--color-bg) var(--photo-vignette), transparent) 100%);
  }
}

@media (max-width: 479px) {
  .hero__actions .btn {
    flex: 1 1 100%;
  }
}
