/* Source Serif 4 and IBM Plex Sans, self-hosted (SIL Open Font License, fonts/OFL-*.txt). */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-opsz-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

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

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

:root {
  --paper: #f6f4ef;
  --paper-2: #ebe7de;
  --ink: #17191e;
  --muted: #5c606b;
  --rule: #d8d4cb;
  --accent: #2b4a8b;
  --edge: #17191e;
  /* the layers: the base (confirmed facts) in the accent, the work in a tint, what it changed in paper */
  --base-t: #2b4a8b; --base-l: #1f3768; --base-r: #17294f;
  --work-t: #c9d3e6; --work-l: #a9b6cf; --work-r: #8f9cb6;
  --change-t: #fbfaf6; --change-l: #d8d4cb; --change-r: #c4bfb3;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151513;
    --paper-2: #1e1e1b;
    --ink: #ecebe6;
    --muted: #a3a199;
    --rule: #34332f;
    --accent: #9fb7ec;
    --edge: #8a887f;
    --base-t: #5f7fc8; --base-l: #4a68ad; --base-r: #3a5591;
    --work-t: #3a4560; --work-l: #2c3550; --work-r: #232a40;
    --change-t: #2e2d29; --change-l: #3a3934; --change-r: #33322d;
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0 auto;
  max-width: 72rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 5vw, 64px);
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
main a, .doc a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

/* The bar: name left, contact right */

.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding: 2rem 0 1.25rem;
}

.wordmark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; text-decoration: none; }

/* The mark and the hero drawing share the slab classes. */
.mark { width: 26px; height: 26px; }
.base-t { fill: var(--base-t); } .base-l { fill: var(--base-l); } .base-r { fill: var(--base-r); }
.work-t { fill: var(--work-t); } .work-l { fill: var(--work-l); } .work-r { fill: var(--work-r); }
.change-t { fill: var(--change-t); } .change-l { fill: var(--change-l); } .change-r { fill: var(--change-r); }
.mark polygon, .layers polygon { stroke: var(--edge); stroke-linejoin: round; }
.mark polygon { stroke-width: .8; }
.layers polygon { stroke-width: 1.4; }
.bar-contact { color: var(--muted); text-decoration: none; }
.bar-contact:hover { color: var(--ink); }

main { flex: 1; }

/* Home: the words on the left, the layers on the right */

.home {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 9vh, 6rem) 0 clamp(3rem, 8vh, 5rem);
}

.home h1 {
  margin: 0 0 1.5rem;
  text-wrap: balance;
  font: 400 clamp(2.5rem, 4.6vw, 4.1rem)/1.05 var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -.015em;
}

.statement {
  max-width: 34rem;
  margin: 0;
  font: 400 clamp(1.2rem, 1.9vw, 1.42rem)/1.5 var(--serif);
  font-optical-sizing: auto;
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
  text-wrap: pretty;
}

.layers { width: 100%; height: auto; max-width: 30rem; justify-self: end; overflow: visible; }
.layers .lead { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.layers .label { fill: var(--muted); font: 400 18px var(--sans); }
.layers .label-base { fill: var(--ink); font-weight: 500; }

/* The band: a tinted strip the width of the window, two labelled columns */

.band {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding: 4rem 0;
  background: var(--paper-2);
  box-shadow: 0 0 0 100vmax var(--paper-2);
  clip-path: inset(0 -100vmax);
}

.band p { margin: 0; max-width: 36rem; }
.band .first-label { margin: 0 0 .4rem; color: var(--accent); font: 500 1rem/1.4 var(--sans); }
.contact a { font-size: 1.1rem; }

/* the band meets the footer without a seam */
main:has(.band) + .foot { border-top: 0; padding-top: 1.75rem; }

@media (max-width: 52rem) {
  .home { grid-template-columns: 1fr; }
  .layers { justify-self: start; max-width: 26rem; }
  .band { grid-template-columns: 1fr; padding: 3rem 0; }
}

/* Phones: the email is in the band, and the drawing's labels stay readable */
@media (max-width: 34rem) {
  .bar-contact { display: none; }
  .layers .label { font-size: 23px; }
}

/* Privacy and terms */

.doc {
  max-width: 40rem;
  padding: clamp(3rem, 8vh, 5rem) 0 3rem;
}

.doc h1 {
  margin: 0 0 .4rem;
  font: 400 clamp(2.2rem, 5vw, 3.2rem)/1.1 var(--serif);
  letter-spacing: -.01em;
}

.doc .effective { margin: 0 0 1rem; color: var(--muted); }
.doc h2 { margin: 2.4rem 0 .4rem; font: 600 1.2rem/1.3 var(--serif); }
.doc li { margin: .35rem 0; }
.doc strong { font-weight: 500; }

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .9rem;
}

.foot nav { display: flex; gap: 1.5rem; }
.foot a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); }
.foot a:hover { text-decoration-color: currentColor; }
.doc .lead-line { margin: 0 0 .3rem; font-size: 1.1rem; color: color-mix(in srgb, var(--ink) 78%, var(--paper)); }
.doc strong { font-weight: 600; }
