:root {
  color-scheme: light;
  --paper: #f1eee5;
  --ink: #222322;
  --cobalt: #214cc2;
  --amber: #f2b54c;
  --rule: #aaa99d;
  font: 100%/1.55 "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
img { display: block; width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }
.skip { position: fixed; z-index: 3; inset: 0 auto auto 0; background: var(--amber); padding: .75rem 1rem; transform: translateY(-130%); }
.skip:focus { transform: none; }

.workbench { display: grid; grid-template-columns: clamp(12.5rem, 18vw, 17.5rem) minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(1.1rem, 2.7vw, 2.6rem) clamp(1rem, 2.1vw, 2rem);
  background: var(--cobalt);
  color: #fff;
}
.rail :focus-visible { outline-color: var(--amber); }
.fridge-brand { display: inline-flex; align-items: center; align-self: flex-start; width: max-content; min-height: 2.75rem; gap: .65rem; text-decoration: none; }
.brand-emblem { position: relative; flex: none; width: 2.15rem; height: 2.45rem; background: var(--amber); color: var(--ink); }
.brand-emblem::before { content: ""; position: absolute; inset: .37rem .55rem; border: 1.5px solid currentColor; }
.brand-emblem::after {
  content: ""; position: absolute; inset: .43rem .61rem;
  background: linear-gradient(currentColor, currentColor) center 36% / 100% 1.5px no-repeat,
              linear-gradient(currentColor, currentColor) 76% 64% / 1.5px .37rem no-repeat;
}
.brand-label { display: grid; font: 600 1rem/1 "IBM Plex Mono", Consolas, monospace; letter-spacing: .13em; text-transform: uppercase; gap: .12em; }
.rail-index { display: grid; margin-top: clamp(2rem, 8vh, 5rem); border-top: 1px solid #ffffff72; }
.rail-index a, .rail-about { padding: .75rem 0; min-height: 2.75rem; display: block; font-weight: 650; text-decoration: none; }
.rail-index a { border-bottom: 1px solid #ffffff72; }
.rail-index a[aria-current], .rail-about[aria-current] { color: #fff; box-shadow: inset 3px 0 var(--amber); padding-inline-start: .65rem; }
.rail-index a:hover, .rail-about:hover { text-decoration: underline; }
.rail-about { margin-top: auto; }

.work-area { padding: clamp(1.5rem, 5vw, 5rem) clamp(1.2rem, 5vw, 5.5rem) 4rem; width: min(100%, 83rem); margin-inline: auto; }
.index-head { padding-bottom: clamp(1.35rem, 2.6vw, 2.4rem); border-bottom: 3px solid var(--cobalt); }
.index-head h1 { font-size: clamp(2.15rem, 5vw, 4.65rem); line-height: 1.01; letter-spacing: -.06em; font-weight: 780; overflow-wrap: break-word; }
.index-head p { max-width: 66ch; font-size: clamp(1rem, 1.4vw, 1.22rem); margin-top: .8rem; }
.index-head .instruction-credit { font-size: .94rem; font-weight: 650; }
.instruction-credit a { color: var(--cobalt); }
.back-to-index { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--cobalt); font-weight: 700; margin-bottom: .65rem; }
.case-list { padding: 0; margin: 0; list-style: none; }
.case { display: grid; grid-template-columns: clamp(11rem, 25vw, 22rem) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 3rem); padding-block: clamp(1rem, 2.2vw, 1.65rem); border-bottom: 1px solid var(--rule); align-items: center; }
.case-picture { display: block; overflow: hidden; }
.case-picture img { aspect-ratio: 2.25; object-fit: cover; transition: transform .22s ease; }
.case-picture:hover img { transform: scale(1.025); }
.case-section { display: inline-flex; align-items: center; min-height: 1.6rem; margin-bottom: .3rem; color: var(--cobalt); font-size: .88rem; font-weight: 680; }
.case h2, .category-case h2 { font-size: clamp(1.38rem, 2.7vw, 2.36rem); font-weight: 750; line-height: 1.13; letter-spacing: -.045em; }
.case h2 a { text-decoration: none; }
.case h2 a:hover { text-decoration: underline; }
.case h2 span, .category-case h2 span { color: var(--cobalt); white-space: nowrap; }
.case p, .category-case p { margin-top: .45rem; max-width: 57ch; }
.category-case {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2.5rem); align-items: center;
  padding-block: 1.5rem; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.category-case:hover h2 { text-decoration: underline; }

.instruction-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: clamp(1.4rem, 3vw, 3rem); margin-top: 1.55rem; align-items: start; }
.instruction-context img { border-bottom: 4px solid var(--amber); }
.instruction-context nav { margin-top: 1.45rem; }
.instruction-context h2 { font-size: 1rem; padding-bottom: .55rem; }
.instruction-context a { display: flex; gap: .4rem; justify-content: space-between; align-items: center; min-height: 2.75rem; padding-block: .55rem; border-top: 1px solid var(--rule); color: var(--cobalt); font-size: .94rem; font-weight: 650; }
.service-note { max-width: 65ch; margin-top: 1.55rem; }
.service-note .correction-note { margin-top: 1.5rem; padding-top: 1.15rem; border-top: 1px solid var(--rule); }
.service-note > a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-top: .9rem; }
.prose { font-size: clamp(1rem, 1.3vw, 1.12rem); overflow-wrap: break-word; }
.prose h2 { font-size: clamp(1.27rem, 2.15vw, 1.9rem); line-height: 1.15; letter-spacing: -.035em; margin-bottom: .7rem; }
.prose h2:not(:first-child) { margin-top: 1.5em; }
.prose p + p, .prose li + li { margin-top: .65em; }
.prose a { color: var(--cobalt); }
.prose ol, .prose ul { margin-top: 0; padding-left: 1.35em; }
.prose li::marker { color: var(--cobalt); font-weight: 750; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92em; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .6em .45em; border-bottom: 1px solid var(--rule); }
.prose th { background: var(--cobalt); color: white; }
.prose th:first-child { width: 36%; }

@media (max-width: 60rem) {
  .instruction-layout { grid-template-columns: minmax(0, 1fr); }
  .instruction-context { display: contents; }
  .instruction-context img { grid-row: 1; max-width: 36rem; }
  .instruction-context nav { margin-top: 0; }
}

@media (max-width: 46rem) {
  .workbench { display: block; }
  .rail { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .8rem; height: auto; min-height: 0; padding-block: .6rem 0; }
  .fridge-brand, .rail-about { min-height: 2.75rem; display: flex; align-items: center; padding-block: 0; }
  .rail-about { margin: 0; font-size: .83rem; }
  .rail-index { grid-row: 2; grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
  .rail-index a { display: flex; align-items: center; justify-content: center; padding: .45rem .2rem; text-align: center; font-size: .81rem; border-bottom: 0; }
  .rail-index a[aria-current] { box-shadow: inset 0 -3px var(--amber); padding-inline: .2rem; }
  .case { grid-template-columns: minmax(6rem, 28%) minmax(0, 1fr); }
  .case-picture img { aspect-ratio: 1.1; }
}

@media (max-width: 32rem) {
  .category-case { grid-template-columns: 1fr; }
  .case { gap: .85rem; }
  .case p { font-size: .9rem; }
  .case h2 { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  .case-picture img { transition: none; }
}
