/* ============================================================
   Zhanghu Zhao — personal homepage
   Semantic, single-column responsive layout (no table hacks).
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --link: #1565c0;        /* AA-safe blue (~5.4:1 on white) */
  --link-hover: #b35400;  /* AA-safe burnt orange (~4.6:1) */
  --accent: #2c7a59;      /* 墨绿色, darkened to pass AA (~4.7:1) */

  --ink: #1f2328;
  --ink-strong: #111;
  --muted: #6a6a6a;
  --rule: #ececec;
  --rule-soft: #f1f1f1;

  --maxw: 760px;
  --gap-section: 44px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

p {
  margin: 0 0 0.9em;
  overflow-wrap: anywhere; /* long links/URLs never overflow the viewport */
}

strong {
  font-weight: 700;
  color: var(--ink-strong); /* weight carries emphasis; no scattered color */
}

/* ---------- Skip link (keyboard / screen-reader) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 6px 0;
  z-index: 10;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Links ---------- */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
  overflow-wrap: anywhere;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Layout container ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

section {
  margin-top: var(--gap-section);
}

/* ---------- Header / intro ---------- */
.intro {
  display: flex;
  align-items: center;
  gap: 32px;
}

.intro-text {
  flex: 1 1 auto;
  min-width: 0;
}

.intro-photo {
  flex: 0 0 auto;
  width: 190px;
  max-width: 38%;
}

.intro-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  display: block;
}

.name {
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 0 0 0.5em;
}

.intro-text p {
  margin: 0 0 0.7em;
}

/* ---------- Contact / social nav ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.links li {
  display: flex;
  align-items: center;
}

.links li:not(:last-child)::after {
  content: "/";
  color: #c8c8c8;
  margin-left: 6px;
}

.links a {
  font-weight: 500;
  padding: 4px 2px;
}

/* ---------- Section headings ---------- */
h2 {
  font-size: clamp(20px, 1rem + 1vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-strong);
  margin: 0 0 0.85em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

/* short green accent underline — the one intentional use of the brand green */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 44px;
  height: 2px;
  background: var(--accent);
}

/* ---------- News ---------- */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list li {
  margin-bottom: 0.6em;
}
.news-date {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
}

/* ---------- Research interests ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  font-size: 14px;
  background: #f4f6f5;
  color: #2c4a3e;
  border: 1px solid #e3eae6;
  padding: 4px 11px;
  border-radius: 999px;
}

/* ---------- Education ---------- */
.education-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.education-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 0;
}

.education-item:not(:last-child) {
  border-bottom: 1px solid var(--rule-soft);
}

.education-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.education-logo img {
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.education-content {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.education-content .degree {
  font-weight: 700;
  color: var(--ink-strong);
}

.education-content .school {
  color: var(--ink);
}

.education-content .meta {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--gap-section);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
}
.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover {
  color: var(--link-hover);
}

/* ============================================================
   Responsive — phones
   ============================================================ */
@media (max-width: 600px) {
  .wrap {
    padding: 28px 18px 48px;
  }

  .intro {
    flex-direction: column-reverse; /* photo on top, text below */
    align-items: center;
    text-align: center;
    gap: 18px;
  }

  .intro-photo {
    width: 180px;
    max-width: 55%;
  }

  .links {
    justify-content: center;
  }

  /* roomier tap targets on the primary contact row */
  .links a {
    padding: 8px 4px;
  }

  .education-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  body {
    font-size: 15.5px;
  }
}
