/* ============================================================
   About — the first section (hero): name, rotating role, summary,
   stats, socials and the portrait.
   Self-contained except for the site's tokens (--accent, --gradient,
   --text, --muted, --border, --nav-h, --section-x…) from css/styles.css,
   which it reuses so both themes come for free.
   Markup: <section id="about" class="hero"> in index.html.
   ============================================================ */

:root,
[data-theme="dark"] {
  --hero-grid: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
  --hero-grid: rgba(15, 23, 42, 0.06);
}

#about {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) var(--section-x) 4rem;
  /* keeps the blurred aurora inside the section */
  overflow: hidden;
  isolation: isolate;
}

/* ---------- background layers ---------- */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-aurora {
  position: absolute;
  inset: -20% -10%;
  opacity: var(--glow-opacity);
  background:
    radial-gradient(40% 45% at 18% 30%, rgba(0, 120, 255, 0.45), transparent 70%),
    radial-gradient(35% 40% at 82% 25%, rgba(124, 92, 255, 0.4), transparent 70%),
    radial-gradient(40% 45% at 60% 85%, rgba(0, 198, 255, 0.3), transparent 70%);
  filter: blur(40px);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(3%, -2%, 0) scale(1.06);
  }

  100% {
    transform: translate3d(-3%, 2%, 0) scale(1);
  }
}

.hero-gridlines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  /* fade the grid out so it never reaches the edges */
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 75%);
}

/* ---------- layout ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.home-text {
  /* Makes this column the reference box for the cqw unit on the h1 below. */
  container-type: inline-size;
  /* A grid item will not shrink below its min-content width by default, and
     the nowrap h1 makes that the full width of the name. Without this the
     column would push the whole grid wider than a phone screen. */
  min-width: 0;
}

/* ---------- eyebrow, name, role ---------- */
.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.eyebrow-line {
  width: 46px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}

.home-text h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  /* Keep the name on one line. "Punit Kumar Sharma" is 10.51em wide in
     Sora 800, so it fits the column at 100/10.51 = 9.5cqw; 9.4 leaves a
     little slack. min() means the size only drops below the clamp above
     when the column is too narrow — on a wide screen nothing changes.
     Browsers without cqw support ignore this and keep the line above. */
  font-size: min(clamp(2.6rem, 7vw, 4.4rem), 9.4cqw);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

/* the gradient slowly sweeps across the name */
.gradient-text {
  background: linear-gradient(110deg, var(--text) 0%, var(--text) 30%, var(--accent) 55%,
      var(--accent-3) 70%, var(--accent-2) 85%, var(--text) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: name-sheen 9s ease-in-out infinite alternate;
}

@keyframes name-sheen {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

/* "I build <rotating phrase>" — about.js types the phrases */
.home-role {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
  min-height: 1.4em;
}

.role-rotator {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.role-rotator::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: var(--accent-2);
  animation: caret-blink 1s steps(2) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.hero-lede {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-lede strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- buttons ---------- */
.home-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.4rem;
}

/* ---------- stats + socials ---------- */
.hero-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  max-width: 40rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stats li > span {
  font-size: 0.8rem;
  color: var(--muted);
}

.home-socials {
  display: flex;
  gap: 10px;
}

.home-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.home-socials a:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  transform: translateY(-3px);
}

/* ---------- portrait: gradient ring, glow, orbs, badge ---------- */
.home-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.about-frame {
  position: relative;
  width: min(100%, 420px);
  margin-inline: auto;
}

.about-frame::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 120, 255, 0.4), transparent 70%);
  filter: blur(42px);
}

.about-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto; /* beat the height="" attribute hint so aspect-ratio applies */
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 24px 70px rgba(0, 120, 255, 0.32);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.about-frame:hover img {
  transform: scale(1.02);
  box-shadow: 0 28px 80px rgba(0, 120, 255, 0.42);
}

.about-badge {
  position: absolute;
  z-index: 2;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-accent);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}

.about-badge i {
  color: var(--accent);
  font-size: 18px;
}

/* floating gradient balls in the space around the portrait */
.about-frame .orb {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 18px rgba(0, 150, 255, 0.65);
  animation: orb-float 4.5s ease-in-out infinite;
}

.orb-1 {
  width: 18px;
  height: 18px;
  top: 4%;
  left: 0;
}

.orb-2 {
  width: 11px;
  height: 11px;
  top: 16%;
  right: -3%;
  background: linear-gradient(120deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.65);
  animation-delay: 0.9s;
  animation-duration: 5.5s;
}

.orb-3 {
  width: 8px;
  height: 8px;
  bottom: 20%;
  left: -5%;
  animation-delay: 1.6s;
  animation-duration: 4s;
}

.orb-4 {
  width: 14px;
  height: 14px;
  bottom: 6%;
  right: 2%;
  background: linear-gradient(120deg, var(--accent-2), var(--accent-3));
  box-shadow: 0 0 16px rgba(0, 198, 255, 0.65);
  animation-delay: 2.3s;
  animation-duration: 6s;
}

@keyframes orb-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

/* ---------- scroll hint ---------- */
.scroll-down {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity 0.4s var(--ease);
}

/* fades away once the visitor starts scrolling (js/main.js) */
.scroll-down.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-down i {
  font-size: 22px;
  animation: float-y 1.8s ease-in-out infinite;
}

@keyframes float-y {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  /* text first on phones: the name is the headline, the portrait follows */
  .home-visual {
    padding: 2rem 0;
  }

  .home-eyebrow,
  .home-cta,
  .hero-foot {
    justify-content: center;
  }

  .hero-lede,
  .hero-foot {
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .hero-stats {
    gap: 1.25rem;
  }

  .hero-stats strong {
    font-size: 1.35rem;
  }

  .about-frame {
    width: min(100%, 300px);
  }

  .scroll-down {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .hero-aurora,
  .gradient-text,
  .role-rotator::after,
  .about-frame .orb,
  .scroll-down i {
    animation: none !important;
  }
}
