@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --brand-maroon: #861a4a;
  --brand-sand: #ebc48a;

  --white: #ffffff;
  --ink: color-mix(in srgb, var(--brand-maroon) 16%, #000000);

  --background: var(--white);
  --foreground: var(--ink);
  --faint: color-mix(in srgb, var(--brand-sand) 7%, var(--white));
  --faint-foreground: color-mix(in srgb, var(--ink) 40%, var(--white));
  --card: var(--white);
  --card-foreground: var(--ink);
  --muted: color-mix(in srgb, var(--brand-sand) 14%, var(--white));
  --muted-foreground: color-mix(in srgb, var(--ink) 62%, var(--white));
  --secondary: var(--muted);
  --secondary-foreground: var(--ink);
  --accent: color-mix(in srgb, var(--ink) 4%, var(--white));
  --border: color-mix(in srgb, var(--ink) 10%, var(--white));
  --input: color-mix(in srgb, var(--ink) 18%, var(--white));

  --primary: var(--brand-maroon);
  --primary-hover: color-mix(in srgb, var(--brand-maroon) 86%, #000000);
  --primary-foreground: var(--white);
  --primary-muted: color-mix(in srgb, var(--white) 78%, var(--brand-maroon));
  --primary-soft: color-mix(in srgb, var(--brand-maroon) 7%, var(--white));
  --ring: color-mix(in srgb, var(--brand-maroon) 40%, var(--white));
  --topnav-bg: color-mix(in srgb, var(--background) 88%, transparent);

  --success: var(--brand-maroon);
  --warning: color-mix(in srgb, var(--brand-sand) 68%, #000000);
  --danger: color-mix(in srgb, var(--brand-maroon) 88%, #000000);

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --text-display: 3.25rem;
  --text-1: 1.75rem;
  --text-2: 1.25rem;
  --text-3: 1.125rem;
  --text-4: 1rem;
  --text-5: 0.9375rem;
  --text-6: 0.875rem;
  --text-7: 0.8125rem;
  --text-8: 0.75rem;
  --text-regular: var(--text-6);

  --leading-display: 1.08;
  --leading-heading: 1.25;
  --leading-body: 1.57;
  --leading-tight: 1.35;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --font-normal: var(--weight-regular);
  --font-medium: var(--weight-medium);
  --font-semibold: var(--weight-semibold);
  --font-bold: var(--weight-semibold);

  --tracking-display: -0.04em;
  --tracking-heading: -0.025em;
  --tracking-tight: -0.01em;
  --tracking-caps: 0.06em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --gap-label: 0.375rem;
  --gap-field: 1.25rem;
  --gap-section: 1.5rem;
  --pad-card: 1.5rem;

  --control-sm: 2rem;
  --control-md: 2.5rem;
  --control-lg: 3rem;

  --radius-small: 0.375rem;
  --radius-medium: 0.5rem;
  --radius-large: 0.75rem;
  --radius-full: 62rem;

  --shadow-small: 0 0.0625rem 0.125rem color-mix(in srgb, var(--ink) 6%, transparent);
  --shadow-medium: 0 0.0625rem 0.125rem color-mix(in srgb, var(--ink) 6%, transparent),
    0 0.5rem 1.5rem -0.75rem color-mix(in srgb, var(--ink) 18%, transparent);
  --shadow-large: 0 0.125rem 0.375rem color-mix(in srgb, var(--ink) 6%, transparent),
    0 1.75rem 3.5rem -1.5rem color-mix(in srgb, var(--brand-maroon) 26%, transparent);

  --container-max: 70rem;
  --container-pad: 1.5rem;
  --nav-height: 4rem;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--faint);
  font-family: var(--font-sans);
  font-size: var(--text-6);
  line-height: var(--leading-body);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--weight-semibold);
  color: var(--foreground);
}

h1 { font-size: var(--text-1); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); }
h2 { font-size: var(--text-2); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); }
h3 { font-size: var(--text-4); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
h4 { font-size: var(--text-6); line-height: var(--leading-tight); }

p { margin: 0; }

small { font-size: var(--text-7); line-height: var(--leading-tight); }

code, pre { font-family: var(--font-mono); font-size: var(--text-7); }

a:not(.button) {
  color: var(--primary);
  text-decoration: none;
}

a:not(.button):hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:where(button, .button, input[type="submit"], input[type="reset"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-md);
  padding: 0 var(--space-4);
  border: 0.0625rem solid var(--primary);
  border-radius: var(--radius-medium);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-6);
  font-weight: var(--weight-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-small);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

:where(button, .button, input[type="submit"], input[type="reset"]):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-medium);
  transform: translateY(-0.0625rem);
}

:where(button, .button, input[type="submit"], input[type="reset"]):active {
  box-shadow: var(--shadow-small);
  transform: translateY(0);
}

:where(button, .button).ghost:hover,
:where(button, .button).ghost:active {
  box-shadow: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  :where(button, .button, input[type="submit"], input[type="reset"]) {
    transition: none;
  }

  :where(button, .button, input[type="submit"], input[type="reset"]):hover {
    transform: none;
  }
}

:where(button, .button, input[type="submit"], input[type="reset"]):focus-visible {
  outline: 0.1875rem solid var(--ring);
  outline-offset: 0.0625rem;
}

:where(button, .button).small { height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--text-7); }
:where(button, .button).large { height: var(--control-lg); padding: 0 var(--space-6); font-size: var(--text-5); }
:where(button, .button).icon-button { width: var(--control-sm); height: var(--control-sm); padding: 0; justify-content: center; border-radius: var(--radius-full); }
:where(button, .button).icon-button svg { width: 1rem; height: 1rem; }

:where(button, .button).outline {
  background: var(--white);
  border-color: var(--input);
  color: var(--foreground);
}

:where(button, .button).outline:hover {
  background: var(--accent);
  border-color: var(--input);
  color: var(--foreground);
}

:where(button, .button).ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
  box-shadow: none;
}

:where(button, .button).ghost:hover {
  background: var(--accent);
  border-color: transparent;
  color: var(--foreground);
}

:where(button, .button)[data-variant="danger"] {
  background: var(--white);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--white));
  color: var(--danger);
}

:where(button, .button)[data-variant="danger"]:hover {
  background: var(--primary-soft);
  border-color: var(--danger);
  color: var(--danger);
}

:where(button):disabled,
:where(.button)[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

[data-field] {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--gap-label);
  margin: 0 0 var(--gap-field);
  font-size: var(--text-7);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--foreground);
}

[data-field] > * {
  flex-shrink: 0;
}

:where(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="reset"]), select, textarea) {
  width: 100%;
  height: var(--control-md);
  padding: 0 var(--space-3);
  border: 0.0625rem solid var(--input);
  border-radius: var(--radius-medium);
  background: var(--white);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-6);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  box-shadow: var(--shadow-small);
}

:where(select) {
  appearance: none;
  padding-inline-end: var(--space-10);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position:
    calc(100% - 1.125rem) 50%,
    calc(100% - 0.8125rem) 50%;
  background-size: 0.3125rem 0.3125rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

:where(textarea) {
  height: auto;
  min-height: 6rem;
  padding: var(--space-2) var(--space-3);
}

:where(input, textarea)::placeholder {
  color: var(--faint-foreground);
}

:where(input, select, textarea):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.1875rem var(--ring);
}

:where(input, select, textarea):disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.required-mark {
  margin-inline-start: 0.125rem;
  color: var(--primary);
}

[data-hint] {
  margin: 0;
  font-size: var(--text-8);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  color: var(--muted-foreground);
}

[data-error],
[data-check] {
  margin: 0;
  font-size: var(--text-8);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}

[data-error] {
  color: var(--danger);
}

[data-error]:empty,
[data-check]:empty {
  display: none;
}

[data-check] [data-state="ok"] {
  color: var(--muted-foreground);
}

[data-check] [data-state="error"] {
  color: var(--danger);
}

[data-field] :where(input)[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--danger) 14%, transparent);
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.field-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-full);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: var(--text-8);
  font-weight: var(--weight-semibold);
  font-style: italic;
  line-height: 1;
  cursor: help;
}

.field-info:focus-visible {
  outline: 0.125rem solid var(--primary);
  outline-offset: 0.125rem;
}

[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  inset-block-end: calc(100% + var(--space-2));
  inset-inline-start: 50%;
  z-index: 20;
  width: max-content;
  max-width: 17rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-medium);
  background: var(--foreground);
  color: var(--white);
  font-size: var(--text-8);
  font-style: normal;
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.25rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.segmented {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-large);
  background: var(--accent);
}

.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--control-md);
  border-radius: var(--radius-medium);
  color: var(--muted-foreground);
  font-size: var(--text-6);
  font-weight: var(--weight-medium);
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:hover {
  color: var(--foreground);
}

.segmented label:has(input:checked) {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-small);
}

.segmented label:has(input:focus-visible) {
  outline: 0.125rem solid var(--ring);
  outline-offset: 0.125rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 1.5rem;
  padding: 0 var(--space-3);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--foreground);
  font-size: var(--text-8);
  font-weight: var(--weight-medium);
  line-height: 1;
}

.badge.outline {
  background: transparent;
  color: var(--muted-foreground);
}

.badge[data-variant="danger"] {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--white));
  background: var(--primary-soft);
  color: var(--danger);
}

.card {
  padding: var(--pad-card);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-large);
  background: var(--card);
  box-shadow: var(--shadow-small);
}

.card > header + * {
  margin-top: var(--space-5);
}

.card > header p {
  margin-top: var(--space-1);
  font-size: var(--text-7);
  color: var(--muted-foreground);
}

.card [data-field]:last-child {
  margin-bottom: 0;
}

.card > footer {
  margin-top: var(--space-5);
}

.card:has(> .table) {
  padding: var(--space-2) 0;
}

.card:has(> .table) > header {
  padding: var(--space-4) var(--pad-card) var(--space-2);
}

.card:has(> .table) > header + .table {
  margin-top: 0;
}

.card > .table :is(th, td):first-child {
  padding-inline-start: var(--pad-card);
}

.card > .table :is(th, td):last-child {
  padding-inline-end: var(--pad-card);
}

[role="alert"] {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border: 0.0625rem solid var(--border);
  border-inline-start-width: var(--space-2);
  border-radius: var(--radius-medium);
  background: var(--background);
  font-size: var(--text-7);
}

[role="alert"]:is([data-variant="success"], [data-variant="warning"], [data-variant="danger"]) {
  border-width: 0 0 0 var(--space-2);
  border-inline-start-color: var(--_variant-color);
  background: color-mix(in srgb, var(--_variant-color) 8%, var(--white));
  color: var(--_variant-color);
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-6);
}

.table th {
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.0625rem solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--text-8);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-align: start;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.0625rem solid var(--border);
  vertical-align: middle;
}

.table .align-right {
  text-align: end;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--accent);
}

.num { font-variant-numeric: tabular-nums; }
.text-maroon { color: var(--brand-maroon); }
.text-sand { color: var(--brand-sand); }
.text-primary { color: var(--primary); }
.text-muted, .text-light { color: var(--muted-foreground); }
.text-caption { font-size: var(--text-8); font-weight: var(--weight-medium); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted-foreground); }
.bg-maroon { background-color: var(--brand-maroon); color: var(--white); }
.bg-sand { background-color: var(--brand-sand); color: var(--ink); }
.bg-paper { background-color: var(--faint); }
.fill-maroon { fill: var(--brand-maroon); }
.fill-sand { fill: var(--brand-sand); }
.stroke-maroon { stroke: var(--brand-maroon); }
.stroke-sand { stroke: var(--brand-sand); }

.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}
