@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../assets/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Reddit Sans";
  src: url("../assets/fonts/reddit-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  /* Black at 95% over white, flattened so sticky/contact surfaces match the page. */
  --background: #0d0d0d;
  --foreground: rgba(255, 255, 255, .88);
  --contact-hover-background: #fff;
  --muted: #ababab;
  /* Project introduction paragraphs use the same mid-gray as the muted metadata. */
  --project-copy: #ababab;
  --rule: #383838;
  --font-body: "Schibsted Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-label: "Reddit Sans", "PingFang SC", sans-serif;
  --link-easing: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  /* Keep the document as the only scroller: no wheel handlers or nested panels. */
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-body); font-size: 15px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
h1, h2, h3, h4, p { margin: 0; }
.page { width: 100%; max-width: 1500px; margin: 0 auto; padding: 20px 30px 10px; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; transform: translateY(-150%); padding: 8px 16px; background: #fff; color: #000; }
.skip-link:focus { transform: none; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 24px; }
.identity { min-width: 0; }
.identity h1, .identity p, .portfolio-link { font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.3; letter-spacing: -.02em; }
.identity h1, .portfolio-link { font-size: 24px; }
.identity h1, .portfolio-link { font-weight: 600; }
.identity p { color: var(--muted); font-weight: 400; font-size: 20px; }
.identity-image { display: block; width: 213px; max-width: 100%; height: auto; aspect-ratio: 213 / 120; margin-top: 16px; object-fit: cover; border-radius: 12px; }
.portfolio-link { display: block; transition: opacity .3s var(--link-easing); }
.text-link { transition: opacity .5s var(--link-easing); }
.portfolio-link:focus-visible, .text-link:focus-visible { opacity: .55; }
.home-layout { display: grid; grid-template-columns: min(368px, calc((100% - 20px) / 2)) minmax(0, 1fr); align-items: start; gap: 20px; }
.contact-column, .cv-column { min-width: 0; }
.contact-column {
  /* align-self:start is essential: a stretched grid item cannot stick. */
  position: sticky;
  top: 0;
  align-self: start;
  padding-right: 10px;
  background: var(--background);
}
.bio { border-top: 1px solid var(--rule); min-height: 202px; padding: 30px 34px 70px 6px; }
.bio p { line-height: 1.35; overflow-wrap: anywhere; }
.contact-bar a {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  padding: 12px 6px;
  border-top: .5px solid var(--rule);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
.contact-bar a:focus-visible, .contact-bar a:active { background: var(--contact-hover-background); color: var(--background); }
.contact-bar a:focus-visible { outline-offset: -2px; }
.contact-bar span:first-child { min-width: 0; overflow-wrap: anywhere; }
.arrow { font-family: var(--font-label); font-size: 10px; line-height: 1.3; white-space: pre; flex-shrink: 0; }
.cv-column { padding-left: 20px; }
.section { border-top: 1px solid var(--rule); padding: 30px 0 80px; }
.section h2 { margin-bottom: 37px; font-family: var(--font-label); font-size: 12px; font-weight: 700; line-height: 1.3; }
.experience-list { display: flex; flex-direction: column; gap: 50px; padding-right: 20px; }
.experience-item { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 30px; border-top: .5px solid var(--rule); padding-top: 20px; }
.experience-meta h3, .education-item h3, .skill-group h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.experience-meta h3 { margin-bottom: 12px; }
.experience-meta p { color: var(--muted); line-height: 1.4; font-size: 16px; }
.experience-body { min-width: 0; overflow-wrap: anywhere; }
.experience-body p + p { margin-top: 12px; }
.experience-body h4 { font-size: 15px; font-weight: 600; margin-top: 18px; line-height: 1.65; }
.experience-body h4 + p { margin-top: 3px; }
.experience-body .project-title { position: relative; padding-inline-start: 18px; }
.project-bullet { position: absolute; inset-inline-start: 0; top: 0; }
.experience-body .project-description { padding-inline-start: 18px; color: var(--project-copy); }
.experience-body ul { margin: 8px 0 0; padding-left: 18px; }
.experience-body li { padding-left: 1px; }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 50px 37px; }
/* Match the reference's two-up composition: two groups on the left, one on the right. */
.skill-group:first-child { grid-column: 1; grid-row: 1; }
.skill-group:nth-child(2) { grid-column: 1; grid-row: 2; }
.skill-group:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.skill-group h3 { margin-bottom: 20px; color: var(--muted); font-weight: 400; font-size: 15px; }
.skill-group ul { list-style: none; margin: 0; padding: 0; }
.skill-group li { overflow-wrap: anywhere; }
.education-item { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 30px; padding: 0 20px 0 0; }
.education-item + .education-item { margin-top: 30px; }
.education-item p { line-height: 1.4; }
.interests ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0 20px 0 0; gap: 20px; }
.interests li { font-size: 22px; line-height: 1.5; }
.contact-footer { border-top: .5px solid var(--rule); min-height: 400px; padding: 20px 0; display: flex; align-items: flex-end; }
.contact-footer a { font-size: 24px; font-weight: 600; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) {
  .portfolio-link:hover { opacity: .55; }
  .text-link:hover { opacity: .6; }
  .contact-bar a:hover { background: var(--contact-hover-background); color: var(--background); }
}
@media (min-width: 800px) and (max-width: 1279px) {
  .identity h1, .portfolio-link { font-size: 22px; }
  .contact-column { max-width: 368px; }
  .bio { min-height: 190px; padding-left: 0; padding-right: 40px; }
  .experience-item, .education-item { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .skills-grid { grid-template-columns: minmax(0, 1fr); gap: 50px; }
  .skill-group:first-child, .skill-group:nth-child(2), .skill-group:nth-child(3) { grid-column: auto; grid-row: auto; }
}
@media (max-width: 799px) {
  .page { padding: 20px 20px 10px; }
  .hero { gap: 20px; }
  .identity h1, .portfolio-link { font-size: 20px; }
  .identity p { overflow-wrap: break-word; }
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-inline: 12px; }
  .contact-column { position: static; padding: 0; }
  .cv-column { padding: 0; }
  .bio { min-height: 190px; padding: 30px 40px 70px 0; }
  .section { padding-top: 20px; }
  .section h2 { margin-bottom: 30px; }
  .experience-list { padding: 0; gap: 50px; }
  .experience-item, .education-item { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .skills-grid { grid-template-columns: minmax(0, 1fr); gap: 50px; }
  .skill-group:first-child, .skill-group:nth-child(2), .skill-group:nth-child(3) { grid-column: auto; grid-row: auto; }
  .education-item, .interests ul { padding-right: 0; }
  .contact-footer a { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-link, .text-link { transition: none; }
}
@media print {
  :root { color-scheme: light; --background: #fff; --foreground: #000; --contact-hover-background: #000; --muted: #555; --rule: #ccc; --project-copy: rgba(0, 0, 0, .85); }
  .page { padding: 0; max-width: none; }
  .hero { padding-bottom: 30px; }
  .home-layout { display: block; padding: 0; }
  .contact-column { position: static; max-width: none; margin-bottom: 30px; }
  .bio { min-height: 0; padding: 0 0 15px; }
  .cv-column { padding-left: 0; }
  .section { padding-bottom: 30px; }
  .skip-link, .arrow { display: none; }
  .contact-footer { min-height: 0; padding-top: 20px; }
  h2, h3, h4 { break-after: avoid; }
  .experience-meta, .education-item, .skill-group { break-inside: avoid; }
}
