/* Zhiyi Foo — Portfolio. Values verified against the live Framer site's real CSS
   custom properties and cross-checked with rendered screenshots.
   Fonts self-hosted from the exact files Framer/Google Fonts serve, so weights
   and the "Source Serif Pro" alias (not available by name on the Google Fonts
   API) render identically rather than relying on a substitute. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url("/assets/fonts/inter-300.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/inter-italic-300.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200;
  font-display: block;
  src: url("/assets/fonts/source-serif-4-200.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-300.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif Pro";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/source-serif-pro-300.woff2") format("woff2");
}
@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/fragment-mono-400.woff2") format("woff2");
}

:root {
  --color-ink: #0b0b0b;
  --color-paper: #f7f7f7;
  --color-surface: #ebebeb;
  --color-border: #cccccc;
  --color-muted: #696969;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-serif-pro: "Source Serif Pro", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --max-width: 1200px;
  --pad: clamp(24px, 6vw, 56px);
  --pad-r: clamp(24px, 6vw, 56px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-ink: #ffffff;
    --color-paper: #0b0b0b;
    --color-surface: #121212;
    --color-border: #272727;
    --color-muted: #a8a8a8;
  }
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap, header.site-header, main, footer.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad-r);
}

/* Two-column pattern reused across hero divider row, section headings + lists,
   and the About photo + bio row. */
.split {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 80px;
  align-items: start;
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 20px; }
}

/* Header / nav — no logo/brand on the live site, just right-aligned nav.
   Below 860px the reference site centers the nav and shrinks it. */
header.site-header {
  display: flex;
  justify-content: flex-end;
  padding-top: 56px;
  padding-bottom: 0;
}

nav.site-nav {
  display: flex;
  gap: 16px 28px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

nav.site-nav a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 300;
  color: var(--color-muted);
}

nav.site-nav a[aria-current="page"] { color: var(--color-ink); }
nav.site-nav a:hover { color: var(--color-ink); }

@media (max-width: 859px) {
  header.site-header { justify-content: center; padding-top: 35px; }
  nav.site-nav { justify-content: center; }
  nav.site-nav a { font-size: 14px; }
}

/* Main content */
main { padding-top: 60px; padding-bottom: 0; }

.hero-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 32px;
}

.about-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 300 / 330;
  object-fit: cover;
  border-radius: 0;
}

h1.name {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(58px, calc(19.11px + 5.063vw), 90px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--color-ink);
}

.role-title {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 200;
  font-size: clamp(67px, calc(22.04px + 5.854vw), 104px);
  line-height: 0.95;
  letter-spacing: -0.08em;
  color: var(--color-muted);
  margin-top: 4px;
  max-width: 740px;
}

/* About page photo + bio split: reference switches to a fixed 300px photo
   column much earlier than the generic .split breakpoint, so this gets its
   own scoped column widths/gap/breakpoint rather than touching .split. */
.split.about-split {
  grid-template-columns: 300px 1fr;
  gap: 56px;
}

@media (max-width: 430px) {
  .split.about-split { grid-template-columns: 1fr; gap: 20px; }
}

.role-title em, .role-title i { font-style: italic; }

@media (max-width: 640px) {
  .role-title .role-title-break { display: block; }
}

.hero-row { margin-top: 110px; }

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 12px 0 0;
}

.lede {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-muted);
}

/* About page bio copy: reference scales this text (12px -> 18px across
   breakpoints) independently of the generic .lede used elsewhere on the
   site, so it gets its own scoped sizing rather than changing .lede globally. */
.about-lede {
  font-size: clamp(12px, calc(3.76px + 1.017vw), 18px);
  line-height: 1.2;
  margin-bottom: 1.2em;
}

.split .lede { max-width: 60ch; }

.plus-row {
  display: flex;
  justify-content: space-between;
  margin: 60px 0 36px;
  color: var(--color-muted);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
}

section { margin: 60px 0; }

h1.section-title, .split > h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(32px, 4.4vw, 60px);
  color: var(--color-ink);
  line-height: 0.97;
  letter-spacing: -0.035em;
}

/* Experience list */
.experience-item {
  padding: 20px 0;
}

.experience-item:first-child {
  padding-top: 0;
}

.experience-item .company {
  display: block;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--color-ink);
}

.experience-item .dates {
  display: block;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-muted);
  margin-top: 4px;
}

.experience-item .title {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  margin-top: 22px;
  padding-left: 32px;
}

.experience-item .desc {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-muted);
  margin-top: 8px;
  max-width: 60ch;
  padding-left: 32px;
}

/* Resume button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-ink);
  color: var(--color-paper);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  margin-top: 28px;
}

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px 0;
}

@media (max-width: 1199px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 809px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card { display: block; text-decoration: none; color: inherit; padding: 0 20px; box-sizing: border-box; }
.home-project-grid .project-card { padding: 0; }

.project-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 20px;
}

.project-card .project-card-title {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -0.84px;
  line-height: 1.2;
  color: var(--color-ink);
  text-align: center;
  width: calc(100% - 40px);
  margin: 0 auto;
}

@media (max-width: 1199px) {
  .project-card .project-card-title { font-size: 19px; }
}
@media (max-width: 809px) {
  .project-card .project-card-title { font-size: 15px; }
}

.project-card .project-card-year {
  font-size: 16px;
  font-weight: 300;
  line-height: 0.95;
  color: #555555;
  margin-top: 12px;
  text-align: center;
  width: calc(100% - 40px);
  margin-left: auto;
  margin-right: auto;
}

.home-project-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 40px; }
.home-project-grid .project-card img { aspect-ratio: 1.582; border-radius: 0; margin-bottom: 0; }

.resume-download { text-align: center; margin-top: 56px; }
.resume-download .btn { margin-top: 0; }

.social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 95px;
  margin-top: 86px;
}

.social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  color: var(--color-ink);
}

.social-row svg { width: 100%; height: 100%; fill: currentColor; }

@media (min-width: 859px) {
  .social-row { gap: 238px; }
  .social-row a { width: 50px; height: 50px; }
}

/* Connect form */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form .field-message { grid-column: 1 / -1; }
.contact-form .field-submit { grid-column: 1 / -1; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--color-surface);
  border: none;
  border-radius: 8px;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px;
}

.contact-form textarea { min-height: 130px; resize: vertical; }

.contact-form ::placeholder { color: var(--color-muted); opacity: 1; }

.contact-form button {
  width: 100%;
  background: var(--color-border);
  color: var(--color-ink);
  border: none;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.contact-form button:hover { filter: brightness(1.15); }

/* Blog post */
.post-back {
  display: inline-block;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 50px;
  line-height: 1;
  margin-bottom: 56px;
}
.post-back:hover { color: var(--color-ink); }

.post-header { text-align: center; max-width: 760px; margin: 0 auto 48px; }

.post-header h1 {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(40px, 9vw, 90px);
  line-height: 1.1;
  color: var(--color-ink);
}

.post-meta { margin-top: 20px; }

.post-meta .post-tag-primary {
  display: block;
  font-family: var(--font-serif-pro);
  font-style: normal;
  font-weight: 300;
  font-size: 22px;
  color: var(--color-muted);
}

.post-meta .post-tag-year {
  display: block;
  font-size: 16px;
  color: var(--color-muted);
  margin-top: 4px;
}

.post-hero {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 32px;
  aspect-ratio: 16/10;
  object-fit: cover;
}

article.post-body {
  max-width: 680px;
  margin: 0 auto;
}

article.post-body p {
  margin-bottom: 18px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 300;
  color: var(--color-ink);
}

article.post-body h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 35px;
  margin-top: 44px;
  margin-bottom: 16px;
  color: var(--color-ink);
}

article.post-body h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 25px;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-ink);
}

.post-inline-img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 24px 0;
  padding: 28px;
  background: #ffffff;
}

.post-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  border-radius: 6px;
  overflow: hidden;
}

.post-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.img-caption {
  margin: -16px 0 24px;
  padding-left: 14px;
  border-left: 2px solid var(--color-border);
  font-style: italic;
  font-size: 15px;
  font-weight: 300;
  color: var(--color-muted);
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.related-list li {
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
}

.related-list li:last-child { border-bottom: 1px solid var(--color-border); }

.related-list a {
  display: flex;
  align-items: center;
  gap: 24px;
  text-decoration: none;
  color: inherit;
}

.related-list a img {
  width: 209px;
  max-width: 35%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
}

.related-list .related-body {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex: 1;
}

.related-list .related-title {
  font-weight: 500;
  font-size: 18px;
}

.related-list .related-date {
  font-size: 16px;
  color: var(--color-muted);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .related-list a { gap: 16px; }
  .related-list a img { width: 96px; }
  .related-list .related-body { flex-direction: column; gap: 4px; }
}

/* Footer */
footer.site-footer {
  padding-top: 40px;
  padding-bottom: 56px;
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 60px;
}

footer.site-footer a { text-decoration: none; color: var(--color-muted); overflow-wrap: anywhere; }
footer.site-footer strong { color: var(--color-ink); font-weight: 700; }

footer.site-footer .social-links { display: flex; gap: 20px; }
footer.site-footer .location { flex-shrink: 0; }

.location { font-size: 14px; }

/* 404 */
.not-found { text-align: center; padding: 140px 24px; }
.not-found h1 { font-family: var(--font-serif); font-weight: 300; font-size: 48px; margin-bottom: 16px; }
