/* =========================================================
   home.css: only the Home page.
   Layout: "I design for" | product image | changing word
   ========================================================= */

.home {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 96px var(--gutter) 150px; /* room for header + dock */
}

/* Three columns. Left and right are equal, so the image stays dead centre
   no matter how long the word is. */
.hero {
  width: 100%;
  max-width: 1440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); /* minmax(0,…) = long words can't push the columns */
  grid-template-rows: 1fr auto 1fr;
  grid-template-areas:
    "hello   product .   "
    "lead    product word"
    "sub     product meta";
  column-gap: clamp(0px, 0.8vw, 14px); /* product images have see-through padding, so keep this small */
}

.hero__hello   { grid-area: hello;   justify-self: end; align-self: end; margin: 0 0 0.6em; width: var(--lead-w, auto); }
.hero__lead    { grid-area: lead;    justify-self: end; align-self: baseline; }
.hero__product { grid-area: product; align-self: center; }
.hero__word-wrap { grid-area: word;  justify-self: start; align-self: baseline; }
.hero__sub     { grid-area: sub;     justify-self: end; align-self: start; margin: 1.2em 0 0; width: var(--lead-w, auto); }
.hero__sub > span { display: block; }
@media (min-width: 761px) { .hero__sub > span:first-child { white-space: nowrap; } }   /* the tagline stays on one line */
.hero__school  { margin-top: 0.5em; text-transform: none; letter-spacing: 0.02em; opacity: 0.72; }
.hero__meta    { grid-area: meta;    justify-self: start; align-self: start; margin-top: 1.2em; }

/* "I design for" */
.hero__lead {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(44px, 5.9vw, 96px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

/* The changing word */
.hero__word-wrap {
  margin: 0;
  white-space: nowrap;
  line-height: 1;
}
.hero__word {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(50px, 6.8vw, 112px);
  line-height: 1;
  letter-spacing: -0.01em;
  padding-right: 0.08em; /* stops the italic's last letter being clipped */
}
.hero__word .char { display: inline-block; will-change: transform, opacity; }

/* The product image */
.hero__product {
  width: clamp(240px, 28vw, 430px);
  aspect-ratio: 1 / 1;
  perspective: 1400px;         /* gives the flip its 3D depth */
}
.hero__link {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 24px;
}
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  filter: drop-shadow(0 26px 22px rgba(30, 26, 21, 0.2));
  transition: scale 0.4s var(--ease-bounce);
  cursor: pointer;
}
.hero__link:hover .hero__img { scale: 1.04; }

/* Project name + pause button */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
}
.hero__project {
  text-decoration: none;
  color: var(--ink);
}
.hero__project:hover .hero__project-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero__pause {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.hero__pause:hover { color: var(--ink); }

/* Hidden for a moment so GSAP can animate it in (see the small script in index.html) */
.js .hero { visibility: hidden; }
.js.reveal .hero { visibility: visible; }

/* ---------- Tablets: shrink a little ---------- */
@media (max-width: 1100px) {
  .hero__lead { font-size: clamp(40px, 5.4vw, 64px); }
  .hero__word { font-size: clamp(44px, 6vw, 72px); }
}

/* ---------- Phones: stack it all in one column ---------- */
@media (max-width: 760px) {
  .home { padding: 84px var(--gutter) 130px; align-items: start; }
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "hello"
      "lead"
      "word"
      "product"
      "meta"
      "sub";
    justify-items: center;
    text-align: center;
  }
  .hero > *:not(.sr-only) { justify-self: center !important; width: auto !important; }
  .hero__hello { margin: 0 0 0.5em; }
  .hero__lead { font-size: clamp(40px, 11.5vw, 56px); }
  .hero__word-wrap { margin-top: 0.08em; }
  .hero__word { font-size: clamp(46px, 13vw, 64px); }
  .hero__product { width: min(78vw, 340px); margin-top: 8px; }
  .hero__meta { justify-content: center; margin-top: 0.6em; }
  .hero__sub { margin-top: 0.8em; }
}

/* Very short laptop screens */
@media (min-width: 761px) and (max-height: 640px) {
  .hero__product { width: clamp(200px, 48vh, 360px); }
}
