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

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

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

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

/* ─── palette ───────────────────────────────────────────────── */
:root {
  --ground: #F1F3F3;
  --ink: #10161A;
  --soft: #454E54;
  --faint: #656D72;
  --hair: rgba(16, 22, 26, 0.15);
  --grid: rgba(16, 22, 26, 0.045);
  --panel: #FAFBFB;
  --accent: #BF4218;

  /* read by the canvases */
  --panel-solid: #FAFBFB;
  --ink-rgb: 16, 22, 26;
  --accent-rgb: 191, 66, 24;

  /* the figure cycles through these, one per pass */
  --c1-rgb: 191, 66, 24;
  --c2-rgb: 30, 110, 102;
  --c3-rgb: 52, 71, 158;
  --c4-rgb: 125, 95, 16;
  --c5-rgb: 126, 52, 98;

  --gutter: clamp(1.25rem, 4vw, 3.25rem);
  --mono: 'Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0D1113;
    --ink: #E6EAEA;
    --soft: #A7B0B4;
    --faint: #7C868B;
    --hair: rgba(230, 234, 234, 0.17);
    --grid: rgba(230, 234, 234, 0.05);
    --panel: #14191B;
    --accent: #E86A3C;
    --panel-solid: #14191B;
    --ink-rgb: 230, 234, 234;
    --accent-rgb: 232, 106, 60;

    --c1-rgb: 232, 106, 60;
    --c2-rgb: 111, 191, 176;
    --c3-rgb: 138, 156, 240;
    --c4-rgb: 213, 167, 60;
    --c5-rgb: 213, 136, 182;
  }
}

/* ─── base: the page is drafting paper ──────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-color: var(--ground);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 38px 38px;
  background-position: center top;
}

::selection {
  background: rgba(var(--accent-rgb), 0.2);
}

.sheet {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(1rem, 2.5vh, 1.6rem);
  display: flex;
  flex-direction: column;
}

/* ─── sheet header ──────────────────────────────────────────── */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding: clamp(1.1rem, 3.5vh, 2rem) 0 0.85rem;
  border-bottom: 1px solid var(--hair);
}

.id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* the iceberg: two inked versions of the same artwork, picked by theme */
.id>picture {
  flex: none;
  display: block;
  line-height: 0
}

.mark {
  display: block;
  height: 38px;
  width: auto
}

.wordmark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.tag i {
  font-style: normal;
  opacity: 0.55;
  margin: 0 0.15em;
}

/* ─── the intro, and nothing else ───────────────────────────── */
.intro {
  padding: clamp(2.4rem, 8vh, 5rem) 0 clamp(2rem, 6vh, 3.6rem);
  max-width: 46rem;
}

.intro h1 {
  font-size: clamp(1.72rem, 4.3vw, 3rem);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.023em;
  max-width: 30ch;
  text-wrap: balance;
}

.intro p {
  margin-top: clamp(1rem, 2.4vh, 1.5rem);
  max-width: 52ch;
  font-size: clamp(0.95rem, 1.5vw, 1.06rem);
  line-height: 1.62;
  color: var(--soft);
}

.intro p a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.28s ease;
}

.intro p a:hover,
.intro p a:focus-visible {
  color: var(--accent);
}

/* ─── figure: structure → behavior ──────────────────────────── */
.figure {
  flex: 1 1 auto;
  min-height: 210px;
  display: flex;
  align-items: stretch;
  gap: clamp(0.5rem, 1.4vw, 1rem);
}

.panel {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel figcaption {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 0.5rem;
}

.frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 170px;
  background: var(--panel);
  border: 1px solid var(--hair);
}

.frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%
}

.joint {
  flex: 0 0 clamp(28px, 4vw, 52px);
  align-self: center;
  color: var(--hair);
  display: flex;
  align-items: center;
}

.joint svg {
  width: 100%;
  height: 9px;
  color: var(--faint);
  opacity: 0.75
}

.axiom {
  padding-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}

/* ─── sheet footer ──────────────────────────────────────────── */
.bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  margin-top: clamp(1rem, 3vh, 1.9rem);
  padding-top: 0.85rem;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.bottom a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
}

.bottom a:last-child {
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 0.7rem
}

.bottom a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

.bottom a:hover,
.bottom a:focus-visible {
  color: var(--accent)
}

.bottom a:hover::after,
.bottom a:focus-visible::after {
  transform: scaleX(1)
}

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

/* ─── narrow: stack the two panels, turn the arrow ──────────── */
@media (max-width: 700px) {
  .figure {
    flex-direction: column;
    min-height: 0;
    gap: 0.45rem
  }

  .frame {
    min-height: 132px
  }

  .joint {
    flex: 0 0 auto;
    align-self: center;
    padding: 0.3rem 0;
    width: 26px;
    transform: rotate(90deg);
  }

  .panel figcaption {
    padding-bottom: 0.35rem
  }

  .intro {
    padding: clamp(1.1rem, 3.5vh, 2rem) 0 clamp(1.1rem, 3vh, 1.8rem)
  }

  .intro h1 {
    max-width: 22ch
  }

  .axiom {
    padding-top: 0.6rem
  }

  .bottom {
    margin-top: clamp(0.7rem, 2vh, 1.1rem)
  }
}

@media (max-width: 430px) {
  .top {
    padding-top: 1rem
  }

  .wordmark {
    font-size: 0.8rem;
    letter-spacing: 0.14em
  }

  .tag {
    font-size: 0.62rem
  }

  .mark {
    height: 30px
  }
}