/* The LKM Corporation of Switzerland. Set on twelve columns in IBM Plex. */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  /* The mark's three tones. */
  --red: #da291c;
  --grey: #e4e4e4;
  --ink: #111111;

  /* Small red text keeps 4.5:1 contrast on the darker grounds. */
  --red-on-ink: #f05a4c;
  --red-on-tint: #c8261a;

  --paper: #ffffff;
  --tint: #f2f2f0;
  --muted: #5c5c5c;
  --rule-soft: #c9c9c9;

  --sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;

  --wrap: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 9vw, 7.5rem);
  --stripes: repeating-linear-gradient(to bottom, var(--red) 0 3px, transparent 3px 7px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--red);
}

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

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

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

address {
  font-style: normal;
}

/* Components set display; the hidden attribute must still win. */
[hidden] {
  display: none !important;
}

abbr[title] {
  text-decoration: none;
}

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

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

.skip:focus {
  top: 1rem;
}

/* Masthead: a red bar, the mark, and the section index. */

.masthead {
  border-top: 0.5rem solid var(--red);
  border-bottom: 1px solid var(--ink);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand__mark {
  width: 2.5rem;
  height: auto;
}

.brand__name {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.9375rem;
}

.nav a {
  text-decoration: none;
  padding-block: 0.25rem;
}

.nav a:hover {
  text-decoration: underline;
}

/* Hero: the name on the left, the mark on the right. */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 3rem;
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6.5rem) var(--section);
}

.hero__text {
  grid-column: 1 / span 6;
}

.hero__figure {
  grid-column: 7 / span 6;
}

.eyebrow,
.section-label,
.figno,
.year,
.division__de,
.products,
.explode,
.control,
.status,
.telex,
.contact__lines dt {
  font-family: var(--mono);
}

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.75rem, 6.4vw, 5.75rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.hero__lede {
  margin-top: 1.5rem;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 500;
  color: var(--red);
}

.hero__sub {
  max-width: 30rem;
  margin-top: 0.75rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.names {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
  font-size: 0.9375rem;
  color: var(--muted);
}

.mark {
  width: 100%;
  height: auto;
  overflow: visible;
}

.mark__parts {
  display: none;
}

.mark.is-split .mark__parts {
  display: inline;
}

.mark.is-split .mark__whole {
  display: none;
}

.mark__part {
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mark.is-ready {
  cursor: pointer;
}

.hero__figure figcaption {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.875rem;
  color: var(--muted);
}

.figno {
  margin-right: 0.5rem;
  font-weight: 500;
  color: var(--red);
}

.explode,
.control {
  display: block;
  margin-top: 1rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.explode:hover,
.explode[aria-pressed='true'],
.control:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Other controls around the page, added by discoveries.js. */

.control--on-ink {
  margin-top: 2rem;
  border-color: var(--paper);
  background: transparent;
  color: var(--paper);
}

.control--on-ink:hover {
  background: var(--paper);
  color: var(--ink);
}

.control[aria-disabled='true'] {
  border-color: var(--rule-soft);
  background: var(--paper);
  color: var(--muted);
  cursor: progress;
}

.status {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Live regions stay in place while empty; they just take no room. */

.status:empty {
  margin-top: 0;
}

.telex {
  padding-block: 0.5rem;
  border-block: 1px solid var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.telex:empty {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Section labels: a heavy rule, a red number, a mono title. */

.section-label {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 3px solid var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-label span {
  color: var(--red);
}

.section-intro {
  max-width: 38rem;
  margin-top: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

/* Divisions */

.divisions {
  padding-bottom: var(--section);
}

.division-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 3.5rem 1.5rem;
  margin-top: 3rem;
}

.division {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
}

.division img {
  width: 13rem;
  height: 9.75rem;
  margin-bottom: 0.5rem;
  object-fit: contain;
  object-position: left center;
}

.reversible {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.reversible img {
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reversible[aria-pressed='true'] img {
  transform: scaleX(-1);
}

.division > .discovery {
  align-self: flex-start;
}

.prefamulator.is-prefamulating img {
  animation: prefamulate 0.45s ease-in-out;
}

@keyframes prefamulate {
  45% { transform: translateY(0.5rem) scaleY(0.88); }
}

.instrument.is-calibrating img {
  animation: calibrate 0.6s ease-in-out;
}

@keyframes calibrate {
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.division .status:not(:empty) {
  display: block;
  margin-top: 0.75rem;
}

.dispatch-docket:not(:empty) {
  padding-block: 0.5rem;
  border-block: 1px solid var(--rule-soft);
  white-space: pre-line;
}

.division-panel {
  padding: 0.75rem;
  border: 1px solid var(--rule-soft);
  font: 0.8125rem/1.55 var(--mono);
}

.division-panel input[type='range'] {
  display: block;
  width: 100%;
  min-height: 2rem;
  margin: 0.75rem 0;
  accent-color: var(--red);
  cursor: ew-resize;
}

.coating {
  position: relative;
}

.coating img {
  transition: opacity 0.5s;
}

.coating-stamp {
  position: absolute;
  inset: 1.25rem 0.75rem 1.75rem;
  display: grid;
  place-content: center;
  border: 1px dashed var(--rule-soft);
  color: var(--red);
  font: 0.8125rem/1.8 var(--mono);
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
}

.coating[aria-pressed='true'] img {
  opacity: 0;
}

.coating[aria-pressed='true'] .coating-stamp {
  opacity: 1;
}

.thought-terminal {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.thought-terminal .status {
  color: var(--grey);
}

.thought-terminal__prompt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.thought-terminal input {
  min-width: 0;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--rule-soft);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  /* Keep text entry large enough to avoid focus zoom on phones. */
  font-size: 1rem;
}

.thought-terminal .control {
  margin: 0;
  padding: 0.5rem;
}

.division h3 {
  font-size: 1.375rem;
  line-height: 1.2;
}

.division__no {
  margin-right: 0.5rem;
  color: var(--red);
}

.division__de {
  margin-top: -0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.products {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
}

.products li {
  padding-block: 0.375rem;
  border-top: 1px solid var(--rule-soft);
}

.cta {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.625rem 1rem;
  background: var(--red);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
}

.cta:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Figures: the annual report's black page. */

.figures {
  position: relative;
  padding-block: calc(var(--section) * 0.75);
  background: var(--ink);
  color: var(--paper);
}

.figures::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1.75rem;
  background: var(--stripes);
}

.figures .section-label {
  border-top-color: var(--paper);
}

.figures .section-label span {
  color: var(--red-on-ink);
}

.figures__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
  margin-top: 2.5rem;
}

.figures__list div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.5rem;
}

.figures__list dd {
  font-size: clamp(2.25rem, 4.6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.figures__list dd abbr {
  font-size: 0.45em;
  letter-spacing: 0;
}

.figures__list dt {
  font-size: 0.9375rem;
  color: #b8b8b8;
}

.figures__note {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: #b8b8b8;
}

/* History */

.history {
  padding-block: var(--section);
}

.timeline {
  margin-top: 2.5rem;
}

.timeline li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--rule-soft);
}

.year {
  grid-column: 1 / span 2;
  font-weight: 500;
  color: var(--red);
}

.timeline p {
  grid-column: 3 / span 7;
}

.timeline li.is-moving {
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.history .status:not(:empty) {
  margin-top: 0.75rem;
}

/* Principles */

.principles {
  padding-block: var(--section);
  background: var(--tint);
}

.principles .section-label span {
  color: var(--red-on-tint);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
  margin-top: 2.5rem;
  counter-reset: principle;
}

.principle-list li {
  counter-increment: principle;
}

.principle-list li::before {
  content: counter(principle);
  display: block;
  margin-bottom: 1rem;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
}

.principle-list h3 {
  font-size: 1.375rem;
  line-height: 1.2;
}

.principle-list p {
  margin-top: 0.5rem;
}

/* Careers and contact */

.closing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3.5rem 1.5rem;
  padding-block: var(--section);
}

.careers p,
.contact address,
.contact__lines,
.contact > p {
  max-width: 32rem;
  margin-top: 1.25rem;
}

.contact address {
  font-weight: 500;
}

.contact__lines div {
  display: flex;
  gap: 1rem;
}

.contact__lines dt {
  min-width: 6rem;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--muted);
  text-transform: uppercase;
}

/* Footer */

.footer {
  position: relative;
  padding-block: 3.5rem 3rem;
  background: var(--ink);
  color: #c8c8c8;
  font-size: 0.875rem;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1.75rem;
  background: var(--stripes);
}

.footer__inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.footer__mark {
  /* The mark's black faces need a white ground on the black footer. */
  flex: none;
  width: 4rem;
  height: auto;
  padding: 0.5rem;
  background: var(--paper);
}

.footer p + p {
  margin-top: 0.5rem;
}

.footer a {
  color: var(--paper);
}

.restatable,
.discovery {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.discovery:hover {
  text-decoration: underline;
}

.restatable:hover {
  color: var(--paper);
  text-decoration: underline;
}

/* The internal memo keeps the annual report's paper, ink and hard rules. */

.memorandum {
  width: min(36rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100% - 2 * var(--gutter));
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.memorandum::backdrop {
  background: rgb(17 17 17 / 65%);
}

.memorandum h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}

.memorandum > :not(:first-child):not(:empty) {
  margin-top: 1.25rem;
}

/* Narrower screens: the grid collapses column by column. */

@media (max-width: 60rem) {
  .hero__text,
  .hero__figure {
    grid-column: 1 / -1;
  }

  .hero__figure {
    max-width: 34rem;
  }

  .figures__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principle-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline p {
    grid-column: 3 / -1;
  }
}

@media (max-width: 40rem) {
  .closing {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.25rem;
  }

  .year,
  .timeline p {
    grid-column: 1;
  }

  .footer__inner {
    flex-direction: column;
  }
}

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

  .mark__part,
  .reversible img,
  .coating img,
  .timeline li.is-moving {
    transition: none;
  }

  .instrument.is-calibrating img,
  .prefamulator.is-prefamulating img {
    animation: none;
  }
}

/* Not found */

.missing {
  padding-block: clamp(4rem, 12vw, 9rem);
}

.missing__text {
  max-width: 34rem;
  margin-block: 1.5rem 2rem;
  font-size: 1.25rem;
}
