:root {
  color-scheme: light;
  --paper: #eee6d3;
  --ink: #1e1914;
  --muted: #766a58;
  --line: rgba(30, 25, 20, 0.42);
  --accent: #b9372f;
  --accent-2: #23615b;
  --wash: #d8c59b;
  --shadow: rgba(30, 25, 20, 0.18);
  --max: 980px;
}

html[data-theme="night"] {
  color-scheme: dark;
  --paper: #171717;
  --ink: #f3ead8;
  --muted: #b7aa92;
  --line: rgba(243, 234, 216, 0.34);
  --accent: #f26d50;
  --accent-2: #7cc8bb;
  --wash: #342d24;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(185, 55, 47, 0.13), transparent 24rem),
    radial-gradient(circle at 82% 34%, rgba(35, 97, 91, 0.14), transparent 21rem),
    linear-gradient(115deg, transparent 0 49.5%, rgba(30, 25, 20, 0.045) 49.7% 50.3%, transparent 50.5%),
    var(--paper);
  font-family: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(30, 25, 20, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 25, 20, 0.035) 1px, transparent 1px);
  background-size: 19px 19px, 19px 19px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

a {
  color: inherit;
}

.grain-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
}

html[data-theme="night"] .grain-field {
  opacity: 0.22;
  mix-blend-mode: screen;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 42px);
  pointer-events: none;
}

.skip-link,
.icon-button,
.text-button,
.admin-link {
  pointer-events: auto;
}

.skip-link {
  position: absolute;
  left: clamp(18px, 4vw, 42px);
  transform: translateY(-220%);
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  pointer-events: auto;
}

.admin-link,
.text-button,
.icon-button {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  color: var(--ink);
  box-shadow: 0 10px 30px var(--shadow);
}

.admin-link,
.text-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font: 800 0.8rem/34px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font: 700 20px/1 Georgia, serif;
  cursor: pointer;
}

main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.folio-hero {
  min-height: 96vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 76px 0 42px;
  text-align: center;
}

.kicker,
.section-mark,
.stamp,
footer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
}

.kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.4rem, 10.5vw, 7.8rem);
  line-height: 0.82;
  font-weight: 900;
  text-transform: uppercase;
  text-wrap: balance;
}

h1 span {
  display: block;
  transform: rotate(var(--tilt, -1deg));
  text-shadow: 0.035em 0.035em 0 var(--wash);
}

h1 span + span {
  --tilt: 1.25deg;
}

.subtitle {
  max-width: 34rem;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
}

.ledger {
  width: min(100%, 540px);
}

.ledger a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  min-height: 42px;
  padding: 4px 0;
  color: var(--ink);
  font-size: clamp(1rem, 2.4vw, 1.22rem);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.ledger i {
  border-bottom: 2px dotted currentColor;
  transform: translateY(-0.28em);
  opacity: 0.76;
}

.ledger strong {
  min-width: 2.2ch;
  color: var(--accent);
}

.ledger a:hover,
.ledger a:focus-visible {
  color: var(--accent-2);
}

.intro-band,
.archive {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(20px, 5vw, 60px);
  align-items: start;
  padding: 84px 0;
  border-top: 1px solid var(--line);
}

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

.section-mark {
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 800;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.intro-band p:last-child {
  max-width: 44rem;
  font-size: clamp(1.1rem, 2.2vw, 1.42rem);
}

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 84px;
}

.specimen-grid article {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--paper) 92%, white), transparent),
    color-mix(in srgb, var(--paper) 86%, var(--wash));
  box-shadow: 0 18px 38px -28px var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.specimen-grid article:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 28px 54px -34px var(--shadow);
}

.stamp {
  display: inline-block;
  margin-bottom: 36px;
  padding: 3px 7px;
  border: 1px solid currentColor;
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.5rem;
  line-height: 1.05;
}

.specimen-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.notes {
  padding-bottom: 82px;
}

.notes ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.notes li {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.notes time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.notes a {
  font-size: clamp(1.08rem, 2vw, 1.5rem);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tokens span {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  font: 700 0.9rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

footer {
  width: min(var(--max), calc(100% - 32px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

footer p {
  margin: 0;
}

.compliance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

@media (max-width: 760px) {
  .site-header {
    padding-inline: 14px;
  }

  .admin-link,
  .text-button {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.72rem;
    line-height: 32px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .folio-hero {
    min-height: auto;
    padding-top: 104px;
  }

  .intro-band,
  .archive,
  .specimen-grid,
  .notes li {
    grid-template-columns: 1fr;
  }

  .intro-band,
  .archive {
    padding: 58px 0;
  }

  .section-heading {
    padding-top: 56px;
  }

  .specimen-grid {
    padding-bottom: 58px;
  }

  .specimen-grid article {
    min-height: 210px;
  }

  footer {
    flex-direction: column;
  }
}

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

  .specimen-grid article {
    transition: none;
  }
}
