@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f3f0ea;
  --paper-2: #e7e2d9;
  --sheet: #fbf9f5;
  --ink: #141311;
  --muted: #5e584f;
  --line: rgba(20, 19, 17, 0.12);
  --signal: #0e7480;
  --night: #14161c;
  --night-2: #1d2028;
  --sand: #e4d3a2;
  --mist: #d5e1db;
  --lilac: #d8d2e6;
  --shadow: 0 18px 40px rgba(20, 19, 17, 0.08);
  --serif: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: 88px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 255, 255, 0.7), transparent 60%),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("../img/noise.png");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

::selection { background: #c5ebe8; color: var(--ink); }

img { max-width: 100%; height: auto; }

a { color: inherit; }

p { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  z-index: 50;
}

.skip:focus { top: 0.8rem; }

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.nav-toggle:focus-visible + .bar .burger {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.bar {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.links {
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
}

.links a:hover,
.links a[aria-current="page"] {
  color: var(--ink);
}

.links a[aria-current="page"] {
  box-shadow: inset 0 -1px 0 var(--ink);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.wordmark__mark {
  width: 28px;
  height: 28px;
  display: block;
}

.wordmark__name {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.wordmark__name em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.bar__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: #2c2a27; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn--ghost:hover { background: rgba(20, 19, 17, 0.04); }

.hero {
  padding: 4.5rem 0 1rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.hero h1 {
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.hero h1 em {
  font-style: italic;
  display: inline-block;
}

.lede {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
}

.lede + .lede {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.folders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  padding: 3.2rem 0 1rem;
}

.folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding-top: 16px;
}

.folder__card {
  width: 100%;
  min-height: 210px;
  border-radius: 8px 22px 18px 18px;
  background: var(--folder);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    var(--shadow);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.3rem 0.8rem 1.35rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.folder__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: -16px;
  width: 46%;
  height: 22px;
  border-radius: 12px 12px 0 0;
  background: color-mix(in srgb, var(--folder) 82%, #8d8270);
}

.folder:hover .folder__card {
  transform: translateY(-6px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 24px 50px rgba(20, 19, 17, 0.12);
}

.folder--sand { --folder: var(--sand); }
.folder--mist { --folder: var(--mist); }
.folder--lilac { --folder: var(--lilac); }

.folder__card img {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 8px 14px rgba(20, 19, 17, 0.16));
}

.folder h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0.95rem;
}

.folder p {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 26ch;
  margin-top: 0.25rem;
}

.note {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding-bottom: 3.5rem;
}

.section {
  padding: 4.5rem 0;
}

.section--rule {
  border-top: 1px solid var(--line);
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
  gap: 3.5rem;
  align-items: start;
}

.split h2,
.block h2,
.panel h2 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
}

.prose {
  display: grid;
  gap: 1rem;
  color: var(--muted);
}

.prose strong { color: var(--ink); font-weight: 600; }

.pull {
  margin: 0;
  padding: 3.5rem 0;
  border-block: 1px solid var(--line);
  text-align: center;
}

.pull blockquote {
  margin: 0 auto;
  max-width: 16ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.pull figcaption {
  max-width: 38rem;
  margin: 1.2rem auto 0;
  color: var(--muted);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem 1.4rem 1.3rem;
}

.card h3 {
  font-size: 1.7rem;
  margin-bottom: 0.9rem;
}

.card ul, .plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.card li, .plain-list li {
  padding-left: 1rem;
  position: relative;
  color: var(--muted);
}

.card li::before, .plain-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--signal);
  position: absolute;
  left: 0;
  top: 0.55em;
}

.card--night {
  background: var(--night);
  color: var(--paper);
  border-color: transparent;
}

.card--night h3 { color: var(--paper); }
.card--night li { color: rgba(246, 243, 237, 0.78); }
.card--night li::before { background: #8fd4dc; }

.mirror {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
}

.mirror article {
  border-radius: 22px;
  padding: 1.6rem 1.5rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.mirror article:last-child {
  background: var(--night);
  color: var(--paper);
  border-color: transparent;
}

.mirror h3 {
  font-size: 2rem;
  margin: 0.35rem 0 1rem;
}

.mirror a { color: inherit; }

.mirror dl {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.mirror dt {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
}

.mirror dd { margin: 0.15rem 0 0; }

.scenes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.scene h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0.85rem;
}

.scene p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.frame {
  height: 230px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--sheet);
  position: relative;
  overflow: hidden;
  padding: 14px;
}

.frame img {
  position: absolute;
  height: 36px;
  width: auto;
  filter: drop-shadow(0 6px 10px rgba(20, 19, 17, 0.12));
}

.chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
}

.chrome i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #ddd6cc;
  display: block;
}

.chrome span {
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.bars { margin-top: 22px; display: grid; gap: 8px; }
.bars b {
  display: block;
  height: 10px;
  border-radius: 99px;
  background: #ece7df;
}
.bars b:nth-child(1) { width: 72%; height: 16px; background: #e3ddd3; }
.bars b:nth-child(2) { width: 92%; }
.bars b:nth-child(3) { width: 81%; }
.frame--site img { right: 16px; bottom: 16px; }

.frame--repo {
  background: var(--night);
  border-color: transparent;
  color: #d9d3c8;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.7;
}

.frame--repo .path { color: #8fd4dc; }
.frame--repo img { left: 16px; bottom: 16px; }

.frame--app {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, #efeae2, #e4ddd2);
}

.phone {
  width: 112px;
  height: 180px;
  border-radius: 18px;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px 12px;
  position: relative;
}

.phone b {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #ece7df;
  margin-bottom: 7px;
}

.phone img {
  position: absolute;
  width: 86px;
  height: auto;
  left: 12px;
  bottom: 14px;
}

.frame--essay { padding: 22px 26px; }
.frame--essay .drop {
  float: left;
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 0.8;
  padding-right: 8px;
}
.frame--essay p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.frame--essay img { right: 16px; bottom: 14px; }

.frame--deck {
  background: var(--night);
  color: var(--paper);
  border-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.frame--deck strong {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.frame--deck img { position: static; height: 32px; }

.frame--cover {
  background:
    linear-gradient(145deg, var(--lilac), var(--sand) 70%);
  border-color: transparent;
}
.frame--cover span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}
.frame--cover img { right: 14px; bottom: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}

.step {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.step em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.code {
  margin-top: 1.2rem;
  background: var(--night);
  color: #efeae2;
  border-radius: 18px;
  padding: 1rem 1rem 1.1rem;
  position: relative;
}

.code pre {
  margin: 0;
  overflow: auto;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.code .btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: #2a2d36;
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}

.page-hero {
  padding: 3.6rem 0 1rem;
}

.page-hero h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  max-width: 12ch;
}

.page-hero .lede { margin-left: 0; }

.badge-set {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.5rem 2rem;
  padding: 2.4rem 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.badge-set h2 {
  font-size: clamp(2.1rem, 3.5vw, 3rem);
  margin: 0.2rem 0 0.55rem;
}

.swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.swatch {
  margin: 0;
  border-radius: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
}

.swatch--sheet { background: var(--sheet); }
.swatch--night { background: var(--night); border-color: transparent; }

.swatch img { height: 48px; width: auto; }

.swatch a {
  font-size: 0.8rem;
  color: var(--muted);
}

.swatch--night a { color: rgba(246, 243, 237, 0.7); }

.rule-list {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.rule-list article {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.rule-list h3 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 2.6rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
}

.site-footer nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.colophon {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36rem;
}

.footer-badge {
  display: inline-block;
  margin-top: 0.9rem;
}

.footer-badge img { height: 40px; width: auto; }

@media (max-width: 980px) {
  .bar {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
  }

  .burger { display: inline-flex; }

  .wordmark {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .bar__end {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .bar__end .btn { display: none; }

  .links {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.15rem 0 0.95rem;
  }

  .site-header:has(.nav-toggle:checked) .links { display: flex; }

  .site-header:has(.nav-toggle:checked) .burger {
    background: var(--ink);
  }

  .site-header:has(.nav-toggle:checked) .burger span {
    background: var(--paper);
  }

  .folders,
  .scenes,
  .steps,
  .pair,
  .mirror,
  .split,
  .badge-set,
  .swatches,
  .rule-list article,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero { padding-top: 2.8rem; }

  .hero h1 { font-size: clamp(3rem, 14vw, 4.4rem); }

  .folder__card { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .folder__card { transition: none; }
}
