/* ztuph.com
   Colours taken from the Ztuph Consulting logo: deep navy, gold traces and
   violet traces. The layout keeps the engineer's computation pad: a faint
   grid, and gold dimension marks drawn the way a drafter marks a part. */

:root {
  --pad: #07123f;        /* logo navy, the page */
  --grid: rgba(255, 255, 255, 0.045); /* faint printed grid */
  --rule: #24326e;       /* borders on sheets */
  --ink: #eef1fb;        /* main text */
  --graphite: #aeb7dc;   /* secondary text */
  --mark: #f5c400;       /* logo gold: dimension marks and accents */
  --violet: #b98bff;     /* logo violet, lightened so it reads on navy */
  --sheet: #0c1a55;      /* a sheet laid on the pad */

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;
  --page: 62rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  background-color: var(--pad);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
  background-position: -1px -1px;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--violet); }
a:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

.skip { position: absolute; left: -999rem; top: 0; background: var(--sheet); padding: 0.5rem 0.75rem; }
.skip:focus { left: var(--gutter); top: 0.5rem; z-index: 10; }

/* ---------- header ---------- */

.site-header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.94rem; }
.site-header nav a { text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--violet); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--mark); }

.wordmark .mark { width: 2.4rem; height: 2.4rem; border-radius: 0.35rem; display: block; }

/* ---------- shared page frame ---------- */

main { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; }

.lede { font-size: 1.18rem; line-height: 1.5; max-width: var(--measure); margin: 1.5rem 0 0; color: var(--ink); }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.prose li { margin-bottom: 0.45rem; }

/* ---------- landing page ---------- */

.opening {
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 3rem);
}
/* The logo stands above the headline, so the text keeps its full width. */
.opening-logo { order: -1; width: 100%; max-width: 30rem; height: auto; display: block; }
.opening h1 {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  letter-spacing: -0.015em;
  max-width: 19ch;
  text-wrap: balance;
}

.quiet-heading {
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--graphite);
  margin-bottom: 0.5rem;
}

.dimensions { list-style: none; margin: 0; padding: 0; }

.dimension-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "line line"
    "name open"
    "summary open";
  column-gap: 2rem;
  padding: 0 0 2.25rem;
  text-decoration: none;
}

/* The dimension line: two extension marks with a ruled line between them,
   the way a drafter marks the extent of a part. */
.dimension-line { grid-area: line; display: flex; align-items: center; height: 1.75rem; color: var(--mark); }
.dimension-line .tick { width: 1px; height: 100%; background: currentColor; flex: none; }
.dimension-line .rule { position: relative; flex: 1; height: 1px; background: currentColor; }
.dimension-line .rule::before,
.dimension-line .rule::after {
  content: "";
  position: absolute;
  top: 50%;
  border: 0.24rem solid transparent;
  transform: translateY(-50%);
}
.dimension-line .rule::before { left: 0; border-right-color: currentColor; border-left-width: 0; border-right-width: 0.7rem; }
.dimension-line .rule::after { right: 0; border-left-color: currentColor; border-right-width: 0; border-left-width: 0.7rem; }

.dimension-name {
  grid-area: name;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
}
.dimension-summary { grid-area: summary; color: var(--graphite); margin-top: 0.4rem; max-width: var(--measure); }
.dimension-open {
  grid-area: open;
  align-self: end;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
  white-space: nowrap;
}
.dimension-link:hover .dimension-open,
.dimension-link:focus-visible .dimension-open { background: var(--mark); border-color: var(--mark); color: var(--pad); }
.dimension-link:hover .dimension-name { text-decoration: underline; text-decoration-color: var(--violet); text-decoration-thickness: 2px; text-underline-offset: 0.14em; }

.about { margin-top: 2rem; padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem; background: var(--sheet); border: 1px solid var(--rule); }
.about h2 { font-size: 1.5rem; margin-bottom: 1rem; }

/* ---------- a dimension's own page ---------- */

.dimension-article { padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem) 2.5rem; margin-top: 2rem; background: var(--sheet); border: 1px solid var(--rule); }
.dimension-article .back { margin: 0 0 2rem; font-size: 0.94rem; }
.dimension-article h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -0.015em; max-width: 18ch; text-wrap: balance; }
.dimension-article .lede { margin-bottom: 2.75rem; }
.dimension-article section h2 { font-size: 1.4rem; margin: 2.25rem 0 0.75rem; }

.others { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--mark); }
.others h2 { font-family: var(--sans); font-size: 0.94rem; font-weight: 500; color: var(--graphite); margin-bottom: 0.6rem; }
.others ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; font-family: var(--serif); font-size: 1.18rem; }

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

.site-footer { max-width: var(--page); margin: 0 auto; padding: 3.5rem var(--gutter) 3rem; }
.site-footer h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.site-footer p { max-width: var(--measure); margin: 0 0 1rem; }
.site-footer .small { font-size: 0.88rem; color: var(--graphite); }

.noscript { max-width: var(--measure); margin: 3rem auto; padding: 0 var(--gutter); }

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  .opening-logo { max-width: 20rem; }
}

@media (max-width: 40rem) {
  .dimension-link { grid-template-columns: 1fr; grid-template-areas: "line" "name" "summary" "open"; }
  .dimension-open { justify-self: start; margin-top: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .dimension-open { transition: background-color 120ms ease, color 120ms ease; }
}

/* A link that leaves the site, set apart from the text above it. */
.outside-link { margin-top: 0.75rem; font-weight: 600; }
.outside-link a::after { content: " \2197"; color: var(--mark); }
