/* Home page — fills the viewport when content fits (the common case), but
   grows and scrolls normally rather than clipping when it doesn't — e.g.
   shorter landscape tablets, where 100dvh isn't tall enough for the hero
   plus all four nav columns. */
html, body { min-height: 100%; }

.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.home .topbar { flex: 0 0 auto; }

/* main wraps the about + prompt + columns and fills the remaining height */
.home #main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- About zone: a centred hero (photo + intro) ---- */
.about {
  flex: 0 0 auto;          /* size to content; columns fill the rest */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4.5vw, 60px);
  padding: clamp(28px, 4vh, 60px) clamp(24px, 6vw, 80px);
  animation: fade-up var(--dur-1) var(--ease-swing) both;
}

.about__photo {
  width: clamp(160px, 20vw, 248px);
  aspect-ratio: 1491 / 1569;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 22px 48px -20px rgba(40, 30, 12, 0.5);
  flex: 0 0 auto;
}

.about__body { max-width: 46ch; }

.about__name {
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

/* "Kang Kang" carries a faded dotted underline hinting at a pronunciation
   tooltip, shown on hover or keyboard focus. */
.pron { position: relative; }
.pron__word {
  border-bottom: 2px dotted var(--accent);
}
.pron__word:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
.pron__tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 5;
  /* reset the huge display heading styles for the small tip */
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: normal;
  line-height: 1.4;
  white-space: nowrap;
  color: #f5eef4;
  background: #2b2130;
  padding: 7px 12px;
  border-radius: var(--radius);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-micro) var(--ease-glide),
              transform var(--dur-micro) var(--ease-glide),
              visibility var(--dur-micro) var(--ease-glide);
  pointer-events: none;
}
.pron:hover .pron__tip,
.pron:focus-within .pron__tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.about__bio {
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: clamp(15px, 1.55vw, 17px);
  max-width: 44ch;
  text-align: justify;  /* wide screens only — the mobile block re-centres it */
}
/* Inline lead-in labels ("My Masters", "Currently"). 600 is the heaviest DM
   Sans weight loaded, so set it explicitly rather than let <strong> ask for a
   synthesized 700. Full-strength text colour lifts them off the body copy. */
.about__bio strong {
  font-weight: 600;
  color: var(--text-primary);
}

.about__links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 18px 0 0;
  font-size: 14px;
  font-weight: 500;
}
.about__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-deep);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color var(--dur-micro) var(--ease-glide);
}
.about__links a:hover { color: var(--text-primary); }

/* ---- Nav prompt ---- */
.nav-prompt {
  flex: 0 0 auto;
  text-align: center;
  margin: 0;
  padding: clamp(12px, 1.8vh, 20px) 0;
  animation: fade-in var(--dur-1) var(--ease-swing) 0.15s both;
}

/* ---- Nav columns ---- */
.columns {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}

.column {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: clamp(20px, 4vh, 48px) 20px;
  border-left: 1px solid var(--border);
  text-align: center;
  overflow: hidden;
  animation: fade-up var(--dur-1) var(--ease-swing) both;
  box-shadow: inset 0 0 0 0 var(--accent-deep);
  transition: box-shadow var(--dur-micro) var(--ease-glide);
}
.column:hover,
.column:focus-within {
  box-shadow: inset 0 0 0 2px var(--accent-deep);
}
.column:first-child { border-left: 0; }
.column:nth-child(1) { animation-delay: 0.18s; }
.column:nth-child(2) { animation-delay: 0.26s; }
.column:nth-child(3) { animation-delay: 0.34s; }
.column:nth-child(4) { animation-delay: 0.42s; }

/* Decorative imagery layer — beautiful even with no photo behind it.
   A soft per-section colour wash + a glow rising from the base. Replaceable
   by a real photo later (drop an <img> in and lower this layer's opacity). */
.column::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(115% 72% at 50% 122%, var(--glow, transparent), transparent 62%),
    linear-gradient(180deg, transparent 44%, var(--wash, transparent));
  opacity: 0.92;
  transition: opacity var(--dur-micro) var(--ease-glide), transform var(--dur-micro) var(--ease-glide);
}
.column:hover::before,
.column:focus-within::before {
  opacity: 1;
  transform: translateY(-6px) scale(1.05);
}

/* per-section hues, defined in tokens.css */
.column--photo    { --glow: var(--glow-photo);    --wash: var(--wash-photo); }
.column--research { --glow: var(--glow-research); --wash: var(--wash-research); }
.column--clinical { --glow: var(--glow-clinical); --wash: var(--wash-clinical); }
.column--cv       { --glow: var(--glow-cv);       --wash: var(--wash-cv); }

/* keep content above the imagery layer */
.column > * { position: relative; z-index: 1; }

.column__icon {
  width: 34px;
  height: 34px;
  stroke: var(--text-primary);
  stroke-width: 1.4;
  fill: none;
  opacity: 0.8;
  transition: transform var(--dur-micro) var(--ease-glide), opacity var(--dur-micro) var(--ease-glide);
}
.column:hover .column__icon,
.column:focus-within .column__icon { transform: translateY(-4px); opacity: 1; }

.column__title {
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1.1;
}

.column__sub {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: max-height var(--dur-micro) var(--ease-glide),
              opacity var(--dur-micro) var(--ease-glide),
              transform var(--dur-micro) var(--ease-glide);
}
.column:hover .column__sub,
.column:focus-within .column__sub {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
}
.column__sub li {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 5px 0;
}

/* ---- Mobile: compact profile hero, columns become stacked rows ---- */
@media (max-width: 768px) {
  .about {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 14px;
    padding: clamp(22px, 6vw, 36px) clamp(22px, 6vw, 36px) clamp(16px, 4vw, 26px);
  }
  /* small, tidy circular portrait. Explicit width+height (not aspect-ratio)
     so it can't fall back to the image's tall height attribute. */
  .about__photo {
    width: 92px;
    height: 92px;
    aspect-ratio: auto;
    border-radius: 50%;
    box-shadow: 0 10px 22px -12px rgba(40, 30, 12, 0.45);
  }
  .about__name { font-size: clamp(27px, 8vw, 36px); }
  .about__body { max-width: 56ch; }
  .about__bio { margin-top: 12px; font-size: 15px; text-align: center; }
  .about__links { justify-content: center; margin-top: 14px; }
  .nav-prompt { padding: 14px 0; }
  .columns { grid-template-columns: 1fr; }
  .column {
    border-left: 0;
    border-top: 1px solid var(--border);
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    text-align: left;
    padding: 16px clamp(22px, 6vw, 36px);
    animation: none;          /* no per-row stagger on the stacked layout */
  }
  .column::before { background: linear-gradient(90deg, var(--wash, transparent), transparent 70%); opacity: 1; }
  .column:hover::before, .column:focus-within::before { transform: none; }
  .column:hover .column__icon, .column:focus-within .column__icon { transform: none; }
  .column__sub { display: none; }
}

/* faint warm paper grain (decorative, non-interactive) */
.home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.home .topbar, .home #main { position: relative; z-index: 1; }
