/* Home and About pages. Builds on styles.css; the home page also uses theme-dark.css. */

/* Hero: one statement. */
.home-hero {
  padding-block: clamp(96px, 13vw, 190px) clamp(72px, 9vw, 130px);
}
.home-hero h1 {
  max-width: 21ch;
  font-family: var(--sans);
  font-size: clamp(40px, 5.6vw, 84px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  animation: rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.home-hero h1 span {
  color: var(--muted);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Work: tall outlined cards. Text sits at the top; the screenshot peeks up
   from the bottom centre and slides up on hover. */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 140px;
  padding: 0;
  list-style: none;
}
.work-card {
  --pad: clamp(28px, 3vw, 44px);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: clamp(480px, 44vw, 640px);
  padding: var(--pad) var(--pad) 0;
  overflow: hidden;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  background: var(--card);
  text-decoration: none;
}
/* Hover outline that draws itself: four 1px lines grow from the corners,
   on top of the card's resting outline. */
a.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  --l: linear-gradient(var(--draw), var(--draw));
  background:
    var(--l) left top / 0 1px no-repeat,
    var(--l) right top / 1px 0 no-repeat,
    var(--l) right bottom / 0 1px no-repeat,
    var(--l) left bottom / 1px 0 no-repeat;
  transition: background-size 0.55s var(--ease-out);
}
a.work-card:is(:hover, :focus-visible)::after {
  background-size:
    100% 1px,
    1px 100%,
    100% 1px,
    1px 100%;
}
.work-card h2 {
  font-family: var(--sans);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.work-card__text p {
  max-width: 38ch;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.work-card__cta {
  display: inline-flex;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink);
}
.work-card__cta span {
  transition: transform 0.4s var(--ease-out);
}
a.work-card:is(:hover, :focus-visible) .work-card__cta span {
  transform: translateX(4px);
}
.work-card--soon .work-card__cta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.work-card__media {
  display: block;
  /* Height follows the screenshot, so its full width always shows; tall
     pages are only trimmed at the bottom. */
  max-height: clamp(280px, 27vw, 400px);
  width: 86%;
  margin: auto auto -16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  /* A glow in the project's own colour (--glow, set per card). */
  box-shadow: 0 -18px 90px -12px
    color-mix(in srgb, var(--glow, transparent) 35%, transparent);
  transition:
    transform 0.6s var(--ease-out),
    box-shadow 0.6s var(--ease-out);
}
.work-card__media img {
  width: 100%;
  height: auto;
  opacity: 0.9;
  transition: opacity 0.4s var(--ease-out);
}
a.work-card:is(:hover, :focus-visible) .work-card__media {
  transform: translateY(-14px);
  box-shadow: 0 -24px 120px -8px
    color-mix(in srgb, var(--glow, transparent) 55%, transparent);
}
/* A composed image (like stacked wireframes): the glow follows the image's
   own shape instead of the frame, so no box shows around it. */
.work-card__media--bare,
a.work-card:is(:hover, :focus-visible) .work-card__media--bare {
  border: 0;
  box-shadow: none;
  /* Let the glow spill out on top and sides; still trim the bottom. */
  overflow: visible;
  clip-path: inset(-120px -120px 0 -120px);
}
.work-card__media--bare img {
  filter: drop-shadow(
    0 -12px 40px color-mix(in srgb, var(--glow, transparent) 45%, transparent)
  );
  transition:
    opacity 0.4s var(--ease-out),
    filter 0.6s var(--ease-out);
}
a.work-card:is(:hover, :focus-visible) .work-card__media--bare img {
  filter: drop-shadow(
    0 -16px 56px color-mix(in srgb, var(--glow, transparent) 70%, transparent)
  );
}
a.work-card:is(:hover, :focus-visible) img {
  opacity: 1;
}

/* ---------- About: statement and photo, then how I work ---------- */
.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding-block: clamp(72px, 9vw, 140px) clamp(72px, 9vw, 120px);
}
.about-hero__text {
  animation: rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.about-hero .eyebrow {
  margin-bottom: 24px;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.about-hero__lede {
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.about-hero__lede span {
  color: var(--muted);
}
.about-hero__body {
  max-width: 56ch;
  margin-top: 32px;
}
.about-hero__body p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--body-text);
}
.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 32px;
}
.about-link {
  display: inline-flex;
  gap: 8px;
  font-size: 15px;
  text-decoration: none;
}
.about-link span {
  transition: transform 0.4s var(--ease-out);
}
.about-link:hover span {
  transform: translate(3px, -3px);
}
/* Photo in a hairline frame with a glow in its own colour. */
.about-photo {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 120px -30px
    color-mix(in srgb, var(--glow) 55%, transparent);
  animation: rise 0.9s 0.15s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.about-photo img {
  width: 100%;
  height: auto;
}

.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .about-hero {
    grid-template-columns: 1fr;
  }
  .about-photo {
    max-width: 440px;
  }
}

@media (max-width: 760px) {
  .work-grid {
    grid-template-columns: 1fr;
    margin-bottom: 88px;
  }
  .work-card {
    min-height: 0;
  }
  .work-card__media {
    max-height: 260px;
    margin-top: 32px;
    width: 90%;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.work-card::after {
    transition: none;
  }
  a.work-card:is(:hover, :focus-visible) .work-card__media,
  a.work-card:is(:hover, :focus-visible) .work-card__cta span {
    transform: none;
  }
}

/* Returning from a case study lands on that project's card, below the header. */
.work-grid > li {
  scroll-margin-top: 24px;
}
