@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/fraunces-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/fraunces-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/fraunces-latin-600-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --font-display: "Fraunces", Georgia, Cambria, serif;
  --font-sans: "IBM Plex Sans", Inter, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --accent: #a98442;
  --ink-900: #16241f;
  --paper-50: #f7f5ef;
  --paper-100: #ede9dd;
  --surface-inset: #f7f5ef;
  --surface-sunken: #ede9dd;
  --surface-pressed: #e3ddcf;
  --brass-500: var(--accent);
  --brass-300: #d8b46f;
  --sage-600: #4b6358;
  --line-300: #d9d2c0;
  --line-400: var(--line-300);
  --stamp-600: #8c3f2e;
  --section-label: #806027;
  --button-primary: #806027;
  --button-primary-fg: #fffaf0;
  --paper-noise: .28;

  --shadow-1: 0 1px 2px rgba(22, 36, 31, .07), 0 4px 10px rgba(22, 36, 31, .16);
  --shadow-2: 0 2px 4px rgba(22, 36, 31, .09), 0 10px 20px rgba(22, 36, 31, .22);
  --shadow-3: 0 4px 10px rgba(22, 36, 31, .12), 0 24px 48px rgba(22, 36, 31, .28);

  color-scheme: light;
}

html[data-theme='dark'] {
  --accent: #d4b274;
  --ink-900: #e6e3dc;
  --paper-50: #1b1c1f;
  --paper-100: #232427;
  --surface-inset: #2b2d31;
  --surface-sunken: #1e1f22;
  --surface-pressed: #303237;
  --brass-500: var(--accent);
  --brass-300: #d4b274;
  --sage-600: #a9adb4;
  --line-300: #34363b;
  --line-400: #3e4046;
  --stamp-600: #e8998a;
  --section-label: #d4b274;
  --button-primary: #d4b274;
  --button-primary-fg: #17181a;
  --paper-noise: 0;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 9px 18px rgba(0, 0, 0, .45);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .45), 0 18px 32px rgba(0, 0, 0, .55);
  --shadow-3: 0 6px 14px rgba(0, 0, 0, .55), 0 32px 60px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper-50);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-900) 22%, transparent) transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-wrap: anywhere;
  background:
    radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--brass-500) 9%, transparent), transparent 28rem),
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--sage-600) 8%, transparent), transparent 24rem),
    linear-gradient(135deg, color-mix(in srgb, var(--line-300) 25%, transparent) 1px, transparent 1px),
    var(--paper-50);
  background-size: auto, auto, 32px 32px, auto;
  color: var(--ink-900);
  font-family: var(--font-sans);
  text-rendering: geometricPrecision;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: var(--paper-noise);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .32) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 10%, rgba(0, 0, 0, .08) 0 1px, transparent 1px);
  background-size: 42px 42px, 58px 58px;
}

html[data-theme='dark'] body {
  background: var(--paper-50);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

::selection {
  background: color-mix(in srgb, var(--brass-500) 24%, transparent);
}

html[data-theme='dark'] ::selection {
  background: var(--brass-300);
  color: #141517;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-900) 22%, transparent);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink-900) 38%, transparent);
  background-clip: content-box;
}

.shell {
  width: 100%;
  max-width: 100rem;
  margin-inline: auto;
  padding-inline: calc(1.25rem + env(safe-area-inset-left, 0px))
    calc(1.25rem + env(safe-area-inset-right, 0px));
}

.site-header {
  position: relative;
  z-index: 30;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: 1.25rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 8px;
}

.brand-symbol {
  --brand-stroke: #a88c5a;
  width: 40px;
  height: 40px;
  overflow: visible;
}

html[data-theme='dark'] .brand-symbol {
  --brand-stroke: #b89b67;
}

.brand-symbol path {
  fill: none;
  stroke: var(--brand-stroke);
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.brand-symbol .brand-symbol-check {
  stroke-linejoin: bevel;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
}

.nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .5rem .75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: color-mix(in srgb, var(--ink-900) 68%, transparent);
  font-size: .75rem;
  font-weight: 600;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.nav a:hover,
.nav a[aria-current='page'] {
  transform: translateY(-1px);
  border-color: var(--line-300);
  background: var(--paper-100);
  color: var(--ink-900);
}

.theme-toggle-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  margin-left: .25rem;
  border: 1px solid var(--line-300);
  border-radius: 999px;
  padding: 0;
  background: var(--paper-100);
  color: color-mix(in srgb, var(--ink-900) 72%, transparent);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.theme-toggle-button:hover {
  border-color: var(--brass-500);
  color: var(--ink-900);
}

.theme-toggle-button:active {
  transform: scale(.95);
}

.theme-icon {
  width: 16px;
  height: 16px;
}

.theme-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

html[data-theme='dark'] .theme-icon-moon {
  display: none;
}

html[data-theme='dark'] .theme-icon-sun {
  display: block;
}

main {
  padding: 2rem 0 5rem;
}

.hero,

.hero {
  display: grid;
  gap: 1.15rem;
  padding: 2rem 0 2.5rem;
}

main > .doc {
  padding-top: 1rem;
  padding-bottom: 4rem;
  animation: docEnter 420ms cubic-bezier(.2, .75, .25, 1) backwards;
}

.doc > * {
  max-width: 48rem;
}

@keyframes docEnter {
  from { opacity: 0; transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
  main > .doc { animation: none; }
}

.doc-top {
  margin-bottom: 1rem;
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .5rem .75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: color-mix(in srgb, var(--ink-900) 68%, transparent);
  font-size: .82rem;
  font-weight: 600;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-300);
  background: var(--paper-100);
  color: var(--ink-900);
}

.stamp,
.meta,
.card-number,
.footer-group-title {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.stamp {
  width: fit-content;
  color: var(--section-label);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  max-width: 52rem;
  font-size: clamp(2.85rem, 7vw, 5.5rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.doc-hero h1 {
  font-size: clamp(2.35rem, 6vw, 3rem);
}

.lead {
  max-width: 47rem;
  margin: 0;
  color: var(--sage-600);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.7;
}

.meta {
  margin: .15rem 0 0;
  color: color-mix(in srgb, var(--ink-900) 66%, transparent);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .14em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

.card,
.notice {
  border: 1px solid var(--line-300);
  border-radius: 1.35rem;
  background: color-mix(in srgb, var(--paper-50) 80%, transparent);
  box-shadow: var(--shadow-1);
}

html[data-theme='dark'] .card,
html[data-theme='dark'] .notice {
  border-color: var(--line-400);
  background: var(--paper-100);
}

.card {
  display: flex;
  min-height: 13.5rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--brass-500);
  box-shadow: var(--shadow-2);
}

.card-number {
  color: var(--section-label);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .16em;
}

.card h2 {
  margin-top: .45rem;
  font-size: 1.65rem;
  letter-spacing: -.035em;
}

.card p {
  margin: .7rem 0 0;
  color: var(--sage-600);
  line-height: 1.65;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .82rem;
  font-weight: 600;
}

.card-action span:last-child {
  color: var(--section-label);
  font-size: 1.2rem;
}

.notice {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  color: var(--sage-600);
  line-height: 1.65;
}

.doc-hero {
  display: grid;
  gap: 1.25rem;
  padding: .75rem 0 2.5rem;
}

.doc-hero .lead {
  color: color-mix(in srgb, var(--ink-900) 68%, transparent);
  font-size: 1.125rem;
  line-height: 2rem;
}

.doc-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-300);
}

.doc-section h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  letter-spacing: -.035em;
}

.doc-section p,
.doc-section li {
  margin: .75rem 0 0;
  color: color-mix(in srgb, var(--ink-900) 72%, transparent);
  font-size: .96rem;
  line-height: 1.75rem;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-section a {
  color: var(--section-label);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 4px;
}

.doc-section a:hover {
  text-decoration: underline;
}

.doc-section ul {
  margin: .75rem 0 0;
  padding-left: 1.35rem;
}

.site-footer {
  position: relative;
  border-top: 1px solid var(--line-300);
  background: color-mix(in srgb, var(--paper-50) 80%, transparent);
}

.footer-main {
  display: grid;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  color: color-mix(in srgb, var(--ink-900) 60%, transparent);
}

.footer-brand {
  font-size: .875rem;
  line-height: 1.5rem;
}

.footer-brand strong {
  color: var(--ink-900);
  font-weight: 600;
}

.footer-nav {
  display: grid;
  gap: .25rem;
}

.footer-nav > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
}

.footer-group-title {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: .75rem;
}

.footer-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-inline: -.5rem;
  padding-inline: .5rem;
  border-radius: 8px;
  color: inherit;
  font-size: .84rem;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: var(--brass-500);
}

@media (min-width: 1280px) {
  .footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1rem;
  }

  .footer-nav > div + div::before {
    content: "|";
    margin-right: 1rem;
    color: var(--line-300);
  }
}

@media (min-width: 1536px) {
  .footer-main {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 3rem;
    row-gap: 0;
  }

  .footer-brand {
    display: contents;
  }

  .footer-brand strong { grid-column: 1; grid-row: 1; }
  .footer-brand div { grid-column: 1; grid-row: 2; }
  .footer-nav { grid-column: 2; grid-row: 2; }
}

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

@media (min-width: 768px) {
  .shell {
    padding-inline: calc(2.5rem + env(safe-area-inset-left, 0px))
      calc(2.5rem + env(safe-area-inset-right, 0px));
  }

  .brand-symbol {
    width: 36px;
    height: 36px;
  }

}

@media (min-width: 1280px) {
  .shell {
    padding-inline: calc(4rem + env(safe-area-inset-left, 0px))
      calc(4rem + env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 760px) {
  .site-header {
    padding-top: calc(.8rem + env(safe-area-inset-top, 0px));
    padding-bottom: .8rem;
  }

  .header-row {
    flex-wrap: wrap;
  }

  .brand {
    flex: 1 1 auto;
  }

  .brand-symbol {
    width: 34px;
    height: 34px;
  }

  .nav {
    order: 3;
    width: 100%;
    flex: 1 0 100%;
    gap: .2rem;
  }

  .nav a {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    padding-inline: .35rem;
    font-size: .72rem;
    white-space: nowrap;
  }

  .theme-toggle-button {
    margin-left: auto;
  }

  main {
    padding-top: 1rem;
  }

  .hero {
    padding: 1rem 1.25rem 1.75rem;
  }

  h1 {
    font-size: clamp(2.5rem, 12vw, 3.6rem);
    line-height: 1;
  }

  .doc-hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.35rem);
  }

  .cards {
    grid-template-columns: 1fr;
    padding-inline: 1.25rem;
  }

  .card {
    min-height: 0;
  }

  .notice {
    margin-inline: 1.25rem;
  }

  .doc-section p,
  .doc-section li {
    font-size: .93rem;
    line-height: 1.7;
  }
}

@media (max-width: 390px) {
  .nav a {
    font-size: .68rem;
  }
}

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

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