:root {
  color-scheme: dark;
  --background: #101214;
  --text: #f0f1ec;
  --muted: #b6bbb6;
  --line: #383d3c;
  --highlight: #e2fe5c;
  --highlight-hover: #f0ffa1;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1.25rem, 5.55vw, 5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
}
h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd,
ol {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 0.22em;
}
a:hover {
  color: var(--highlight);
}
:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.frame {
  width: min(calc(100% - 2 * var(--gutter)), 79rem);
  margin-inline: auto;
}
.masthead,
.masthead-actions,
.nav,
.language-switch,
.wordmark,
.footer {
  display: flex;
  align-items: center;
}
.masthead,
.footer {
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  border-bottom: 1px solid var(--line);
}
.masthead-actions,
.nav {
  gap: clamp(0.85rem, 2.3vw, 2.25rem);
}
.nav a,
.more {
  font-size: 0.95rem;
  font-weight: 650;
}
.wordmark {
  gap: 0.65rem;
  font: 700 1rem var(--mono);
  text-decoration: none;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 3px;
  background: var(--highlight);
  color: #15190b;
  letter-spacing: -0.13em;
}
.language-switch {
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.language-switch a {
  display: grid;
  min-width: 2.5rem;
  min-height: 2.35rem;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font: 700 0.82rem var(--mono);
}
.language-switch a[aria-current="page"] {
  background: #282e21;
  color: var(--highlight);
}
.hero {
  display: grid;
  grid-template-columns: 1.07fr 0.93fr;
  gap: clamp(2.5rem, 5vw, 5.25rem);
  align-items: center;
  padding-block: clamp(3rem, 5.8vw, 6rem);
}
.audience {
  font: 600 0.86rem/1.55 var(--mono);
  color: var(--highlight);
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1 {
  margin: 0.22em 0 0.28em;
  font-size: clamp(4.1rem, 7.6vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: -0.077em;
}
h2 {
  font-size: clamp(2.6rem, 4.7vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.067em;
}
h3 {
  font-size: clamp(1.4rem, 2.1vw, 2rem);
  line-height: 1.13;
  letter-spacing: -0.047em;
}
.lead,
.section-intro,
.bio p,
.practice-copy p,
.lesson p {
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}
.lead {
  max-width: 43ch;
  font-size: clamp(1.12rem, 1.55vw, 1.32rem);
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 3rem;
  margin-top: 1.55rem;
  padding: 0.65rem 1rem;
  border-radius: 3px;
  background: var(--highlight);
  color: #15190b;
  font-weight: 700;
  text-decoration: none;
}
.hero-link:hover {
  color: #15190b;
  background: var(--highlight-hover);
}
.case {
  min-width: 0;
  padding: clamp(1.15rem, 2.45vw, 2.15rem);
  border: 1px solid #3f4d75;
  border-radius: 5px;
  background-color: #17203d;
  background-image:
    radial-gradient(at 85% 10%, #2e427756, transparent 70%),
    linear-gradient(#b2c2ff09 1px, transparent 1px),
    linear-gradient(90deg, #b2c2ff09 1px, transparent 1px);
  background-size:
    auto,
    1.5rem 1.5rem,
    1.5rem 1.5rem;
}
.case-context,
.case-controls legend,
.case-exchange dt {
  color: #c0cafa;
  font: 600 0.8rem/1.4 var(--mono);
}
.case h2 {
  margin-top: 0.4rem;
  font-size: clamp(1.65rem, 2.45vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}
.case-exchange {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 0.85rem;
  margin-top: 1.1rem;
  padding-left: 0.9rem;
  border-left: 2px solid #99a5d9;
}
.case-exchange dt {
  padding-top: 0.18em;
}
.case-exchange dd {
  font-size: 1.05rem;
  line-height: 1.42;
}
.case-instruction,
.case-fallback {
  color: #e0e4ef;
  margin-top: 1rem;
  font-size: 0.97rem;
  line-height: 1.48;
}
.case-controls {
  min-width: 0;
  padding: 0;
  margin: 1rem 0 0;
  border: 0;
}
.case-controls legend {
  padding: 0;
  margin-bottom: 0.4rem;
}
.case-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.case-choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.65rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #69779b;
  border-radius: 3px;
  font: 600 0.85rem/1.3 var(--mono);
  cursor: pointer;
}
.case-choices label:has(:checked) {
  background: #303a56;
  border-color: #d7e0ff;
}
.case-choices input {
  margin: 0;
  accent-color: var(--highlight);
}
.case-choices label:focus-within {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
.case-records {
  width: 100%;
  margin-top: 0.85rem;
  border-collapse: collapse;
  font: 0.86rem/1.4 var(--mono);
}
.case-records th,
.case-records td {
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid #4b5675;
  text-align: left;
}
.case-records th {
  color: #bfc8e0;
  font: 600 0.8rem/1.4 var(--sans);
}
.case-records th:first-child,
.case-records td:first-child {
  padding-left: 0;
}
.case-records th:last-child,
.case-records td:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}
.check-records {
  min-height: 2.75rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 3px;
  padding: 0.55rem 0.95rem;
  color: #15190b;
  background: var(--highlight);
  font: 700 0.95rem/1.3 var(--sans);
  cursor: pointer;
}
.check-records:hover {
  background: var(--highlight-hover);
}
.case-rule {
  margin-top: 0.85rem;
  color: #d7dcea;
  font-size: 0.9rem;
  line-height: 1.5;
}
.case-rule summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}
.case-rule p {
  margin-top: 0.45rem;
}
.case-result {
  line-height: 1.5;
}
.case-result:not([data-verdict="pending"]) {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--highlight);
  background: #10172b;
}
.case-result[data-verdict="review"] {
  border-color: #ffc29f;
}
.case-decision {
  display: block;
  font-size: 1.05rem;
}
.case-explanation {
  color: #d7dcea;
  font-size: 0.95rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 30rem) {
  .case-exchange {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .case-exchange dd + dt {
    margin-top: 0.4rem;
  }
}
.section,
.bio {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.75rem, 5vw, 5.2rem);
}
.section-header,
.bio,
.practice {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 1.4rem clamp(2rem, 5.3vw, 6rem);
}
.section-header {
  align-items: end;
}
.section-intro,
.bio p,
.practice-copy p {
  max-width: 54ch;
  font-size: clamp(1.05rem, 1.45vw, 1.22rem);
}
.lessons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(1.6rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
}
.lesson {
  padding: clamp(1.35rem, 2.9vw, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.lesson:nth-child(odd) {
  padding-right: clamp(1.25rem, 3vw, 3rem);
  border-right: 1px solid var(--line);
}
.lesson:nth-child(even) {
  padding-left: clamp(1.25rem, 3vw, 3rem);
}
.lesson p {
  margin-top: 0.7rem;
  max-width: 48ch;
  font-size: 1.06rem;
}
.practice {
  padding-top: 0.4rem;
  padding-bottom: clamp(3rem, 5vw, 5rem);
}
.practice-copy p + p,
.bio p + p {
  margin-top: 0.85rem;
}
.bio a.more {
  display: inline-block;
  margin-top: 1.15rem;
  color: var(--highlight);
}
.footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  min-height: 5.5rem;
}
.footer .wordmark {
  font-size: 0.88rem;
}
.footer a:last-child {
  font-size: 0.92rem;
}
@media (max-width: 48rem) {
  .hero,
  .section-header,
  .bio,
  .practice {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    gap: 2rem;
  }
  .hero h1 {
    max-width: 12ch;
  }
  .section-header,
  .practice,
  .bio {
    gap: 1rem;
  }
}
@media (max-width: 39rem) {
  .masthead {
    min-height: 4.4rem;
  }
  .masthead .nav {
    display: none;
  }
  h1 {
    font-size: clamp(3.5rem, 12vw, 4.65rem);
  }
  .lessons {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson:nth-child(n) {
    padding: 1.45rem 0;
    border-right: 0;
  }
}
.unix-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.unix-intro h2 {
  max-width: 13ch;
}
.unix-intro p {
  max-width: 44ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.unix-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #42506b;
  border-radius: 4px;
  background: #151b2c;
  color: #eef0f8;
  font: 0.95rem/1.5 var(--mono);
}

.unix-file-head,
.unix-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.unix-file-head {
  padding: 0.85rem clamp(1rem, 2.3vw, 2rem);
  border-bottom: 1px solid #394259;
  background: #1d263b;
}
.unix-mode {
  white-space: nowrap;
}
.unix-shell code {
  font-family: inherit;
}
.unix-shell .mode-bit {
  padding: 0.1em;
  background: #414a34;
  color: var(--highlight);
}

.unix-source {
  margin: 0;
  padding: 1.5rem clamp(1rem, 2.3vw, 2rem);
  overflow-x: auto;
  font: inherit;
}
.unix-shebang {
  color: #a4adc2;
}
.script-message {
  color: #dbe696;
}

.unix-controls {
  padding: 0 clamp(1rem, 2.3vw, 2rem) 1.2rem;
}
.unix-controls button {
  min-height: 44px;
  border: 0;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.unix-controls .run-script {
  padding: 0.5rem 1rem;
  border-radius: 3px;
  background: var(--highlight);
  color: #15190b;
  font-weight: 700;
}
.unix-controls .run-script:hover {
  background: var(--highlight-hover, #f0ffa1);
}

.unix-controls .switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: start;
}
.unix-track {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.1rem;
  border: 1px solid #a7adbc;
  border-radius: 1rem;
  padding: 0.15rem;
}
.unix-track::after {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #c3c9d6;
  content: "";
}
.switch[aria-checked="true"] .unix-track {
  border-color: var(--highlight);
  background: var(--highlight);
}
.switch[aria-checked="true"] .unix-track::after {
  margin-left: auto;
  background: #15190b;
}

.unix-result,
.unix-fallback {
  margin: 0;
  padding: 1rem clamp(1rem, 2.3vw, 2rem);
  border-top: 1px solid #394259;
  background: #0e1220;
  overflow-wrap: anywhere;
}
.unix-result {
  min-height: 5.1rem;
}
.unix-result .command-line {
  display: block;
  color: #aeb7c9;
}
.unix-result .run-feedback {
  margin: 0;
}
.unix-shell[data-state="denied"] .run-feedback {
  color: #ffd49b;
}
.unix-shell[data-state="ran"] .run-feedback {
  color: var(--highlight);
}
.unix-shell [hidden] {
  display: none !important;
}

@media (max-width: 48rem) {
  .unix-section {
    grid-template-columns: minmax(0, 1fr);
  }
  .unix-intro h2 {
    max-width: none;
  }
}
