/*
  mcpkeel.app

  The page borrows from nautical charts, because the product is named for the
  part of a ship that stops it drifting. Chart paper is white where the water is
  deep and bluer as it shoals. Magenta is the overprint colour charts use for
  hazards. Buff is land: the fixed, surveyed part. Sloping letters label water,
  upright letters label land, so italics here mean "live, can move".
*/

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Commit Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/commit-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Commit Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/commit-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  --paper: #fbfcfb;
  --white: #ffffff;
  --ink: #10202c;
  --ink-soft: #44596a;
  --shoal-1: #e6f1f6;
  --shoal-2: #cfe4ef;
  --shoal-3: #b3d3e3;
  --contour: #6f9db6;
  --magenta: #b0186f;
  --buff: #f3eacb;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Commit Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --section: clamp(4.5rem, 10vw, 8.5rem);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--magenta);
}

:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -100vw;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 0;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.45rem;
  font-weight: 800;
  font-stretch: 70%;
  letter-spacing: 0.005em;
  text-decoration: none;
}
.wordmark:hover {
  color: var(--ink);
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 1.6rem;
  font-size: 0.98rem;
}
.masthead nav a {
  text-decoration: none;
  padding-block: 0.3rem;
}
.masthead nav a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------- hero */

.hero {
  padding-top: clamp(2.5rem, 7vw, 6rem);
}

/* The headline has no descenders, so it can sit directly on the course line. */
.hero h1 {
  font-size: clamp(2.9rem, 13.2vw, 10rem);
  font-weight: 800;
  font-stretch: 62%;
  line-height: 0.86;
  letter-spacing: -0.012em;
  margin-left: -0.04em;
}

.course {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  margin-top: -0.2rem;
}
.course-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.fix {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.fix-dot {
  fill: var(--ink);
}
.track-line {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 3;
  stroke-dasharray: 11 8;
  vector-effect: non-scaling-stroke;
}
.departure {
  fill: var(--paper);
  stroke: var(--magenta);
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.gap {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.gap-label {
  fill: var(--magenta);
  font-family: var(--sans);
  font-style: italic;
  font-size: 30px;
  font-weight: 500;
}

/* The one piece of motion: the track leaves the course once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .course .track {
    animation: leave-course 1.5s cubic-bezier(0.3, 0.1, 0.2, 1) 0.5s both;
  }
  .course .departure {
    animation: appear 0.3s ease-out 0.35s both;
  }
}
@keyframes leave-course {
  from {
    clip-path: inset(-20px 46% -20px 0);
  }
  to {
    clip-path: inset(-20px -2% -20px 0);
  }
}
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-top: clamp(-5.5rem, -6vw, -1rem);
}

.lede {
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  line-height: 1.38;
  max-width: 34em;
}

.install {
  display: inline-flex;
  align-items: stretch;
  margin-top: 2rem;
  border: 2px solid var(--ink);
  background: var(--white);
  max-width: 100%;
}
.install code {
  padding: 0.85rem 1.2rem;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow-x: auto;
}
.copy {
  font: inherit;
  font-weight: 650;
  font-size: 0.98rem;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  padding: 0 1.25rem;
  min-width: 5.6rem;
  cursor: pointer;
}
.copy:hover {
  background: var(--magenta);
}

.fine {
  margin-top: 1.1rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  max-width: 44em;
}

.legend {
  display: grid;
  gap: 0.9rem;
  font-size: 0.98rem;
  line-height: 1.4;
  padding-top: clamp(0rem, 7vw, 6.4rem);
}
.legend li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.9rem;
  align-items: start;
}
.legend svg {
  width: 2.5rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  overflow: visible;
}
.legend .track-line {
  stroke-dasharray: 5 4;
  stroke-width: 2.5;
}
.legend .course-line,
.legend .fix,
.legend .departure {
  stroke-width: 2;
}
.legend i {
  color: var(--magenta);
}

/* ---------------------------------------------------------------- sections */

main > section {
  padding-top: var(--section);
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 750;
  font-stretch: 72%;
  line-height: 1.02;
  letter-spacing: -0.005em;
  max-width: 17em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 750;
  font-stretch: 78%;
  line-height: 1.1;
}

.caption {
  margin-top: 1.4rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  max-width: 56em;
}

/* ---------------------------------------------------------------- printout */

/* Terminal output set on chart paper, inside a chart's double border. */
.printout {
  margin-top: 2.4rem;
  background: var(--white);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  font-family: var(--mono);
  font-size: clamp(0.8rem, 1.25vw, 0.9rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.printout .prompt {
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.printout .quiet {
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.printout .server {
  margin-top: 1.1rem;
}
.printout .bad {
  color: var(--magenta);
  font-weight: 700;
}
.printout .change {
  display: grid;
  grid-template-columns: 6.2em minmax(0, 1fr);
  column-gap: 1.2em;
  margin-top: 0.35rem;
  padding-left: 1.2em;
}
.printout .sev {
  font-weight: 700;
}
.printout .sev-critical {
  color: var(--magenta);
}
.printout .sev-low {
  color: var(--ink-soft);
}
.printout .minus,
.printout .plus,
.printout .flag {
  padding: 0.05rem 0.45rem;
  margin-left: -0.45rem;
}
/* Pinned text is land: buff. What replaced it is the hazard: magenta. */
.printout .minus {
  background: var(--buff);
}
.printout .plus {
  color: var(--magenta);
  background: #fbeaf3;
}
.printout .flag {
  color: var(--magenta);
}
.printout .flag .quiet {
  color: var(--ink-soft);
}
.printout .verdict {
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin-left: -0.6rem;
  background: var(--shoal-1);
  border-left: 3px solid var(--contour);
  font-family: var(--sans);
  font-size: 1.12em;
  line-height: 1.4;
}
.printout .total {
  margin-top: 1.1rem;
}

/* ------------------------------------------------------------ three commands */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 4vw, 3.5rem);
  margin-top: 2.6rem;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border-top: 3px solid var(--ink);
  padding-top: 0.9rem;
}
.steps li::before {
  content: counter(step);
  font-size: 4.6rem;
  font-weight: 800;
  font-stretch: 62%;
  line-height: 0.9;
  color: var(--contour);
}
.steps h3 {
  margin-top: 0.5rem;
}
.steps p {
  margin-top: 0.5rem;
}
.steps pre {
  margin-top: 1.2rem;
  padding: 0.75rem 0.95rem;
  background: var(--shoal-1);
  overflow-x: auto;
  font-size: 0.92rem;
}

.ci {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.ci p {
  margin-top: 0.8rem;
  max-width: 34em;
}
.ci pre {
  background: var(--white);
  border: 1px solid var(--ink);
  padding: 1.2rem 1.4rem;
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* ---------------------------------------------------------------- soundings */

.grading .intro {
  margin-top: 1.1rem;
  font-size: 1.15rem;
  max-width: 40em;
}

.soundings {
  margin-top: 2.4rem;
  border: 1px solid var(--ink);
}
.band {
  display: grid;
  grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  align-items: baseline;
  padding: clamp(1.2rem, 2.6vw, 2rem) clamp(1.1rem, 3vw, 2.4rem);
}
.band + .band {
  border-top: 1px solid var(--contour);
}
.band dt {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
  font-stretch: 66%;
  line-height: 1;
}
.band dd {
  max-width: 44em;
}
.band-critical {
  background: var(--shoal-3);
  /* Charts ring a hazard with a dotted danger line. */
  border-left: 6px dotted var(--magenta);
}
.band-critical dt {
  color: #8f0f58;
}
.band-high {
  background: var(--shoal-2);
}
.band-medium {
  background: var(--shoal-1);
}
.band-low {
  background: var(--white);
}

/* ------------------------------------------------------------------- claude */

.claude {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.claude-copy p {
  margin-top: 1.1rem;
  max-width: 34em;
}
.claude .printout {
  margin-top: 0.4rem;
}

.plain {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.65rem;
  max-width: 36em;
}
.plain li {
  padding-left: 1.5rem;
  position: relative;
}
.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.8rem;
  border-top: 2px solid var(--ink);
}

/* -------------------------------------------------------------------- facts */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.facts h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}
/* What is pinned is surveyed ground. */
.pinned {
  background: var(--buff);
  padding: clamp(1.4rem, 3.4vw, 2.6rem);
}
.local {
  padding-block: clamp(1.4rem, 3.4vw, 2.6rem);
}

/* ------------------------------------------------------------------- limits */

.limit-list {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem clamp(2rem, 6vw, 6rem);
}
.limit-list dt {
  font-weight: 700;
  font-size: 1.1rem;
}
.limit-list dd {
  margin-top: 0.25rem;
  max-width: 34em;
}

/* ------------------------------------------------------------------- footer */

footer {
  margin-top: var(--section);
  padding-block: 2.6rem 3.4rem;
  border-top: 3px solid var(--ink);
}
footer .install {
  margin-top: 0;
}
footer p {
  margin-top: 1.4rem;
  max-width: 46em;
}
footer .fine {
  margin-top: 0.7rem;
}

/* ---------------------------------------------------------------------- 404 */

.lost {
  padding-block: clamp(4rem, 14vw, 10rem);
}
.lost h1 {
  font-size: clamp(3.2rem, 11vw, 8rem);
  font-weight: 800;
  font-stretch: 62%;
  line-height: 0.9;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.1em;
}
.lost .lede {
  margin-top: 1.6rem;
}

/* ------------------------------------------------------------------- narrow */

@media (max-width: 60rem) {
  .hero-body,
  .ci,
  .claude,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-body {
    margin-top: 1.6rem;
  }
  .legend {
    padding-top: 0;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li {
    grid-template-rows: none;
  }
  .limit-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .local {
    padding-block: 0;
  }
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }
  .masthead nav a:nth-child(2),
  .masthead nav a:nth-child(3) {
    display: none;
  }
  .course {
    margin-top: 0.1rem;
  }
  .gap-label {
    display: none;
  }
  .band {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }
  .printout .change {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 0.6em;
  }
  .install {
    display: flex;
  }
  .install code {
    flex: 1;
  }
}

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