* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--type-body-font-family);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button,
select { font: inherit; }

:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: .75rem 1rem;
  background: var(--color-paper);
  color: var(--color-text-on-paper);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-nav {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(184, 181, 172, .34);
  font-family: var(--type-label-font-family);
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem); }

.skill-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: min(860px, calc(100dvh - 68px));
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  overflow: hidden;
}

.skill-hero::before {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 50%;
  background: url('/assets/humane-hero-mechanical.png') center / cover no-repeat;
  background-image: image-set(url('/assets/humane-hero-mechanical.avif') type('image/avif'), url('/assets/humane-hero-mechanical.webp') type('image/webp'), url('/assets/humane-hero-mechanical.png') type('image/png'));
  filter: grayscale(1) contrast(1.08);
  content: '';
}

.skill-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #090909 0 49%, rgba(9, 9, 9, .92) 60%, rgba(9, 9, 9, .18) 100%);
  content: '';
}

.hero-copy {
  display: flex;
  min-width: 0;
  max-width: 860px;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  padding: clamp(2rem, 6vw, 6.5rem) clamp(1rem, 5vw, 5rem) clamp(2.5rem, 5vw, 4.5rem);
}

.skill-path,
.phase-label,
.section-label,
.demo-count,
.case-list strong {
  font-family: var(--type-label-font-family);
  font-size: .7rem;
  letter-spacing: .07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.skill-path { color: var(--color-muted); }

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 11ch;
  margin-bottom: 1.6rem;
  font-size: clamp(4.2rem, 9vw, 9.5rem);
  font-weight: 200;
  font-variation-settings: 'wght' 200, 'wdth' 125;
  letter-spacing: -.075em;
  line-height: .8;
  text-wrap: balance;
}

.hero-summary {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: clamp(1.15rem, 1.65vw, 1.55rem);
  line-height: 1.32;
}

.hero-question {
  max-width: 28rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(184, 181, 172, .52);
  font-size: clamp(1.35rem, 2.1vw, 2.1rem);
  font-weight: 300;
  line-height: 1.15;
}

.hero-rail {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.phase-label {
  padding: .8rem 1rem;
  background: var(--color-red);
  color: var(--color-on-accent);
}

.content-section {
  padding: clamp(4rem, 9vw, 9rem) clamp(1rem, 5vw, 5rem);
}

.paper-section {
  background: var(--color-paper-surface);
  color: var(--color-text-on-paper);
}

.section-grid {
  display: grid;
  max-width: 1500px;
  margin: 0 auto;
  grid-template-columns: minmax(230px, .65fr) minmax(0, 1.35fr);
  gap: clamp(3rem, 8vw, 9rem);
}

.section-label { color: #6a6863; }

.content-section h2 {
  max-width: 11ch;
  margin-bottom: 2rem;
  font-size: clamp(3.2rem, 6.5vw, 7rem);
  font-weight: 250;
  font-variation-settings: 'wght' 250, 'wdth' 118;
  letter-spacing: -.065em;
  line-height: .88;
}

.lead {
  max-width: 46rem;
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  line-height: 1.3;
}

.facts {
  display: grid;
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem clamp(2rem, 6vw, 7rem);
}

.fact h3 {
  margin-bottom: .8rem;
  font-family: var(--type-label-font-family);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.fact p,
.fact li { font-size: 1.05rem; line-height: 1.55; }
.fact ul { margin: 0; padding-left: 1.1rem; }

.demo-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.demo-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 4rem);
}

.demo-header h2 { margin-bottom: 0; }

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
}

.demo-controls button,
.copy-command {
  min-height: 46px;
  border: 1px solid rgba(243, 240, 232, .62);
  border-radius: 0;
  padding: .75rem 1rem;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--type-label-font-family);
  font-size: .72rem;
  letter-spacing: .04em;
}

.demo-controls button[aria-pressed='true'] {
  border-color: var(--color-red);
  background: var(--color-red);
  color: var(--color-on-accent);
}

.demo-controls button:active,
.copy-command:active { transform: translateY(1px); }

.demo-board {
  display: grid;
  min-height: 520px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  background: var(--color-paper-surface);
  color: var(--color-text-on-paper);
}

.demo-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  padding: clamp(1.5rem, 4vw, 4.5rem);
}

.demo-output {
  max-width: 21ch;
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5.1vw, 5.8rem);
  font-weight: 260;
  font-variation-settings: 'wght' 260, 'wdth' 112;
  letter-spacing: -.055em;
  line-height: .94;
  overflow-wrap: anywhere;
}

.demo-output[data-mode='treated'] { color: var(--color-red); }

.demo-annotation {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.demo-note { max-width: 36rem; margin-bottom: 0; line-height: 1.45; }

.demo-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--color-red);
  color: var(--color-on-accent);
}

.demo-aside .section-label { color: var(--color-on-accent); }

.demo-aside h3 {
  max-width: 12ch;
  margin-bottom: 0;
  font-size: clamp(2rem, 3.7vw, 4rem);
  font-weight: 250;
  letter-spacing: -.055em;
  line-height: .92;
}

.demo-aside p { margin-bottom: 0; line-height: 1.45; }

.case-transcript {
  display: grid;
  max-width: 1500px;
  margin: 2rem auto 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(184, 181, 172, .35);
  list-style: none;
}

.case-list {
  padding: 1.4rem;
  background: #11110f;
}

.case-list p { margin: .75rem 0 0; color: var(--color-muted); line-height: 1.45; }
.case-list .case-result { color: var(--color-text); }

.install-block {
  display: grid;
  max-width: 1500px;
  margin: 0 auto;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 8vw, 10rem);
  align-items: start;
}

.command-line {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(243, 240, 232, .48);
}

.command-line code {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  color: var(--color-paper);
  font-family: var(--type-label-font-family);
  font-size: clamp(.78rem, 1.2vw, 1rem);
  white-space: nowrap;
}

.copy-command {
  border-width: 0 0 0 1px;
  border-color: rgba(243, 240, 232, .48);
}

.related-links {
  display: grid;
  margin-top: 3rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(184, 181, 172, .35);
}

.related-links a {
  min-height: 150px;
  padding: 1.3rem;
  background: #11110f;
  text-decoration: none;
}

.related-links a:hover { background: var(--color-red); }
.related-links span { display: block; margin-top: 2rem; font-size: 1.25rem; }

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid rgba(184, 181, 172, .34);
  color: var(--color-muted);
  font-family: var(--type-label-font-family);
  font-size: .7rem;
  letter-spacing: .04em;
}

.directory-hero {
  min-height: min(760px, calc(100dvh - 68px));
  padding: clamp(3rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.directory-hero h1 { max-width: 12ch; }
.directory-hero p { max-width: 42rem; color: var(--color-muted); font-size: clamp(1.2rem, 2vw, 1.7rem); line-height: 1.35; }

.phase-group {
  display: grid;
  grid-template-columns: minmax(160px, .35fr) minmax(0, 1.65fr);
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 5vw, 5rem);
  border-top: 1px solid rgba(184, 181, 172, .35);
}

.phase-group h2 {
  position: sticky;
  top: 2rem;
  align-self: start;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 250;
  letter-spacing: -.06em;
  line-height: .9;
}

.skill-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(184, 181, 172, .3);
}

.directory-link {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: #11110f;
  text-decoration: none;
}

.directory-link:hover { background: var(--color-red); }
.directory-link h3 { max-width: 12ch; margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 4.2rem); font-weight: 250; letter-spacing: -.06em; line-height: .9; }
.directory-link p { max-width: 32rem; margin-bottom: 0; color: var(--color-muted); line-height: 1.45; }
.directory-link:hover p { color: var(--color-on-accent); }

@media (max-width: 760px) {
  html { scroll-behavior: auto; }
  .site-nav { min-height: 62px; gap: 1rem; padding-inline: 1rem; }
  .nav-links a:first-child { display: none; }
  .skill-hero { min-height: calc(100dvh - 62px); grid-template-columns: 1fr; }
  .skill-hero::before { inset: 42% 0 0 0; opacity: .7; }
  .skill-hero::after { background: linear-gradient(180deg, #090909 0 48%, rgba(9, 9, 9, .9) 63%, rgba(9, 9, 9, .2) 100%); }
  .hero-copy { min-height: calc(100dvh - 62px); padding: 2.5rem 1rem 1.5rem; }
  h1 { max-width: 10ch; font-size: clamp(3.5rem, 16.5vw, 4.5rem); }
  .hero-summary { max-width: 28rem; font-size: 1.05rem; }
  .hero-question { max-width: 22rem; font-size: 1.3rem; }
  .hero-rail { position: absolute; right: 0; bottom: 0; }
  .content-section { padding: 4.5rem 1rem; }
  .section-grid,
  .install-block,
  .phase-group { grid-template-columns: 1fr; gap: 2.5rem; }
  .content-section h2 { font-size: clamp(3.2rem, 15vw, 5.2rem); }
  .facts { grid-template-columns: 1fr; gap: 2.5rem; }
  .demo-header { grid-template-columns: 1fr; align-items: start; }
  .demo-controls { justify-content: flex-start; }
  .demo-board { min-height: 620px; grid-template-columns: 1fr; }
  .demo-stage { min-height: 390px; padding: 1.4rem; }
  .demo-output { font-size: clamp(2.1rem, 10.5vw, 3.6rem); }
  .demo-annotation { align-items: flex-start; flex-direction: column; }
  .demo-aside { min-height: 220px; }
  .case-transcript,
  .related-links,
  .skill-directory { grid-template-columns: 1fr; }
  .command-line { flex-direction: column; }
  .copy-command { border-width: 1px 0 0; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .phase-group { padding: 4rem 1rem; }
  .phase-group h2 { position: static; }
  .directory-link { min-height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
