:root {
  --bg: #f7f4ef;
  --ink: #161412;
  --ink-muted: #5c5854;
  --line: #e6e1da;
  --action: #1c6942;
  --action-hover: #185938;
  --action-active: #144c30;
  --on-action: #ffffff;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-avatar: 16px;
  --radius-button: 8px;
  --nav-h: 56px;
  --pad: 20px;
  --section-gap: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
  background: var(--bg);
  scroll-padding-top: calc(var(--nav-h) + env(safe-area-inset-top));
}

@media (min-width: 768px) {
  :root {
    --radius-avatar: 20px;
    --nav-h: 64px;
    --pad: 32px;
    --section-gap: 96px;
  }
}

@media (min-width: 1024px) {
  :root {
    --pad: 48px;
  }
}

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

html {
  background: var(--bg);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
  text-autospace: normal;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: normal;
}

p {
  margin: 0;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

a {
  color: var(--ink);
}

a:visited {
  color: var(--ink);
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

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

.skip:focus {
  position: fixed;
  z-index: 20;
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 16px;
  background: var(--action);
  color: var(--on-action);
  border-radius: var(--radius-button);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
}

.wordmark {
  flex: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.wordmark:visited {
  color: var(--ink);
}

.wordmark:hover {
  color: var(--action);
}

.nav-links {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 180ms ease, box-shadow 180ms ease;
}

.nav-links a:visited {
  color: var(--ink);
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--action);
  box-shadow: inset 0 -2px 0 var(--action);
}

.nav-links a:hover:visited,
.nav-links a[aria-current="true"]:visited {
  color: var(--action);
}

@media (min-width: 768px) {
  .wordmark {
    font-size: 18px;
  }

  .nav-links a {
    padding-inline: 12px;
    font-size: 16px;
  }
}

#main:focus {
  outline: none;
}

.hero {
  padding-top: 48px;
  padding-bottom: 64px;
}

.hero-copy {
  min-width: 0;
  max-width: 580px;
}

.identity {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  overflow-wrap: normal;
  word-break: normal;
}

h1 {
  font-size: 48px;
  line-height: 1.2;
}

.hero-lead {
  margin-top: 24px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 32px;
  padding: 12px 24px;
  border-radius: var(--radius-button);
  background: var(--action);
  color: var(--on-action);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  gap: 8px;
  white-space: nowrap;
  overflow-wrap: normal;
  transition: background-color 200ms ease;
}

.arrow {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}

.button:visited,
.button:hover,
.button:focus {
  color: var(--on-action);
  text-decoration: none;
}

.button:hover {
  background: var(--action-hover);
}

.button:active {
  background: var(--action-active);
}

.hero-figure {
  width: min(100%, 288px);
  margin: 32px auto 0;
  aspect-ratio: 1;
  border-radius: var(--radius-avatar);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}

.hero-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

@supports (corner-shape: superellipse(1.25)) {
  .hero-figure {
    corner-shape: superellipse(1.25);
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: 56px;
    line-height: 1.15;
  }

  .hero-figure {
    width: 320px;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 72px;
  }

  .hero {
    display: flex;
    align-items: center;
    min-height: calc(100vh - var(--nav-h));
    min-height: calc(100svh - var(--nav-h) - env(safe-area-inset-top));
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .hero-grid {
    container-type: inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 64px;
    align-items: center;
  }

  /* 窄桌面把头像收到 360，给左列留出可折行的宽度，避免 1024 溢出。 */
  .hero-figure {
    width: clamp(360px, calc(100cqi - 64px - 520px), 440px);
    margin: 0;
    justify-self: end;
  }
}

.section {
  padding-top: var(--section-gap);
}

@media (max-width: 1023px) {
  .hero + .section {
    padding-top: 0;
  }
}

h2 {
  font-size: 24px;
  line-height: 1.3;
}

.lede {
  margin-top: 16px;
  color: var(--ink-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
}

.entries {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "num title"
    "body body";
  column-gap: 12px;
  row-gap: 8px;
  min-width: 0;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.entry .num {
  grid-area: num;
}

.entry h3 {
  grid-area: title;
}

.entry p {
  grid-area: body;
}

.entry h3,
.step h3 {
  min-width: 0;
  font-size: 20px;
  line-height: 1.35;
}

.entry p,
.step p {
  min-width: 0;
  max-width: 640px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
}

.how-wrap {
  max-width: 680px;
}

.steps {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.step + .step {
  margin-top: 32px;
}

.step h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.step p {
  margin-top: 12px;
}

.num {
  flex: none;
  color: var(--action);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

@media (min-width: 768px) {
  h2 {
    font-size: 28px;
  }

  .lede {
    font-size: 18px;
  }

  .entry {
    grid-template-columns: 56px 224px minmax(0, 640px);
    grid-template-areas: "num title body";
    column-gap: 0;
    row-gap: 0;
    align-items: baseline;
    padding-block: 32px;
  }

  .entry .num {
    width: 40px;
  }

  .entry h3 {
    width: 200px;
    justify-self: start;
  }
}

@media (min-width: 1024px) {
  h2 {
    font-size: 32px;
  }

  .entry h3,
  .step h3 {
    font-size: 22px;
  }
}

.footer {
  margin-top: var(--section-gap);
}

.footer .shell {
  padding-top: 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.footer p {
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: normal;
  word-break: normal;
}

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

.domain {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.footer a,
.footer a:visited {
  color: var(--ink-muted);
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--action);
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 200ms ease, transform 200ms ease;
  }

  .button:active {
    transform: translateY(1px);
  }

  .rise {
    animation: rise 220ms var(--ease-out) both;
  }

  .rise-1 {
    animation-delay: 0ms;
  }

  .rise-2 {
    animation-delay: 60ms;
  }

  .rise-3 {
    animation-delay: 120ms;
  }

  .rise-4 {
    animation-delay: 180ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .rise {
    animation: fade 150ms ease both;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
