:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #191a19;
  --muted: #545550;
  --surface: #fff;
  --ground: #f4f4f0;
  --line: #d2d2c9;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--ground); line-height: 1.55; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button[hidden] { display: none; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.12; }
h1 { margin-bottom: .45rem; }
h2 { margin-bottom: .9rem; font-size: 1.3rem; font-weight: 650; letter-spacing: -.018em; }
p { margin-bottom: .85rem; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link { position: fixed; z-index: 2; inset: 1rem auto auto 1rem; padding: .75rem 1rem; background: var(--surface); }
.portal-brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.portal-mark { display: block; width: 1.35rem; height: 1.35rem; border: 1.5px solid currentColor; }
.portal-mark::after { content: ""; display: block; height: 100%; border-right: 1.5px solid currentColor; transform: translateX(-50%); }
.eyebrow { color: var(--muted); font-size: .77rem; font-weight: 650; letter-spacing: .105em; text-transform: uppercase; }
.intro-text { max-width: 62ch; font-size: clamp(1rem, 1.4vw, 1.16rem); color: var(--muted); overflow-wrap: anywhere; }
.muted { color: var(--muted); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  min-height: 2.8rem;
  border: 1px solid var(--ink);
  border-radius: .35rem;
  padding: .6rem 1rem;
  color: var(--surface);
  background: var(--ink);
  font-weight: 625;
  text-decoration: none;
  text-align: center;
}
.button:hover { background: #333431; }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--ground); border-color: var(--muted); }
.button.danger { border-color: var(--ink); }
.form-error, .errorlist { color: var(--ink); font-weight: 650; }
.form-error { border-inline-start: 3px solid var(--ink); padding: .5rem .75rem; background: var(--ground); }

.visitor {
  background: #f9f9f5;
  min-height: 100vh;
}
.visitor-width { width: min(100% - 3rem, 52rem); margin-inline: auto; }
.visitor-top { border-bottom: 1px solid var(--line); }
.visitor-top .visitor-width { min-height: 4.7rem; display: flex; justify-content: space-between; align-items: center; }
.visitor-main { padding-block: clamp(3rem, 8vw, 7rem); }
.visitor-intro { padding-bottom: clamp(2rem, 5vw, 4rem); }
.visitor-intro h1 { max-width: 16ch; font-family: var(--serif); font-size: clamp(3rem, 8vw, 6.6rem); font-weight: 400; letter-spacing: -.06em; overflow-wrap: anywhere; }
.visitor-intro .eyebrow { margin-bottom: 1.05rem; }
.visitor-intro .intro-text { padding-top: .45rem; }
.visitor-intro .button { margin-top: .75rem; }
.visitor-section { margin-bottom: 2.3rem; }
.visitor-section h2 { font-size: 1rem; }
.visitor-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.visitor-list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4.5rem; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: clamp(1.12rem, 2.2vw, 1.65rem); font-weight: 580; text-decoration: none; }
.visitor-list a:hover span:first-child { text-decoration: underline; text-underline-offset: .16em; }
.item-arrow { font-size: 1.25rem; }
.unlock-panel { width: min(100%, 35rem); border: 1px solid var(--line); border-radius: .45rem; padding: clamp(1.25rem, 4vw, 2.3rem); background: var(--surface); }
.unlock-panel > p { max-width: 35ch; color: var(--muted); }
.unlock-panel form { margin-top: 1.25rem; }
.unlock-fields { display: flex; align-items: stretch; flex-wrap: wrap; gap: .65rem; }
.pin-input { max-width: 10rem; text-align: center; font-variant-numeric: tabular-nums; font-size: 1.25rem; letter-spacing: .22em; }

.admin-width { width: min(100% - 3.8rem, 75rem); margin-inline: auto; }
.admin-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-top .admin-width { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 4.25rem; }
.top-nav { display: flex; align-items: center; gap: clamp(.75rem, 3vw, 2.1rem); }
.top-nav a, .text-button { text-decoration: none; font-size: .94rem; font-weight: 550; }
.top-nav a:hover, .text-button:hover { text-decoration: underline; text-underline-offset: .18em; }
.text-button { border: 0; padding: .45rem 0; background: transparent; }
.admin-main { padding-block: clamp(2rem, 5vw, 4.1rem); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.7rem; }
.page-heading h1 { font-size: clamp(2.25rem, 6vw, 4rem); letter-spacing: -.05em; font-weight: 660; overflow-wrap: anywhere; }
.project-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: .6rem; font-size: .9rem; color: var(--muted); text-underline-offset: .25em; }
.notices { display: grid; gap: .5rem; margin-bottom: 1rem; }
.notice { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--surface); }
.notice.error { border-color: var(--ink); }
.summary-heading { margin: 0 0 .65rem; color: var(--muted); font-size: .95rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin: 0 0 1.5rem; }
.stats-grid > div { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); }
.stats-grid dt { font-size: .9rem; color: var(--muted); }
.stats-grid dd { margin: .2rem 0 0; font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 625; line-height: 1.15; font-variant-numeric: tabular-nums; }
.panel { padding: clamp(1.2rem, 3vw, 1.7rem); border: 1px solid var(--line); border-radius: .45rem; background: var(--surface); }
.empty-panel { padding-block: 2.5rem; }
.split-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.admin-section { margin-top: 2.2rem; }
.auth-panel { max-width: 30rem; }
.pin-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1.5rem; margin-bottom: 1.5rem; border-color: var(--ink); }
.pin-notice h2 { margin-bottom: .35rem; }
.pin-notice output { font-size: 2rem; font-variant-numeric: tabular-nums; letter-spacing: .15em; }

.table-panel { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: .9rem clamp(.75rem, 2vw, 1.25rem); text-align: left; }
th { border-bottom: 1px solid var(--line); color: var(--muted); font-size: .83rem; font-weight: 650; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.table-title { font-weight: 625; text-underline-offset: .2em; }
.table-subtitle { display: block; margin-top: .18rem; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.table-action { text-align: right; }
.table-action > a { display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; text-decoration: none; }
.table-action > a:hover { text-decoration: underline; }
.release-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; }
.status-pill { display: inline-block; padding: .2rem .58rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--ground); font-size: .8rem; font-weight: 650; white-space: nowrap; }
.activity-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.activity-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .2rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.activity-list time { color: var(--muted); font-size: .88rem; }

label, .field-label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 650; }
input:not([type="hidden"]), textarea, select { width: 100%; min-height: 2.8rem; border: 1px solid #9e9f96; border-radius: .35rem; padding: .48rem .64rem; background: var(--surface); color: var(--ink); }
textarea { min-height: 7.25rem; resize: vertical; }
input[type="file"] { padding: .35rem; }
input[type="file"]::file-selector-button { min-height: 2rem; border: 1px solid var(--line); border-radius: .2rem; padding: .25rem .4rem; background: var(--ground); font: inherit; cursor: pointer; }
input[readonly] { background: var(--ground); }
.stack-form { display: grid; justify-items: start; gap: .85rem; }
.stack-form > p, .stack-form .field { width: 100%; margin: 0; }
.stack-form .helptext { display: block; margin-top: .25rem; color: var(--muted); font-size: .84rem; }
.inline-field, .action-row { display: flex; align-items: stretch; gap: .55rem; }
.inline-field { margin-bottom: .85rem; }
.action-row { flex-wrap: wrap; margin-top: .75rem; }
.code-sample { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--ground); color: var(--ink); font-size: .84rem; overflow: auto; }

@media (max-width: 700px) {
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .visitor-width, .admin-width { width: calc(100% - 2rem); }
}
@media (max-width: 390px) {
  .admin-top .admin-width { align-items: flex-start; flex-direction: column; padding-block: .65rem; }
  .unlock-fields { flex-direction: column; }
  .pin-input { max-width: none; }
}
