/*
 * ORMetIq website.
 *
 * Visual idea: the paper anaesthesia record. Printed green grid, entries in
 * blue ballpoint, blood pressure marked with red chevrons. The hero chart is
 * the one expressive element; everything else stays quiet.
 */

@font-face {
  font-family: "Fira Sans Condensed";
  src: url("/fonts/fira-sans-condensed-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans Condensed";
  src: url("/fonts/fira-sans-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5f7f4;
  --grid: #d3e2d9;
  --grid-major: #b7cfc2;
  --ink: #15322c;
  --ink-muted: #4f6861;
  --ballpoint: #2347c5;
  --ballpoint-deep: #1a369c;
  --marker: #c23b2e;

  --display: "Fira Sans Condensed", "Arial Narrow", sans-serif;
  --text: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;

  /* Type scale: 18px base, steps of a fourth (1.333) for headings. */
  --step-0: 1.125rem;
  --step-1: 1.5rem;
  --step-2: 2rem;
  --step-3: clamp(2.25rem, 4vw, 2.75rem);
  --step-4: clamp(2.75rem, 8vw, 5.5rem);

  --measure: 64ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

h1,
h2,
h3,
dt {
  /* German compounds ("Entscheidungsunterstützung") overflow narrow screens
     without hyphenation. */
  hyphens: auto;
  overflow-wrap: break-word;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}

a {
  color: var(--ballpoint);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--ballpoint-deep);
}
:focus-visible {
  outline: 3px solid var(--ballpoint);
  outline-offset: 3px;
  border-radius: 2px;
}

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

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

/* ---- Header ---------------------------------------------------------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.wordmark {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark-name {
  /* Atkinson's capital I carries serifs; in a plain sans the I of
     "Intelligence" reads as a lowercase l ("ORMetlq"). */
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
}
.wordmark-expansion {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 1rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--ballpoint);
  text-decoration: underline;
}
.site-nav .lang {
  color: var(--ink-muted);
}

@media (max-width: 40rem) {
  .site-nav .nav-section {
    display: none;
  }
}

/* ---- Hero: the anaesthesia record ------------------------------------ */

.hero {
  /* Minor lines every 20px, major every 100px, as on a printed record. */
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
  border-top: 1px solid var(--grid-major);
  border-bottom: 1px solid var(--grid-major);
}

.hero-copy {
  padding-top: clamp(3rem, 9vw, 6.5rem);
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.005em;
}

.lede {
  max-width: var(--measure);
  margin: 1.75rem 0 0;
  font-size: 1.25rem;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 3px;
  background: var(--ballpoint);
  color: #fff;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.button:hover {
  background: var(--ballpoint-deep);
  color: #fff;
}

.access-note {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-muted);
}

/* The chart itself */
.record {
  /* Shorthand on purpose: <figure> has 40px side margins by default. */
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
}
.record svg {
  display: block;
  width: 100%;
  /* Fixed height, stretched horizontally: scaled uniformly the chart would
     shrink to a sliver on a phone. */
  height: clamp(9rem, 20vw, 15rem);
  overflow: visible;
}
.trace {
  fill: none;
  stroke: var(--ballpoint);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 2.4s cubic-bezier(0.45, 0.05, 0.25, 1) 0.3s both;
}
.chevron {
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke: var(--marker);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: appear 0.6s ease-out 2.2s both;
}
.phase-line {
  vector-effect: non-scaling-stroke;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.35;
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}
@keyframes appear {
  from {
    opacity: 0;
  }
}

.phases {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 0;
  padding: 0.75rem 0 1.5rem;
  list-style: none;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ink-muted);
}
.phases li {
  padding-left: 0.4rem;
  border-left: 1px solid var(--grid-major);
}

@media (max-width: 40rem) {
  .phases {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.4rem;
  }
  /* Labels wrap to two rows here, so dividers would no longer line up. */
  .phase-line {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trace,
  .chevron {
    animation: none;
  }
}

/* ---- Sections -------------------------------------------------------- */

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0 0;
}

.section h2 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.05;
}

.section-intro {
  max-width: var(--measure);
  margin: 0;
}

/* The quality cycle: a real sequence, so it is numbered. */
.cycle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.cycle li {
  counter-increment: step;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}
.cycle li::before {
  content: counter(step);
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ballpoint);
}
.cycle h3 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.1;
}
.cycle p {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-muted);
}
.cycle-return {
  margin: 1.25rem 0 0;
  font-size: 1rem;
  color: var(--ink-muted);
  font-style: italic;
}

@media (max-width: 52rem) {
  .cycle {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 30rem) {
  .cycle {
    grid-template-columns: 1fr;
  }
}

/* Development path: three phases on a line; the first is where we are. */
.path {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.path li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--grid-major);
}
.path li:last-child {
  border-bottom: 1px solid var(--grid-major);
}
.path-phase {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.1;
  color: var(--ink-muted);
}
.path li.current .path-phase {
  color: var(--ballpoint);
}
.path h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.15;
}
.path p {
  max-width: var(--measure);
  margin: 0;
}
.path-status {
  display: block;
  margin-top: 0.4rem;
  font-size: 1rem;
  color: var(--ballpoint);
}

@media (max-width: 36rem) {
  .path li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
  margin: 2.5rem 0 0;
}
.principles dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.15;
}
.principles dd {
  margin: 0.35rem 0 0;
  max-width: 48ch;
}

@media (max-width: 40rem) {
  .principles {
    grid-template-columns: 1fr;
  }
}

.audience {
  max-width: var(--measure);
  margin: 2.5rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--ballpoint);
}

/* ---- Demonstrator: the page's destination ---------------------------- */

.demo {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding: clamp(3rem, 7vw, 5rem) 0;
  background: var(--ballpoint);
  color: #fff;
}
.demo h2 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.05;
}
.demo p {
  max-width: var(--measure);
  margin: 0;
}
.demo-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 2.5rem;
  max-width: 52rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.demo-features li {
  padding-left: 1.1rem;
  position: relative;
}
/* A ballpoint tick, drawn in white on the blue. */
.demo-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.45rem;
  height: 2px;
  background: #fff;
}
.demo .actions {
  margin-top: 2.25rem;
}
.demo .button {
  background: #fff;
  color: var(--ballpoint);
}
.demo .button:hover {
  background: var(--paper);
  color: var(--ballpoint-deep);
}
.demo .access-note {
  color: #dbe3ff;
}
.demo a:not(.button) {
  color: #fff;
}
.demo :focus-visible {
  outline-color: #fff;
}

@media (max-width: 40rem) {
  .demo-features {
    grid-template-columns: 1fr;
  }
}

/* ---- Contact and footer ---------------------------------------------- */

.contact p {
  max-width: var(--measure);
  margin: 0;
}
.contact .mail {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.1;
}

.site-footer {
  margin-top: clamp(4rem, 9vw, 6rem);
  border-top: 1px solid var(--grid-major);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.site-footer nav {
  display: flex;
  gap: 1.5rem;
}
.site-footer a {
  color: var(--ink-muted);
}

/* ---- Legal pages ----------------------------------------------------- */

.legal {
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}
.legal h1 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.05;
}
.legal h2 {
  margin: 2.25rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
}
.legal p,
.legal ul {
  max-width: var(--measure);
}
.legal address {
  font-style: normal;
}
