:root {
  --bg: #181a0f;
  --raise: #26271b;
  --ink: #f3f3ec;
  --muted: #c3c6b3;
  --accent: #66d322;
  --accent-ink: #142006;
  --stamp: #e2523c;
  --paper: #edeade;
  --paper-ink: #1c1e12;
  --line: #3e4030;
  --line-strong: #5c6048;
  --wood: #6e5b38;
  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", system-ui, sans-serif;
  --measure: 68ch;
  --header: 4.5rem;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 42% 36% at 12% -8%, hsl(97 40% 28% / 0.22), transparent 70%),
    radial-gradient(ellipse 36% 28% at 110% 8%, hsl(8 60% 32% / 0.16), transparent 68%);
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

img, svg, video, canvas { max-width: 100%; }

svg { height: auto; }

h1, h2, h3, p { overflow-wrap: anywhere; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 { font-weight: 700; margin: 0 0 0.4em; }

h2 {
  font-size: clamp(1.8rem, 4vw, 3.15rem);
  margin: 0 0 0.35em;
}

h3 {
  font-size: 1.35rem;
  margin: 0 0 0.35em;
}

p { margin: 0 0 0.9em; }

a { color: var(--accent); }

a:visited { color: var(--accent); }

:focus { outline: none; }

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

.skip {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  top: -120px;
  z-index: 80;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 14px;
}

.skip:focus { top: calc(8px + env(safe-area-inset-top)); }

.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.measure { max-width: var(--measure); }

.kicker {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.dek {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.05rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: #181a0f;
  border-bottom: 1px solid var(--line);
}

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: var(--header);
  padding-block: 8px;
  background: #181a0f;
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  max-width: calc(100% - 60px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html.js .nav-toggle { display: inline-flex; }

.bars,
.bars::before,
.bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.bars::before,
.bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.bars::before { top: -6px; }
.bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .bars { background: transparent; }

.nav-toggle[aria-expanded="true"] .bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

#site-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-basis: 100%;
}

#site-menu a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 4px 2px;
}

#site-menu a[aria-current="page"] { color: var(--accent); }

#site-menu a:hover,
#site-menu a:focus-visible,
#site-menu a:active { color: var(--accent); }

html.js #site-menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  flex-basis: auto;
  background: #181a0f;
  padding: calc(var(--header) + env(safe-area-inset-top) + 12px) max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
}

html.js .nav-toggle[aria-expanded="true"] + #site-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

html.js .nav-toggle[aria-expanded="true"] + #site-menu a {
  font-size: 1.35rem;
  font-family: var(--display);
  border-bottom: 1px solid var(--line);
}

html.nav-open,
html.nav-open body { overflow: hidden; }

.hero {
  min-height: calc(100svh - var(--header));
  min-height: calc(100dvh - var(--header));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 28px;
  padding-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  overflow-wrap: anywhere;
  line-height: 0.96;
  max-width: 11ch;
}

.lead {
  font-size: 1.0625rem;
  max-width: 62ch;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1.1rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1 var(--body);
  text-decoration: none;
  text-align: center;
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px var(--accent-ink);
  cursor: pointer;
}

.btn:visited { color: var(--accent-ink); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 3px var(--line-strong);
}

.btn-secondary:visited { color: var(--ink); }

.btn:hover,
.btn:focus-visible,
.btn:active { transform: translateY(-2px); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.chips li {
  border: 1px solid var(--line-strong);
  background: var(--raise);
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 600;
}

.hero-art {
  position: relative;
  margin-top: 8px;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 6% 4%;
  background: radial-gradient(ellipse at 50% 42%, hsl(97 48% 32% / 0.34), transparent 68%);
  pointer-events: none;
}

.hero-art svg {
  position: relative;
  width: 100%;
  display: block;
}

.stamp-tool {
  transform: translateY(-48px);
  animation: strike 4.4s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
  will-change: transform;
}

.ink {
  opacity: 0.85;
  animation: blot 4.4s ease-in-out infinite;
  will-change: opacity;
}

.carbon-sheet {
  transform: translate(12px, 14px);
  animation: drift 8s ease-in-out infinite;
  will-change: transform;
}

@keyframes strike {
  0%, 22% { transform: translateY(-48px); }
  46%, 64% { transform: translateY(0); }
  100% { transform: translateY(-48px); }
}

@keyframes blot {
  0%, 30% { opacity: 0.72; }
  50%, 70% { opacity: 1; }
  100% { opacity: 0.72; }
}

@keyframes drift {
  0%, 100% { transform: translate(12px, 14px); }
  50% { transform: translate(22px, 22px); }
}

.section { padding-block: 64px; }

.section + .section { border-top: 1px solid var(--line); }

.tray-grid,
.card-grid,
.bento,
.tally,
.clerk,
.route,
.slip,
.desk {
  display: grid;
  gap: 16px;
}

.tray-card,
.cell,
.plain-card,
.chat,
.identity {
  background: var(--raise);
  border: 1px solid var(--line);
  padding: 16px;
}

.folder {
  background: #323428;
  min-height: 230px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.folder-tab {
  align-self: flex-start;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--display);
  font-weight: 700;
  padding: 4px 12px;
}

.folder-sheet {
  flex: 1;
  background: var(--paper);
  min-height: 160px;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.rules {
  display: grid;
  gap: 8px;
}

.rules span {
  display: block;
  height: 2px;
  background: #d4cfc0;
}

.rules span:nth-child(3) { width: 72%; }

.mini-stamp {
  width: 84px;
  height: 84px;
  align-self: flex-end;
}

.tray-copy h3 { margin-top: 14px; }

.slip-head .seal {
  width: min(100%, 280px);
  display: block;
  margin-bottom: 16px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 72px;
  margin-bottom: 22px;
  min-height: 56px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  border: 2px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  font-family: var(--display);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.cell .icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.route-art svg,
.doc-seal svg { width: 100%; display: block; }

.band {
  background: var(--raise);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band.section + .section { border-top: 0; }

.stat {
  margin: 0;
  padding: 18px 8px;
  border-top: 2px solid var(--accent);
  min-height: 140px;
}

.stat span {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.chat {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 18px 16px 16px;
}

.chat-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 600;
}

.stamp-label {
  border: 2px solid var(--stamp);
  color: var(--stamp);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
}

.bubble {
  margin: 0 0 10px;
  padding: 12px 12px 10px;
  background: #f7f6f0;
  border-left: 4px solid #8a8f72;
}

.bubble.clerk {
  border-left-color: var(--stamp);
  background: #f3efe4;
}

.bubble b { display: block; margin-bottom: 4px; }

.desk-sheet {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 28px 20px 24px;
}

.desk-sheet h2,
.desk-sheet .desk-name {
  color: var(--paper-ink);
}

.desk-sheet .kicker { color: #145208; }

.desk-sheet a:not(.btn) { color: #145208; }

.desk-sheet .btn { color: var(--accent-ink); }

.brand {
  margin: 0 0 0.35em;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.desk-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.4em;
}

.desk-sheet p { max-width: var(--measure); }

.chat .stamp-label {
  color: #8d2618;
  border-color: #8d2618;
}

.desk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 1rem;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 36px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  gap: 18px;
}

.footer-grid nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-grid a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer-grid a:hover,
.footer-grid a:focus-visible,
.footer-grid a:active { color: var(--accent); }

.doc-hero { padding-top: 36px; padding-bottom: 12px; }

.doc-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  overflow-wrap: anywhere;
}

.effective {
  display: inline-block;
  margin: 0;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  padding: 4px 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.doc-seal { width: min(100%, 240px); }

.doc-layout {
  display: grid;
  gap: 8px;
  padding-bottom: 72px;
}

.toc { display: none; }

.toc ol,
.toc-fold ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a,
.toc-fold a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.toc a:hover,
.toc a:focus-visible,
.toc a:active,
.toc-fold a:hover,
.toc-fold a:focus-visible,
.toc-fold a:active { color: var(--accent); }

.toc-fold {
  border: 1px solid var(--line);
  background: var(--raise);
  padding: 4px 14px 8px;
  margin-bottom: 18px;
}

.toc-fold summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.article h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-top: 1.6em;
  scroll-margin-top: 96px;
}

.article p,
.article li { max-width: var(--measure); }

.article ul { padding-left: 1.15rem; }

.identity {
  padding: 18px 16px;
  margin-bottom: 16px;
}

.identity .desk-name { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.slip-form {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 20px 16px 18px;
}

.slip-form h2 { color: var(--paper-ink); margin-top: 0; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font: 400 16px/1.5 var(--body);
  color: var(--paper-ink);
  background: #f7f6f0;
  border: 1px solid #c9c4b4;
  padding: 12px 12px;
  border-radius: 0;
}

.field textarea { min-height: 150px; resize: vertical; }

.form-status { min-height: 1.5em; font-weight: 600; }

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

html.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (min-width: 640px) {
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn,
  .slip-form .btn { width: auto; }
  .tray-grid,
  .card-grid,
  .bento,
  .tally { grid-template-columns: 1fr 1fr; }
  .hero h1 { max-width: 12ch; }
}

@media (min-width: 900px) {
  .nav-toggle,
  html.js .nav-toggle { display: none; }

  .bar { flex-wrap: nowrap; }

  #site-menu,
  html.js #site-menu,
  html.js .nav-toggle[aria-expanded="true"] + #site-menu {
    position: static;
    inset: auto;
    flex-basis: auto;
    flex-direction: row;
    align-items: center;
    gap: 4px 8px;
    width: auto;
    background: transparent;
    padding: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  html.js .nav-toggle[aria-expanded="true"] + #site-menu a,
  #site-menu a {
    font-size: 1rem;
    font-family: var(--body);
    border-bottom: 0;
    padding: 6px 10px;
  }

  .hero {
    display: block;
    padding-top: 18px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    min-height: calc(100svh - var(--header) - 36px);
    min-height: calc(100dvh - var(--header) - 36px);
  }

  .hero-art { margin-top: 0; }

  .section { padding-block: 96px; }

  .slip,
  .route,
  .clerk,
  .desk {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 40px;
    align-items: center;
  }

  .slip { align-items: start; }

  .slip-head {
    position: sticky;
    top: 104px;
  }

  .bento { grid-template-columns: repeat(3, 1fr); }

  .tally { grid-template-columns: repeat(4, 1fr); gap: 22px; }

  .card-grid { grid-template-columns: repeat(3, 1fr); }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr auto;
    align-items: start;
  }

  .doc-hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    align-items: center;
    gap: 24px;
  }

  .doc-seal { width: 100%; justify-self: end; }

  .doc-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  .toc {
    display: block;
    position: sticky;
    top: 104px;
  }

  .toc-fold { display: none; }

  .contact-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 28px;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .hero-grid { gap: 48px; }
  .section { padding-block: 108px; }
}

.band.section { padding-block: 48px; }

@media (min-width: 900px) {
  .band.section { padding-block: 64px; }
}

@media (max-height: 500px) and (max-width: 899px) {
  .hero,
  .hero-grid { min-height: 0; }
  .hero { padding-top: 16px; }
  .hero h1 { font-size: 2rem; }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .stamp-tool { transform: none; }
  .ink { opacity: 1; }
  .carbon-sheet { transform: translate(14px, 16px); }
  html.js .reveal { opacity: 1; transform: none; }
}
