/* ==========================================================================
   home.css — homepage only (loaded after base.css)
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  min-height: calc(100svh - var(--header-h));
  padding-top: clamp(2rem, 7vh, 4.5rem);
  padding-bottom: clamp(5rem, 12vh, 8rem);
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 108%, #1b0c33 0%, rgb(27 12 51 / 0) 70%),
    var(--bg);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__title {
  max-width: 16ch;
  /* Also capped by viewport height so the whole hero fits above the fold */
  font-size: clamp(2rem, min(1.2rem + 4.6vw, 8.5vh), 4.75rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero__title > span {
  display: block;
}

.hero__title .text-gradient {
  font-weight: 600;
}

.hero__lead {
  max-width: 46ch;
  margin-top: var(--space-3);
}

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

.hero__title,
.hero__lead,
.hero__actions {
  animation: rise 1s var(--ease) both;
}

.hero__lead { animation-delay: 0.15s; }
.hero__actions { animation-delay: 0.3s; }

/* Atmosphere: decorative only */
.hero__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__fog {
  position: absolute;
  /* Extends past the bottom edge so the drift animation never lifts the layer's edge into view
     (that showed as a dark band). Gradient positions below are scaled to keep the same look. */
  inset: -15% -10% -15%;
}

.hero__fog--a {
  background:
    radial-gradient(48% 33.6% at 22% 63.7%, rgb(139 92 246 / 0.2), transparent 70%),
    radial-gradient(40% 26.5% at 62% 76%, rgb(255 63 164 / 0.1), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}

.hero__fog--b {
  background:
    radial-gradient(44% 30% at 82% 54.9%, rgb(96 70 200 / 0.18), transparent 70%),
    radial-gradient(36% 24.8% at 38% 79.6%, rgb(139 92 246 / 0.14), transparent 70%);
  animation: drift 55s ease-in-out infinite alternate-reverse;
}

/* Spinning chords, anchored to the right edge at full hero height */
.hero__motion {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  aspect-ratio: 800 / 1440;
  /* Soften the hard edges where the strip meets the header and the next section */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 74%, transparent 100%);
}

@media (max-width: 63.99rem) {
  .hero__motion {
    opacity: 0.4; /* sits behind the headline on narrower screens */
  }
}

.hero__glow {
  position: absolute;
  left: 50%;
  bottom: -9rem; /* centered below the bottom edge so only the upper part peeks into view */
  width: min(95rem, 150%);
  height: 22rem;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgb(255 63 164 / 0.5) 0%,
    rgb(190 60 200 / 0.2) 35%,
    transparent 70%
  );
  animation: glow-pulse 9s ease-in-out infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.25rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes drift {
  from { transform: translate3d(-3%, 0, 0); }
  to   { transform: translate3d(3%, -2%, 0); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

/* --- Intro --------------------------------------------------------------- */
.split {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: 5fr 6fr;
    gap: var(--space-5);
    align-items: start;
  }
}

.split__body > * + * {
  margin-top: var(--space-3);
}

.split__body > .lead {
  color: var(--text);
}

/* --- Selected work ------------------------------------------------------- */
.work__title {
  margin-bottom: var(--space-5);
}

.work-list {
  display: grid;
  gap: var(--space-6);
  counter-reset: work;
}

.work-item {
  position: relative;
  display: grid;
  gap: var(--space-4);
  align-items: center;
  counter-increment: work;
}

@media (min-width: 60rem) {
  .work-item {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-5);
  }

  .work-item--reverse {
    grid-template-columns: 5fr 7fr;
  }

  .work-item--reverse .work-item__media {
    order: 2;
  }
}

.work-item__media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.work-item__media > * {
  display: block;
  width: 100%;
  transition: transform 0.9s var(--ease);
}

.work-item:hover .work-item__media {
  border-color: rgb(255 63 164 / 0.6);
  box-shadow: 0 0 3.5rem -1rem var(--glow);
}

.work-item__media > img {
  height: auto;
}

.work-item:hover .work-item__media > * {
  transform: scale(1.03);
}

.work-item__title {
  font-size: var(--step-2);
}

.work-item__title::before {
  content: "0" counter(work);
  content: "0" counter(work) / "";
  display: block;
  margin-bottom: 0.9rem;
  color: var(--magenta);
  font: 500 var(--step--1) / 1 var(--font-body);
  letter-spacing: 0.22em;
}

.work-item__summary {
  margin-top: var(--space-2);
  color: var(--text-muted);
}

.work-item__meta {
  margin-top: var(--space-1);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.work-item__meta:first-of-type {
  margin-top: var(--space-3);
}

.work-item__meta--skills {
  color: var(--violet-text);
}

.work-item__meta span[aria-hidden] {
  margin-inline: 0.35em;
  opacity: 0.7;
}

.work-item__link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: var(--space-3);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--magenta);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.work-item:hover .work-item__link {
  color: var(--magenta-bright);
  border-color: var(--magenta-bright);
}

.work-item:hover .arrow {
  transform: translateX(0.25rem);
}

/* Whole card is clickable via the single link inside it */
.work-item__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

@supports selector(:has(a)) {
  .work-item__link:focus-visible {
    outline: none;
  }

  .work-item:has(.work-item__link:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 1rem;
    border-radius: var(--radius);
  }
}

/* --- About teaser -------------------------------------------------------- */
.about-teaser {
  padding-block: 0;
}

.about-teaser__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.5);
  background:
    radial-gradient(70% 120% at 100% 0%, rgb(139 92 246 / 0.2), transparent 65%),
    radial-gradient(60% 100% at 0% 100%, rgb(255 63 164 / 0.1), transparent 70%),
    var(--bg-raised);
}

.about-teaser .button {
  margin-top: var(--space-4);
}

/* --- Closing call to action ---------------------------------------------- */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
}

.cta::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14rem;
  z-index: -1;
  width: min(80rem, 140%);
  height: 28rem;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgb(255 63 164 / 0.32),
    rgb(139 92 246 / 0.12) 45%,
    transparent 70%
  );
}

.cta__inner {
  max-width: 40rem;
  margin-inline: auto;
}

.cta__body {
  margin-top: var(--space-3);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Plain-text address under the buttons, for visitors without a mail app */
.cta__address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--step-0);
  overflow-wrap: anywhere;
}

/* The sketchbook photo is the card's background: the notebook page sits at the
   left and the darker areas fade out behind the text (decorative, so it's CSS). */
.about-teaser__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/img/home/sketchbook.webp") left bottom / auto 125% no-repeat;
  filter: brightness(0.8) saturate(0.85);
  opacity: 0.95;
  -webkit-mask-image:
    linear-gradient(to right, #000 25%, transparent 72%),
    linear-gradient(to top, #000 38%, transparent 82%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, #000 25%, transparent 72%),
    linear-gradient(to top, #000 38%, transparent 82%);
  mask-composite: intersect;
}

/* Violet wash so the photo belongs to the card */
.about-teaser__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgb(139 92 246 / 0.28), transparent 60%);
  pointer-events: none;
}

@media (max-width: 59.99rem) {
  /* Stacked layout: the photo always covers the card (no hard right edge),
     dimmer behind the full-width text, fading toward the top and right */
  .about-teaser__panel::before {
    background-size: cover;
    background-position: 15% 100%;
    opacity: 0.55;
    -webkit-mask-image:
      linear-gradient(to right, #000 40%, transparent 100%),
      linear-gradient(to top, #000 30%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, #000 40%, transparent 100%),
      linear-gradient(to top, #000 30%, transparent 100%);
    mask-composite: intersect;
  }
}

/* Phones: no photo behind the card text */
@media (max-width: 47.99rem) {
  .about-teaser__panel::before {
    display: none;
  }
}
