:root {
  color-scheme: light dark;
  --ink: #14243a;
  --muted: #546476;
  --surface: #fbfaf7;
  --card: #ffffff;
  --line: #d9dee3;
  --brand: #0b4a61;
  --brand-ink: #ffffff;
  --accent: #805916;
  --danger: #9f2d38;
  --success: #176b50;
  --focus: #0086b3;
  --shadow: 0 20px 50px rgb(20 36 58 / 10%);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

a { color: var(--brand); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .13em; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: .5rem;
  left: .5rem;
  padding: .65rem .85rem;
  border-radius: .5rem;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-160%);
  transition: transform 140ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.nav,
.page,
.site-footer {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.025em;
  text-decoration: none;
}

.nav-links { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.nav-links a { min-height: 2.75rem; display: inline-flex; align-items: center; }

.page { padding-block: clamp(2.75rem, 7vw, 6rem); }
.prose { max-width: 72ch; }

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2 { line-height: 1.15; letter-spacing: -.035em; text-wrap: balance; }
h1 { margin: 0 0 1rem; font-size: clamp(2.25rem, 7vw, 4.5rem); }
h2 { margin: 2.75rem 0 .75rem; font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { margin: 1.75rem 0 .5rem; font-size: 1.05rem; }
p, ul { margin-block: .75rem; }
li + li { margin-top: .45rem; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.updated { color: var(--muted); font-size: .92rem; }

.notice {
  margin-block: 2rem;
  padding: 1rem 1.15rem;
  border-left: .25rem solid var(--accent);
  border-radius: .25rem .75rem .75rem .25rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

.auth-shell { max-width: 34rem; margin-inline: auto; }
.auth-card {
  padding: clamp(1.35rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.field { margin-block: 1.1rem; }
.field-row { display: flex; align-items: end; gap: .65rem; }
.field-grow { flex: 1; }
label { display: block; margin-bottom: .4rem; font-weight: 700; }
input {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input[aria-invalid="true"] { border-color: var(--danger); }

button {
  min-height: 3rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: .65rem;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms var(--ease-out), background-color 180ms var(--ease-out);
}
button.secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); }
button:active { transform: scale(.98); }
button:disabled { cursor: wait; opacity: .65; }
.submit { width: 100%; margin-top: .5rem; }

.hint,
.field-error { margin: .4rem 0 0; font-size: .9rem; }
.hint { color: var(--muted); }
.field-error { color: var(--danger); }
.status { min-height: 1.65rem; margin-top: 1rem; font-weight: 700; }
.status[data-kind="error"] { color: var(--danger); }
.status[data-kind="success"] { color: var(--success); }
[hidden] { display: none !important; }

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

@media (hover: hover) and (pointer: fine) {
  button:hover { background: color-mix(in srgb, var(--brand) 88%, white); }
  button.secondary:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
}

@media (max-width: 35rem) {
  .nav { align-items: flex-start; flex-direction: column; padding-block: .75rem; }
  .field-row { align-items: stretch; flex-direction: column; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edf3f7;
    --muted: #aebbc7;
    --surface: #0d1724;
    --card: #142131;
    --line: #344356;
    --brand: #66c8df;
    --brand-ink: #08151d;
    --accent: #e0b760;
    --danger: #ff9ba3;
    --success: #70d6b3;
    --focus: #7eddf3;
    --shadow: 0 20px 50px rgb(0 0 0 / 30%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { width: 100%; padding: 0; }
  a { color: inherit; }
}
