@font-face {
  font-family: "Duevia Sans";
  src: url("/assets/UbuntuSans-Variable.37e90bba45a2.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Duevia Serif";
  src: url("/assets/NotoSerif-Regular.9d7583b7dc9e.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Duevia Serif";
  src: url("/assets/NotoSerif-Bold.0af0ff2be8f8.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Duevia Mono";
  src: url("/assets/UbuntuSansMono-Variable.507870a3fe57.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --panel: #f2f4f2;
  --panel-strong: #e8ecea;
  --paper: #fffefb;
  --ink: #182420;
  --ink-2: #42504b;
  --muted: #5f6b66;
  --line: #d9dfdb;
  --line-strong: #b7c1bc;
  --pine: #0b5b4c;
  --pine-dark: #07443a;
  --pine-wash: #e7f0ed;
  --amber: #9a5b12;
  --amber-wash: #f8efdd;
  --danger: #a83226;
  --danger-wash: #f9ebe8;
  --highlight: #fdf3c9;
  --highlight-edge: #e4c34b;
  --shadow-paper: 0 1px 2px rgba(24, 36, 32, 0.08), 0 10px 30px rgba(24, 36, 32, 0.09);
  --shadow-dialog: 0 24px 70px rgba(24, 36, 32, 0.28);
  --content: min(1240px, calc(100vw - 48px));
  --serif: "Duevia Serif", Georgia, serif;
  --sans: "Duevia Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Duevia Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 430;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-weight: 640;
  line-height: 1.14;
  letter-spacing: -0.022em;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--pine-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  color: var(--bg);
  background: var(--ink);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--ink);
  transform: translateY(-180%);
}

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

.container {
  width: var(--content);
  margin-inline: auto;
}

/* Small sans label used on legal pages and panels; deliberately not mono. */
.eyebrow,
.kicker {
  display: block;
  margin: 0 0 14px;
  color: var(--pine);
  font-size: 0.8rem;
  font-weight: 640;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Registrable facts: dates, pages, calculations, filenames. */
.fact {
  font-family: var(--mono);
  font-size: 0.84em;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.body-large {
  font-size: clamp(1.08rem, 1.35vw, 1.26rem);
  line-height: 1.55;
}

/* --- Date token: the recurring identity element ------------------------- */

.date-token {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--line-strong);
  font-family: var(--mono);
  line-height: 1;
}

.date-token > strong {
  font-size: 2.5rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.date-token > span {
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 520;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-token[data-state="proposed"] {
  border-bottom-color: var(--amber);
}

.date-token[data-state="confirmed"] {
  border-bottom-color: var(--pine);
}

.date-token[data-state="overdue"] {
  border-bottom-color: var(--danger);
}

/* --- State label: square node + text ------------------------------------ */

.state-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.state-label::before {
  width: 9px;
  height: 9px;
  flex: none;
  content: "";
  background: var(--line-strong);
}

.state-label[data-state="proposed"] {
  color: var(--amber);
}

.state-label[data-state="proposed"]::before {
  background: var(--amber);
}

.state-label[data-state="confirmed"],
.state-label[data-state="completed"] {
  color: var(--pine);
}

.state-label[data-state="confirmed"]::before,
.state-label[data-state="completed"]::before {
  background: var(--pine);
}

.state-label[data-state="rejected"],
.state-label[data-state="cancelled"] {
  color: var(--muted);
}

/* --- Document facsimile: the only place serif lives --------------------- */

.facsimile {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.facsimile__bar {
  display: flex;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 520;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facsimile__bar strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facsimile__body {
  padding: 26px 28px 30px;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.65;
}

.facsimile__body h2,
.facsimile__body h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0;
}

.facsimile__body p {
  margin: 0 0 12px;
}

.evidence-mark {
  padding: 0.08em 0.15em;
  background: var(--highlight);
  box-shadow: inset 0 -2px 0 var(--highlight-edge);
}

/* --- Trace line: evidence → action connector ----------------------------- */

.trace {
  position: relative;
  background: var(--ink);
}

.trace::before,
.trace::after {
  position: absolute;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--ink);
}

.trace--h {
  height: 2px;
  align-self: center;
}

.trace--h::before {
  top: -3.5px;
  left: -2px;
}

.trace--h::after {
  top: -3.5px;
  right: -2px;
}

.trace--v {
  width: 2px;
  justify-self: center;
}

.trace--v::before {
  top: -2px;
  left: -3.5px;
}

.trace--v::after {
  bottom: -2px;
  left: -3.5px;
}

/* --- Buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--bg);
  background: var(--ink);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.button:hover {
  color: var(--bg);
  background: #2c3a34;
}

.button--action {
  border-color: var(--pine);
  background: var(--pine);
}

.button--action:hover {
  border-color: var(--pine-dark);
  background: var(--pine-dark);
}

.button--ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.button--ghost:hover {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--ink);
}

.button--small {
  min-height: 40px;
  padding: 9px 16px;
  font-size: 0.9rem;
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.chain-tab {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-2);
  background: var(--bg);
  font-size: 0.88rem;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 130ms ease, color 130ms ease, border-color 130ms ease;
}

.chain-tab:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chain-tab[aria-selected="true"] {
  border-color: var(--ink);
  color: var(--bg);
  background: var(--ink);
}

.fact-list {
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
}

.fact-list > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: baseline;
  gap: 12px;
}

.fact-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 0;
  font-size: 0.92rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 620;
  text-decoration: none;
}

.link-arrow::after {
  content: "→";
  transition: transform 150ms ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* --- Site header ----------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 28px;
  height: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.site-nav a {
  position: relative;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 540;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--pine);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 140ms ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.language-link {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.language-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.menu-button span,
.menu-button::before,
.menu-button::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  content: "";
  background: currentColor;
}

/* --- Notices, forms, status ------------------------------------------------ */

.notice {
  padding: 13px 16px;
  border-left: 3px solid var(--amber);
  color: var(--ink-2);
  background: var(--amber-wash);
  font-size: 0.93rem;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 620;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  background: var(--bg);
}

.form-field textarea {
  min-height: 112px;
  resize: vertical;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  border-color: var(--pine);
  outline: 2px solid var(--pine);
  outline-offset: 0;
}

.form-field input:read-only {
  color: var(--ink-2);
  background: var(--panel);
}

.status-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.9rem;
}

.status-message[data-state="success"] {
  border-color: var(--pine);
  color: var(--pine);
  background: var(--pine-wash);
}

.status-message[data-state="error"] {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-wash);
}

/* --- Site footer ------------------------------------------------------------ */

.site-footer {
  margin-top: 96px;
  border-top: 2px solid var(--ink);
  background: var(--panel);
}

.site-footer__inner {
  display: grid;
  padding: 56px 0 36px;
  grid-template-columns: 1.5fr 0.8fr 0.8fr;
  gap: 48px;
}

.site-footer__statement {
  max-width: 26ch;
  margin: 18px 0 10px;
  font-size: 1.35rem;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.site-footer__primary > a {
  color: var(--ink-2);
  font-size: 0.92rem;
}

.site-footer__column {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 9px;
}

.site-footer__column h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 640;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-footer__column a {
  color: var(--ink);
  font-size: 0.94rem;
  text-decoration: none;
}

.site-footer__column a:hover {
  color: var(--pine);
  text-decoration: underline;
}

.site-footer__base {
  display: flex;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  :root {
    --content: min(100% - 32px, 760px);
  }

  .site-header__inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    position: fixed;
    inset: 69px 0 auto;
    display: none;
    padding: 22px 20px 30px;
    border-bottom: 1px solid var(--line);
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    background: var(--bg);
    box-shadow: 0 24px 40px rgba(24, 36, 32, 0.12);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a {
    font-size: 1.05rem;
  }

  .site-header__actions .button {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  :root {
    --content: calc(100vw - 28px);
  }

  body {
    font-size: 16px;
  }

  .date-token > strong {
    font-size: 2.1rem;
  }

  .site-footer__inner {
    padding-top: 44px;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .site-footer__primary {
    grid-column: auto;
  }

  .site-footer__base {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
