@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,400;6..96,500;6..96,600&family=IBM+Plex+Mono:wght@400;500&family=Sora:wght@400;500;600&display=swap');

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
  overflow-wrap: break-word;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  text-decoration: underline;
  text-decoration-color: var(--color-line);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

a:not([class]):hover {
  text-decoration-color: var(--color-accent);
  color: var(--color-accent);
}

::selection {
  background-color: color-mix(in srgb, var(--color-accent) 20%, transparent);
  color: var(--color-text);
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: var(--page-gutter);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: var(--color-paper);
  font-size: var(--text-small);
  border-radius: var(--radius-small);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

.container {
  width: min(100% - 2 * var(--page-gutter), var(--container-site));
  margin-inline: auto;
}

.container-feature {
  width: min(100% - 2 * var(--page-gutter), var(--container-feature));
  margin-inline: auto;
}

.container-article {
  width: min(100% - 2 * var(--page-gutter), var(--container-article));
  margin-inline: auto;
}

.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-mono {
  font-family: var(--font-mono);
}

.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.text-h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.text-h2 {
  font-family: var(--font-body);
  font-size: var(--text-h2);
  line-height: 1.15;
  font-weight: 500;
}

.text-h3 {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  line-height: 1.25;
  font-weight: 500;
}

.text-lead {
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.text-body {
  font-size: var(--text-body);
  line-height: 1.65;
}

.text-small {
  font-size: var(--text-small);
  line-height: 1.55;
}

.text-meta {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline__result-count {
  text-transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-placeholder {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.section-padding {
  padding-block: clamp(56px, 8vw, 96px);
}

.section-padding-large {
  padding-block: clamp(64px, 10vw, 128px);
}

:lang(zh) .text-meta,
:lang(zh) .filter-chip,
:lang(zh) .site-nav__link,
:lang(zh) body {
  line-height: 1.75;
}

:lang(zh) .text-display,
:lang(zh) .text-h1,
:lang(zh) .text-h2,
:lang(zh) .text-h3 {
  line-height: 1.15;
  letter-spacing: 0.02em;
}

:lang(zh) .text-lead,
:lang(zh) .text-body {
  line-height: 1.8;
}

:lang(zh) .text-meta,
:lang(zh) .filter-chip,
:lang(zh) .site-nav__link,
:lang(zh) .section-label,
:lang(zh) .status-tag,
:lang(zh) .timeline__entry-meta,
:lang(zh) .cfd-card__param-label,
:lang(zh) .cfd-card__date,
:lang(zh) .art-card__meta,
:lang(zh) .about-contact__label,
:lang(zh) .skill-group__title,
:lang(zh) .experience-item__period,
:lang(zh) .page-footer__link {
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Keep punctuation from hanging at the edge in CJK */
:lang(zh) p,
:lang(zh) .hero__lead,
:lang(zh) .timeline__entry-excerpt,
:lang(zh) .cfd-card__goal,
:lang(zh) .art-card__title {
  text-align: justify;
  word-break: normal;
  overflow-wrap: break-word;
}
