@font-face { font-family: "Geist"; src: url("fonts/geist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #F4F4F4;
  --white: #FFFFFF;
  --ink: #0A0A0A;
  --mid: #5F5F5F;
  --mid-on-ink: #A8A8A8;
  --line: rgba(10, 10, 10, 0.2);
  --line-on-ink: rgba(255, 255, 255, 0.2);
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink) var(--bg); scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--bg); }
.close ::selection { background: var(--bg); color: var(--ink); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.close :focus-visible, .row.dark :focus-visible { outline-color: var(--white); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 200; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; }
.skip:focus { top: 0.75rem; }

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

/* type */
h1, h2, h3 { font-weight: 500; letter-spacing: -0.035em; line-height: 0.95; text-transform: uppercase; }
.btn, .lnk, .sub, .bar-s, .foot { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.02em; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; justify-content: space-between; align-items: center; padding-block: 0.6rem; }
.mark { display: inline-block; padding-block: 0.3rem; color: var(--ink); line-height: 0; text-decoration: none; }
.mark svg { display: block; height: 2.25rem; width: auto; }
.hole { fill: var(--bg); }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.lnk { font-size: 0.8125rem; text-decoration: none; padding-block: 0.5rem; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1px no-repeat; transition: background-size 0.3s var(--ease); }
.lnk:hover { background-size: 100% 1px; }

/* buttons */
.btn {
  display: inline-block; font-size: 0.8125rem; font-weight: 500; line-height: 1;
  padding: 0.95em 1.4em; border: 1px solid var(--ink); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: transparent; color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }
.btn-paper { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn-paper:hover { background: transparent; color: var(--white); }
.btn:active { transform: translateY(1px); }

/* hero */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: clamp(3rem, 9vh, 6rem) clamp(2.5rem, 6vh, 4rem); }
.hero-mark { display: block; height: 5.5rem; width: auto; color: var(--ink); margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }
.hero h1 { font-size: clamp(2.25rem, 9.2vw, 6rem); letter-spacing: -0.04em; line-height: 0.92; }
.ln { display: block; padding-bottom: 0.06em; }
.close .ln { overflow: hidden; }
.close .ln > span { display: block; }
.sub { font-size: clamp(0.875rem, 1.6vw, 1.25rem); color: var(--mid); margin-top: clamp(1rem, 2.4vh, 1.5rem); }
.act { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: clamp(1.75rem, 4.5vh, 2.75rem); }
.cap { font-size: 0.9375rem; color: var(--mid); margin-top: 1.5rem; max-width: 34em; line-height: 1.6; }

/* the system frame: a live diagram of a service holding under failure */
.frame { border: 1px solid var(--line); background: var(--bg); }
.sys { display: block; width: 100%; height: auto; aspect-ratio: 2.6 / 1; }
.bar-s { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem clamp(14px, 1.6vw, 24px); border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--mid); }

/* statement */
.statement { padding-block: clamp(4rem, 11vw, 9rem) clamp(3rem, 7vw, 6rem); }
.big { font-size: clamp(1.5rem, 3.4vw, 2.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; max-width: 24em; text-wrap: balance; }
.small { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--mid); max-width: 32em; margin-top: 1.75rem; line-height: 1.45; }

/* section headings */
.h2 { font-size: clamp(2rem, 5.2vw, 4.25rem); text-wrap: balance; max-width: 14em; }
#practices, #how { padding-block: clamp(3rem, 7vw, 6rem) 0; }
#how { padding-bottom: clamp(4rem, 9vw, 8rem); }

/* practices: ruled rows */
.rows { --rp: clamp(10px, 1.4vw, 20px); list-style: none; margin-top: clamp(2rem, 5vw, 4rem); }
.row {
  position: relative; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  padding: 1.6rem var(--rp);
  transition: background-color 0.2s;
}
.row::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }
.row:last-child::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.row:hover { background: var(--white); }
.row h3 { grid-column: 1 / 6; font-size: clamp(1.25rem, 2.2vw, 1.875rem); line-height: 1; text-wrap: balance; }
.row p { grid-column: 6 / 13; color: var(--mid); font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.5; max-width: 34em; }
.row.dark, .row.dark:hover { background: var(--ink); color: var(--white); }
.row.dark p { color: var(--mid-on-ink); }
.row.dark::before { background: var(--ink); }

/* how we work: three ruled columns */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.cols3 article { display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem clamp(14px, 2.4vw, 36px) 2rem 0; min-height: 22rem; }
.cols3 article + article { padding-left: clamp(14px, 2.4vw, 36px); border-left: 1px solid var(--line); }
.cols3 h3 { font-size: clamp(1.25rem, 2.2vw, 1.875rem); line-height: 1; }
.cols3 p { color: var(--mid); font-size: clamp(1rem, 1.25vw, 1.125rem); max-width: 26em; }
.cols3 .fact { margin-top: auto; padding-top: 1.5rem; color: var(--ink); font-weight: 500; font-size: 0.9375rem; line-height: 1.45; max-width: 26em; }

/* the close */
.close { background: var(--ink); color: var(--white); padding-block: clamp(5rem, 12vw, 10rem) 1.5rem; }
.close .h2 { font-size: clamp(2.5rem, 8vw, 6rem); letter-spacing: -0.04em; line-height: 0.92; max-width: none; }
.close .act { justify-content: flex-start; margin-top: clamp(2rem, 5vw, 3.5rem); }
.addr { font-size: 0.9375rem; color: var(--mid-on-ink); margin-top: 1.5rem; line-height: 1.6; }
.addr a { color: var(--white); display: inline-block; padding-block: 0.4rem; }
.foot { display: flex; justify-content: flex-end; margin-top: clamp(4rem, 10vw, 8rem); padding-top: 1.25rem; border-top: 1px solid var(--line-on-ink); font-size: 0.75rem; color: var(--mid-on-ink); }

@media (pointer: coarse) { .btn { padding-block: 1.25em; } .lnk { padding-block: 0.8rem; } }

/* narrow */
@media (max-width: 900px) {
  .row h3, .row p { grid-column: 1 / 13; }
  .row p { margin-top: 0.75rem; }
  .cols3 { grid-template-columns: 1fr; }
  .cols3 article, .cols3 article + article { min-height: 0; padding: 1.5rem 0 1.75rem; border-left: 0; }
  .cols3 article + article { border-top: 1px solid var(--line); }
  .cols3 .fact { margin-top: 0.75rem; }
}
@media (max-width: 640px) {
  .nav .lnk { display: none; }
  .sys { aspect-ratio: 0.85 / 1; }
  .mark svg { height: 2rem; }
  .hero-mark { height: 4.5rem; }
  .act .btn { flex: 1 1 100%; text-align: center; }
  .close .act .btn { flex: 1 1 100%; }
}

/* motion: factory-style hero staging. Mark spins in, letters scramble into place, buttons arrive last */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* letters being scrambled (script builds the .sc spans) */
.sc { display: inline-block; }
.sc.wait { visibility: hidden; }
.sc.on { color: transparent; position: relative; }
.sc.on::after { content: var(--sg); color: var(--ink); position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-family: var(--sgf, inherit); }

@media (prefers-reduced-motion: no-preference) {
  main { animation: page-in 0.5s ease-out both; }
  html.pre .hero-mark, html.pre .hero h1, html.pre .sub, html.pre .act, html.pre .cap, html.pre .frame { opacity: 0; }

  .mark:hover .slip, .mark:focus-visible .slip { animation: slip 0.7s var(--ease) both; }
  @keyframes slip { from { transform: translateY(-34px); } to { transform: translateY(0); } }

  /* ruled lines are drawn when their list arrives */
  .ready .rows:not(.in) .row::before { transform: scaleX(0); }
  .ready .rows .row::before { transition: transform 1.1s var(--ease) calc(var(--n) * 70ms); }
  .ready .cols3:not(.in) { border-top-color: transparent; }
  .ready .cols3:not(.in) article + article { border-left-color: transparent; }
  .ready .cols3 { transition: border-color 0.9s var(--ease); }
  .ready .cols3 article { transition: border-color 0.9s var(--ease) 0.3s; }
  .ready .close .ln > span { transform: translateY(105%); }
  .ready .close.in .ln > span { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--n) * 90ms); }
}
