.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(14, 15, 17, .97);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--cream); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--cream); }
.brand img { width: auto; height: calc(var(--header-h) - 20px); }
.brand .wordmark { font-size: 1.55rem; line-height: 1; padding-top: .15em; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.nav-toggle span:not(.visually-hidden) { display: block; height: 2px; background: var(--cream); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem var(--gutter) 2rem;
  background: var(--black);
  overflow-y: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s var(--ease), visibility 0s .3s;
}
.site-nav.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li + li { border-top: 1px dashed var(--line); }
.site-nav a:not(.btn) {
  display: block;
  padding: .7rem 0;
  font-family: var(--font-title);
  font-size: 1.9rem;
  letter-spacing: .03em;
  color: var(--cream);
  text-decoration: none;
}
.site-nav a[aria-current="page"]:not(.btn) { color: var(--amber); }

@media (min-width: 1080px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0;
    background: none;
    overflow: visible;
    transform: none;
    visibility: visible;
    transition: none;
  }
  .site-nav ul { display: flex; gap: .15rem; }
  .site-nav li + li { border: 0; }
  .site-nav a:not(.btn) {
    padding: .45rem .6rem;
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: 0;
    border-radius: var(--radius-sm);
  }
  .site-nav a:not(.btn):hover { background: var(--black-3); }
  .site-nav a[aria-current="page"]:not(.btn) { box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
}

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--cream);
  --btn-bd: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.25rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 2px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:hover { color: var(--btn-fg); border-color: var(--cream); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--amber); --btn-fg: var(--black); --btn-bd: var(--amber); }
.btn--primary:hover { --btn-bg: var(--amber-2); border-color: var(--amber-2); }
.btn--ghost { --btn-bd: var(--cream); }
.btn--ghost:hover { --btn-bg: var(--cream); --btn-fg: var(--black); }
.btn--danger { --btn-bg: var(--red); --btn-fg: var(--cream-2); --btn-bd: var(--red); }
.btn--sm { min-height: 40px; padding: .5rem .9rem; font-size: .92rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: "→"; transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.25rem;
  background: var(--black-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.card h3 { margin: 0; overflow-wrap: anywhere; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(h3 a):hover { border-color: var(--amber); }
.card p { margin: 0; color: var(--muted); }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; font-size: .85rem; color: var(--muted); }
.card__media { margin: -1.25rem -1.25rem .5rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--black-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card--paper { background: var(--cream) var(--paper); color: var(--ink); border-color: transparent; }
.card--paper p, .card--paper .card__meta { color: #4A4538; }

.grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  padding: 1.4rem 1.25rem 1.1rem;
  background: var(--kraft) var(--paper);
  color: var(--kraft-ink);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  box-shadow: 0 2px 0 #A88A52, var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  min-width: 0;
}
.file-card::before {
  content: "";
  position: absolute;
  left: 0; top: -22px;
  width: 46%;
  max-width: 190px;
  height: 23px;
  background: inherit;
  border-radius: var(--radius-sm) 14px 0 0;
  clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
}
.file-card__tab {
  position: absolute;
  left: 14px; top: -18px;
  font-family: var(--font-type);
  font-size: .85rem;
  letter-spacing: .06em;
  color: var(--kraft-ink);
}
.file-card h3 { margin: 0 0 .35rem; color: var(--ink); font-size: clamp(1.6rem, 5vw, 2rem); }
.file-card h3 a { color: inherit; text-decoration: none; }
.file-card h3 a::after { content: ""; position: absolute; inset: -22px 0 0; }
.file-card p { margin: 0 0 1rem; color: var(--kraft-ink); }
.file-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; }
.file-card__foot time { font-family: var(--font-type); }
.file-card:has(a):hover { transform: translateY(-3px) rotate(-.3deg); }
.file-card:has(a:focus-visible) { outline: 3px solid var(--amber); outline-offset: 4px; }
.file-card h3 a:focus-visible { outline: none; }
.file-card .stamp { position: absolute; right: 8px; top: -14px; font-size: 1.1rem; background: var(--kraft-2); mix-blend-mode: normal; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .6rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-type);
  font-size: .78rem;
  line-height: 1.4;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.badge--open { color: var(--amber); }
.badge--progress { color: var(--cream); }
.badge--closed { color: var(--red-text); }
.badge--plain::before { display: none; }
.file-card .badge, .card--paper .badge { color: var(--kraft-ink); background: rgba(255, 255, 255, .25); }
.file-card .badge--closed, .card--paper .badge--closed { color: var(--red-ink); }

.stamp {
  display: inline-block;
  padding: .3rem .7rem .2rem;
  border: 3px double currentColor;
  border-radius: 6px;
  color: var(--red-ink);
  font-family: var(--font-type);
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  opacity: .92;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.stamp--dark { color: var(--red-text); mix-blend-mode: normal; }
.stamp--amber { color: var(--amber); mix-blend-mode: normal; }
.stamp-in { animation: stamp-in .45s var(--ease) both; }
@keyframes stamp-in {
  0% { transform: rotate(-9deg) scale(1.8); opacity: 0; }
  70% { transform: rotate(-9deg) scale(.95); opacity: 1; }
  100% { transform: rotate(-9deg) scale(1); opacity: .92; }
}

.tag {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--black-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.tag--statement { background: rgba(200, 49, 43, .16); border-color: rgba(229, 86, 79, .5); color: #F3A49F; }
.tag--notice { background: rgba(227, 165, 59, .14); border-color: rgba(227, 165, 59, .5); color: var(--amber-2); }
.tag--communication { background: rgba(237, 230, 214, .08); }
.tag--pin { background: var(--amber); border-color: var(--amber); color: var(--black); }
.tag--assembly { color: var(--amber-2); border-color: rgba(227, 165, 59, .5); }
.tag--deadline { color: #F3A49F; border-color: rgba(229, 86, 79, .5); }
.tag--ideas { color: #B9DDB8; border-color: rgba(127, 183, 126, .5); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 40px;
  padding: .45rem .9rem;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  font-size: .92rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--cream); }
.chip[aria-pressed="true"] { background: var(--cream); border-color: var(--cream); color: var(--black); }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field label, .field legend, .label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .85rem;
  background: var(--black-2);
  border: 1.5px solid #4A5058;
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-size: 1rem;
  transition: border-color .2s;
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cream) 50%), linear-gradient(135deg, var(--cream) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
.input:hover, .select:hover, .textarea:hover { border-color: #6A7079; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(227, 165, 59, .35); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--red-text); }
.input::placeholder, .textarea::placeholder { color: #8A8478; }
.help { font-size: .85rem; color: var(--muted); }
.field-error { font-size: .875rem; color: var(--red-text); font-weight: 600; }
.counter { align-self: flex-end; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--red-text); }
.code-input { font-family: var(--font-type); font-size: 1.4rem; letter-spacing: .12em; text-transform: uppercase; }

fieldset { margin: 0 0 1.1rem; padding: 0; border: 0; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: .5rem; }

.check { display: flex; align-items: flex-start; gap: .7rem; padding: .35rem 0; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: .1rem 0 0; accent-color: var(--amber); cursor: pointer; }

.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.segmented label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .75rem .4rem;
  border: 1.5px solid #4A5058;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
}
.segmented label small { font-weight: 400; color: var(--muted); font-size: .75rem; line-height: 1.25; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented label:has(input:checked) { border-color: var(--amber); background: rgba(227, 165, 59, .12); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }

.notice {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--black-2);
}
.notice > * { margin: 0; }
.notice--red { border-left-color: var(--red-text); }
.notice--ok { border-left-color: var(--ok); }
.notice strong { color: var(--cream-2); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 2.25rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty__title { font-family: var(--font-type); color: var(--cream); font-size: 1.05rem; }
.empty p { margin: 0; max-width: 46ch; }
.empty--error .empty__title { color: var(--red-text); }

.skeleton {
  position: relative;
  min-height: 140px;
  border-radius: var(--radius);
  background: var(--black-2);
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(calc(100% - 32px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in .3s var(--ease) both;
}
.toast::before { content: "✓"; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--cream); font-size: .85rem; }
.toast--error::before { content: "!"; background: var(--red-ink); }
.toast.is-leaving { animation: toast-out .25s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

.modal {
  width: min(calc(100% - 32px), 560px);
  max-height: calc(100vh - 48px);
  padding: 0;
  background: var(--black-2);
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal[open] { animation: toast-in .25s var(--ease); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 1.8rem; }
.modal__body { padding: 1.25rem; overflow-y: auto; }
.modal__close { flex: none; width: 44px; height: 44px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 1.4rem; line-height: 1; }

.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: .5rem; bottom: .5rem; border-left: 2px dashed var(--red); }
.timeline li { position: relative; padding-bottom: 1.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -1.6rem; top: .35rem; width: 14px; height: 14px; border-radius: 50%; background: var(--black); border: 3px solid var(--red-text); }
.timeline time { display: block; font-family: var(--font-type); font-size: .82rem; color: var(--amber); }
.timeline h3 { margin: .15rem 0 .25rem; font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; line-height: 1.35; letter-spacing: 0; }
.timeline .prose { color: var(--muted); }

.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.4em; }
.prose a { font-weight: 600; }
.prose blockquote { margin: 1em 0; padding: .25em 1em; border-left: 3px solid var(--amber); color: var(--muted); }
.prose code { padding: .1em .35em; background: var(--black-3); border-radius: 4px; font-size: .9em; }
.prose img { border-radius: var(--radius-sm); }
.prose li + li { margin-top: .3em; }
.prose strong { color: var(--cream-2); }

.bars { display: flex; flex-direction: column; gap: .9rem; }
.bar__head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; font-weight: 600; }
.bar__head span:last-child { flex: none; font-variant-numeric: tabular-nums; color: var(--amber); }
.bar__track { height: 12px; background: var(--black-3); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; width: 0; background: var(--amber); border-radius: inherit; transition: width .8s var(--ease); }
.bar.is-mine .bar__fill { background: var(--cream); }
.bar__mine { color: var(--muted); font-weight: 400; font-size: .85rem; }

.date-block {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 68px;
  background: var(--cream) var(--paper);
  color: var(--ink);
  border-radius: var(--radius-sm);
  line-height: 1;
}
.date-block .d { font-family: var(--font-title); font-size: 2rem; }
.date-block .m { font-family: var(--font-type); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  background: #0A0B0D;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
.footer-brand { display: flex; flex-direction: column; gap: .75rem; }
.footer-brand .brand img { height: 56px; }
.footer-brand p { margin: 0; color: var(--muted); max-width: 36ch; }
.footer-col h2 { font-size: 1.3rem; margin-bottom: .6rem; color: var(--muted); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.footer-col a { display: inline-block; padding: .25rem 0; color: var(--cream); text-decoration: none; }
.footer-col a:hover { color: var(--amber); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .82rem; }
.footer-bottom a { color: var(--muted); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

.load-more { display: flex; justify-content: center; margin-top: 1.5rem; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.turnstile-box { min-height: 65px; margin-bottom: 1rem; }

[tabindex="-1"]:focus { outline: none; }
.card--paper .placeholder, .desk .placeholder, .reply .placeholder { background: rgba(168, 40, 34, .12); color: var(--red-ink); }

img[data-tone="light"] { background-color: #1E2126; }
img[data-tone="dark"] { background-color: var(--cream); }
img[data-tone="light"], img[data-tone="dark"] { object-fit: contain !important; padding: 6%; }
