* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --ground: #f7f7f7;
  --paper: #fff;
  --ink: #0d2a1c;
  --quiet: #4d6054;
  --accent: #f6e016;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  font: 100%/1.55 "Aptos", "Trebuchet MS", "Microsoft YaHei", system-ui, sans-serif;
}

body { margin: 0; background: var(--ground); color: var(--ink); }
a { color: inherit; text-underline-offset: .25em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
h1, h2, h3, p, figure, pre { margin: 0; }
h1, h2, h3 { line-height: 1.06; text-wrap: balance; }
code { font-family: "Cascadia Code", "Liberation Mono", Consolas, monospace; }

.frame, .masthead {
  width: min(100% - 2 * var(--gutter), 75rem);
  margin-inline: auto;
}

.masthead, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.wordmark { font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.wordmark:hover { text-decoration: underline; }
.language { padding: .5rem 0; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 6rem);
  padding-block: clamp(2rem, 8vw, 7rem);
}

h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 6.3vw, 6rem);
  font-weight: 670;
  letter-spacing: -.065em;
}
[lang="zh-CN"] h1 { letter-spacing: -.035em; }

.lead {
  max-width: 33ch;
  margin-top: 1.75rem;
  color: var(--quiet);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .65rem 1rem;
  background: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.button:hover { text-decoration: underline; }

.terminal-field {
  min-width: 0;
  display: grid;
  align-items: center;
  min-height: clamp(15rem, 29vw, 25rem);
  padding: clamp(1rem, 3vw, 3.2rem) 0 clamp(1rem, 3vw, 3.2rem) clamp(1rem, 3vw, 3.2rem);
  position: relative;
  isolation: isolate;
}

.terminal-field::before {
  position: absolute;
  z-index: -1;
  inset: 0 7% 0 0;
  background: var(--accent);
  clip-path: polygon(0 0, 80% 0, 100% 50%, 80% 100%, 0 100%);
  content: "";
}

.terminal {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--ink);
  color: var(--paper);
}
.terminal figcaption { margin-bottom: 1rem; font-size: .875rem; color: #d6e3d9; }
.terminal pre { overflow-x: auto; font-size: clamp(.875rem, 1.25vw, 1rem); line-height: 1.7; }
.prompt { color: var(--accent); }
.removed { color: #ffd2b9; }
.added { color: #ccf6be; }

.notes { background: #e6ece7; padding-block: clamp(2.75rem, 7vw, 5.5rem); }
.notes .frame { display: grid; grid-template-columns: minmax(13rem, 1fr) 2fr; gap: clamp(1.5rem, 5vw, 5rem); }
h2 { font-size: clamp(2rem, 4.7vw, 4.5rem); letter-spacing: -.045em; }
h3 { font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -.025em; }
nav { display: grid; justify-items: start; gap: .75rem; margin-top: 1.75rem; }

.paper {
  min-width: 0;
  padding: clamp(1.25rem, 5vw, 3.5rem);
  background: var(--paper);
}
article { scroll-margin-top: 1rem; }
article + article { margin-top: 2.5rem; }
article p { max-width: 60ch; margin-top: .65rem; color: var(--quiet); font-size: 1rem; }
article pre {
  max-width: 100%;
  margin-top: .75rem;
  padding: .6rem .75rem;
  overflow-x: auto;
  background: #eef1ee;
  font-size: .9rem;
  line-height: 1.5;
}
.footer { min-height: 5.5rem; }

@media (max-width: 47rem) {
  .hero, .notes .frame { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 2.5rem; }
  .terminal-field { min-height: 0; }
  nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; }
}

