.button--wechat {
  border-color: rgba(var(--rgb-warm-ink), .9);
  background: rgba(var(--rgb-signal-red), .08);
}

.button__glyph {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
}

.locale-toggle {
  color: var(--color-signal-red);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.ripple-cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: block;
  pointer-events: none;
  mix-blend-mode: screen;
}

@media (hover: none), (pointer: coarse) {
  .ripple-cursor-canvas {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 108px;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 12px);
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-content: center;
    gap: 8px 12px;
    min-height: var(--header-height);
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .brand-mark {
    grid-area: brand;
  }

  .site-nav {
    grid-area: nav;
    width: 100%;
  }

  .header-actions {
    grid-area: actions;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --header-height: 106px;
  }

  body:before {
    background-size: 34px 34px, 34px 34px, auto, auto;
  }

  .site-shell:after {
    display: none;
  }

  .site-header {
    gap: 6px 10px;
    padding: 8px var(--gutter) 9px;
    background: var(--color-core-black);
  }

  .brand-mark {
    min-height: 40px;
  }

  .brand-mark__glyph,
  .brand-mark__code {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .site-nav {
    gap: 6px;
    margin-inline: 0;
    padding-bottom: 0;
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }

  .site-nav a {
    min-height: 36px;
    padding: 0 11px;
    border-color: rgba(var(--rgb-warm-ink), .1);
    background: rgba(var(--rgb-warm-ink), .035);
    font-size: 11px;
  }

  .site-nav a:after {
    right: 10px;
    bottom: 4px;
    left: 10px;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-button {
    min-width: 38px;
    min-height: 38px;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 18px);
    padding-bottom: 42px;
  }

  .hero-copy {
    padding-top: 18px;
  }

  .hero-copy h1 {
    gap: 7px;
    font-size: clamp(46px, 16vw, 64px);
  }

  .hero-copy h1 span + span {
    font-size: clamp(24px, 8.6vw, 36px);
  }

  .hero-tagline,
  .lead {
    font-size: 15.5px;
    line-height: 1.72;
  }

  .hero-tagline {
    margin-top: 18px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .hero-actions .button--primary {
    grid-column: 1 / -1;
  }

  .button {
    min-height: 48px;
    padding: 12px 14px;
  }

  .binary-rail {
    opacity: .86;
  }

  .content-section,
  .contact-section {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  #about .section-heading {
    min-height: 360px;
  }

  .about-visual {
    inset: 140px 0 0;
  }

  .metric-grid {
    gap: 10px;
    margin-top: 26px;
  }

  .line-card,
  .timeline-card,
  .project-card,
  .memory-object__body {
    padding: 18px;
  }

  .memory-wall {
    gap: 12px;
    margin-top: 34px;
  }

  .memory-object,
  .memory-object:nth-child(n) {
    grid-template-rows: 112px 1fr;
  }

  .contact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .contact-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .contact-inner h2 {
    line-height: 1.08;
  }

  #contact-title span:last-child {
    font-size: .88em;
    line-height: 1.14;
  }

  .site-atmosphere {
    contain: strict;
    mix-blend-mode: normal;
    opacity: .38;
  }

  .site-atmosphere:before {
    filter: blur(10px);
  }

  .hero-wave {
    opacity: .54;
  }

  .intro-wipe {
    will-change: transform;
    animation-duration: .72s;
  }

  [data-reveal] {
    transform: translate3d(0, 18px, 0);
    transition-duration: .48s;
    will-change: opacity, transform;
  }

  .line-card,
  .timeline-card,
  .project-card,
  .memory-object,
  .metric-card,
  .button,
  .icon-button,
  .site-nav a {
    transition-duration: .16s;
  }
}

@media (max-width: 420px) {
  :root {
    --gutter: 14px;
    --header-height: 102px;
  }

  .site-header {
    padding-top: 7px;
    padding-bottom: 8px;
  }

  .brand-mark__glyph {
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand-mark__code {
    padding-right: 9px;
    padding-left: 9px;
  }

  .icon-button {
    min-width: 36px;
    min-height: 36px;
  }

  .site-nav a {
    min-height: 34px;
    padding: 0 10px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 15.8vw, 60px);
  }

  .section-heading h2,
  .project-copy h2,
  .memory-heading h2,
  .contact-inner h2 {
    font-size: clamp(26px, 8.8vw, 36px);
  }
}

@media (max-width: 360px) {
  .site-nav {
    gap: 4px;
  }

  .site-nav a {
    padding: 0 8px;
  }
}

@media (max-width: 640px) and (hover: none) {
  .line-card:hover,
  .line-card:focus-within,
  .timeline-card:hover,
  .timeline-card:focus-visible,
  .project-card:hover,
  .memory-object:hover,
  .metric-card:hover {
    box-shadow: none;
    transform: none;
  }

  .button:hover:before,
  .button:focus-visible:before {
    transform: translate(-110%);
  }
}
