/* ---------- reference hero (loads last; scoped to .home hero markup only) ---------- */

.home .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-rows: auto auto;
  align-items: start;
  align-content: start;
  column-gap: clamp(40px, 5vw, 88px);
  row-gap: clamp(32px, 4vw, 60px);
  min-height: 850px;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(56px, 5vw, 84px) clamp(20px, 4vw, 64px) clamp(44px, 4vw, 68px);
  background: var(--paper);
}

.home .hero-content {
  min-width: 0;
  padding: 0;
}

/* 關於威廉 is the section's main heading, so it carries the serif title scale. */
.home .hero .eyebrow {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(42px, 4.4vw, 60px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

/* Supporting experience copy: smaller, and its ｜ breaks give the two-line shape. */
.home .hero .headline {
  margin: 0;
  max-width: 12em;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(27px, 2.5vw, 34px);
  font-weight: 500;
  line-height: 1.48;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

.home .hero .intro {
  margin: 22px 0 0;
  max-width: 30em;
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.home .hero .hero-about {
  margin: 16px 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: break-word;
}

/* reset inherited .hero-photo box (min-height, fixed height, absolutely positioned img) */
.home .hero-photo {
  position: static;
  min-height: 0;
  width: min(340px, 100%);
  height: auto;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  /* 999px clamps to half the width, so the top is a full arch at every width */
  border-radius: 999px 999px 0 0;
  background: var(--paper);
  overflow: hidden;
}

.home .hero-photo img,
.home .hero-photo .portrait {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  /* source is landscape 1024x682: bias the crop up toward the face */
  object-position: 50% 26%;
}

.home .hero-credentials {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home .credential-card {
  min-width: 0;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  background: var(--white);
  text-align: center;
}

.home .credential-no {
  display: block;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.home .credential-title {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.home .credential-body {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

@media (max-width: 1024px) {
  .home .hero {
    min-height: 0;
    column-gap: 40px;
    padding-top: 64px;
  }
}

@media (max-width: 768px) {
  .home .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 48px 20px 52px;
  }

  .home .hero-content {
    order: 1;
  }

  .home .hero-photo {
    order: 2;
    width: min(300px, 100%);
  }

  .home .hero-credentials {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .home .hero .intro {
    margin-top: 18px;
    font-size: 17px;
  }
}

@media (max-width: 390px) {
  .home .hero {
    padding: 36px 16px 40px;
  }

  .home .hero .intro {
    font-size: 16px;
  }

  .home .hero .hero-about {
    font-size: 16px;
  }

  /* site.css sets height:300px here; auto + aspect-ratio keeps the 4/5 arch tall */
  .home .hero-photo,
  .home .hero-photo img,
  .home .hero-photo .portrait {
    height: auto;
  }

  /* two columns stay readable at 390: 9-char CJK titles fit at 16px */
  .home .hero-credentials {
    gap: 10px;
  }

  .home .credential-card {
    padding: 16px 14px;
  }

  .home .credential-title {
    font-size: 16px;
  }

  .home .credential-body {
    font-size: 12.5px;
  }
}
