/* Zhanqi (Kei) Li — portfolio homepage
   Restrained, resume-like presentation: white background, high legibility,
   evidence-first structure. No oversized type, decorative cards, or strong
   color blocks. */

:root {
  --bg: #ffffff;
  --ink: #1a1d21;
  --ink-soft: #4b5560;
  --ink-faint: #6b7683;
  --line: #e4e7eb;
  --line-strong: #d3d8de;
  --accent: #2456c9;
  --accent-ink: #1c46a6;
  /* Persona tag: a restrained purple, kept distinct from the blue link accent. */
  --persona-ink: #4c2fae;
  --persona-bg: #f1ecfd;
  --persona-line: #c9b8f5;
  --surface-soft: #f7f8f9;
  --radius: 8px;
  --page: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

a:focus-visible,
.skip-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  z-index: 10;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.wordmark:hover {
  text-decoration: none;
  color: var(--ink);
}

.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

.site-header nav a {
  color: var(--ink-soft);
}

.site-header nav a:hover {
  color: var(--accent-ink);
}

/* ---------- Layout ---------- */

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type {
  border-bottom: 0;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- Profile ---------- */

.profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.profile-main {
  max-width: 640px;
}

h1 {
  font-size: 46px;
  line-height: 1.08;
  font-weight: 650;
}

.role-line {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-soft);
}

.positioning {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink);
  max-width: 60ch;
}

.positioning .hl {
  font-weight: 600;
  color: var(--ink);
  background: rgba(36, 86, 201, 0.1);
  border-radius: 3px;
  padding: 0 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* In-prose case links (PayPal, Tencent, xiaozao.app). Underlined so they read as
   links in body text without relying on color alone; they inherit the highlight's
   weight inside .hl. */
.positioning a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.positioning a:hover {
  color: var(--accent-ink);
}

.profile-facts {
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 24px;
  row-gap: 10px;
}

.profile-facts > div {
  display: contents;
}

.profile-facts dt {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding-top: 1px;
}

.profile-facts dd {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.profile-links {
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 15px;
  font-weight: 500;
}

.portrait {
  margin: 0;
  flex-shrink: 0;
}

/* Job-search availability signal. Site copy only — never a Registry field. */
.availability {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a9d5a;
  box-shadow: 0 0 0 3px rgba(26, 157, 90, 0.16);
  flex-shrink: 0;
}

.portrait img {
  width: 232px;
  height: 232px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  display: block;
}

/* ---------- Work ---------- */

.work h2 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.project-list {
  margin: 26px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
  gap: 48px;
  padding: 28px 32px 28px 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

/* The whole card is clickable via a stretched link on the title anchor. */
.project-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.project-link {
  color: var(--ink);
  text-decoration: none;
}

.project-card:hover .project-link {
  color: var(--accent-ink);
}

.project-link:focus-visible {
  outline: none;
}

.project-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Shared visual column: identical width and height for every case card. */
.project-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 280px;
}

.project-media .phone {
  position: absolute;
  width: 120px;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 30, 55, 0.12);
}

/* Modifier for the wide social-graph image only; layout is unchanged. */
.project-media-wide {
  /* inherits the shared .project-media dimensions */
}

.project-media-wide img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(20, 30, 55, 0.1);
}

.phone-back {
  top: 15px;
  left: 40px;
  transform: rotate(-5deg);
  z-index: 1;
}

.phone-front {
  top: 8px;
  right: 40px;
  transform: rotate(4deg);
  z-index: 2;
}

.project-body {
  min-width: 0;
}

/* Card header row: organization on the left, role tag pushed to the top-right. */
.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.project-org {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding-top: 4px;
}

/* The role/persona tag — deliberately the most prominent label on the card. */
.role-tag {
  /* margin-left:auto keeps the tag flush right on every card; personaTag is
     capped at 3 words by the Registry validator, so nowrap is always safe. */
  margin: 0 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: var(--persona-ink);
  background: var(--persona-bg);
  border: 1px solid var(--persona-line);
  border-radius: 999px;
  padding: 5px 13px;
  box-shadow: 0 1px 2px rgba(88, 56, 190, 0.16), 0 0 0 3px rgba(88, 56, 190, 0.07);
}

.project-body h3 {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 600;
}

/* Small muted project-status pill after the title. Deliberately quieter than
   the persona .role-tag: no accent colour, thin border, faint surface. It stays
   static (no lifted z-index) so the transparent stretched-link overlay remains
   on top and a click on the badge still navigates to the case. */
.status-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.project-meta-line {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.project-summary {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--ink);
  max-width: 64ch;
}

.project-tags {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags li {
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
}

.project-cta {
  margin: 18px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.project-card:hover .project-cta {
  color: var(--accent-ink);
}

.project-cta span {
  display: inline-block;
  transition: transform 0.15s ease;
}

.project-card:hover .project-cta span {
  transform: translateX(3px);
}

/* ---------- Footer ---------- */

footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 30px 24px 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

.footer-quote {
  font-style: italic;
  color: var(--ink-soft);
  text-align: right;
  max-width: 44ch;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .profile {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .role-line,
  .positioning {
    font-size: 16px;
  }

  .portrait img {
    width: 140px;
    height: 140px;
  }

  .profile-facts {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .profile-facts > div {
    display: block;
    margin-bottom: 12px;
  }

  .profile-facts dt {
    margin-bottom: 3px;
  }

  section {
    padding: 40px 0;
  }

  .project-card {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
    padding: 20px;
  }

  .project-media {
    width: 100%;
    height: 280px;
  }

  .project-media .phone {
    width: 120px;
  }

  .phone-back {
    top: 15px;
    left: 40px;
  }

  .phone-front {
    top: 8px;
    right: 40px;
  }

  /* The wide image now adapts inside the same 280px container with object-fit: contain. */
  .project-media-wide img {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .footer-quote {
    text-align: left;
    max-width: none;
  }
}
