/* Sleipnir — hand-authored identity.
   Drafting-desk aesthetic: warm paper, ink, one drafting-blue accent.
   Borders over shadows, 2px radii, dense tables, tabular figures. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("/fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --ink: #1d1c19;
  --ink-2: #55524a;
  --line: #c9c3b6;
  --blue: #1e4fa3;
  --blue-ink: #163a78;
  --ok: #2f6b3a;
  --warn: #a35a1e;
  --radius: 2px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

code, .mono, td.id, td.num { font-family: "Fragment Mono", ui-monospace, monospace; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top rule */
header.top {
  display: flex; align-items: baseline; gap: 14px;
  padding: 14px 22px;
  border-bottom: 2px solid var(--ink);
}
header.top .brand {
  font-family: "Fraunces", serif;
  font-weight: 620;
  font-size: 22px;
  letter-spacing: 0.2px;
}
header.top .brand small { color: var(--ink-2); font-weight: 400; font-size: 13px; margin-left: 8px; }
header.top nav { margin-left: auto; display: flex; gap: 16px; font-size: 14px; }
header.top nav a { color: var(--ink-2); }
header.top nav a.active { color: var(--ink); border-bottom: 2px solid var(--blue); }

main { max-width: 1060px; margin: 0 auto; padding: 26px 22px 60px; }

h1 { font-family: "Fraunces", serif; font-weight: 600; font-size: 30px; margin: 6px 0 4px; }
h2 { font-family: "Fraunces", serif; font-weight: 560; font-size: 21px; margin: 26px 0 8px; }
p.lede { color: var(--ink-2); max-width: 66ch; margin: 4px 0 20px; }

/* dense tables */
table {
  width: 100%; border-collapse: collapse;
  border: 1px solid var(--line); background: #fffdf8;
  font-size: 13.5px;
}
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-2); border-bottom: 2px solid var(--ink); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
tr:hover td { background: #f7f3ea; }
td.id { color: var(--ink-2); white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.status { display: inline-block; padding: 1px 7px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; background: var(--paper-2); color: var(--ink-2); }
.status.active { border-color: var(--blue); color: var(--blue-ink); background: #eef3fb; }
.status.done { border-color: var(--ok); color: var(--ok); background: #eef6ef; }

/* forms */
form.stack { max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
label { font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  font: inherit; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fffdf8; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

button {
  font: inherit; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--blue-ink); background: var(--blue); color: #fff; font-weight: 600;
}
button:hover { background: var(--blue-ink); }
button.ghost { background: transparent; color: var(--blue-ink); border-color: var(--line); }

/* cards are flat, single border, no nesting */
.panel { border: 1px solid var(--line); background: #fffdf8; border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.panel h2 { margin-top: 0; }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 16px 22px; color: var(--ink-2); font-size: 13px; display: flex; gap: 18px; }
footer .mono { margin-left: auto; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }

.notice { border-left: 3px solid var(--warn); background: #f7efe2; padding: 10px 14px; font-size: 14px; }

/* --- polish & micro-motion (hand-tuned, no framework) --- */
:root { color-scheme: light; }
::selection { background: #1e4fa3; color: #f4f1ea; }
a { transition: color .15s ease; }
button { transition: background-color .15s ease, border-color .15s ease, transform .06s ease, box-shadow .15s ease; }
button:hover:not(:disabled) { box-shadow: 0 1px 0 rgba(29,28,25,.25); }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #1e4fa3; outline-offset: 2px;
}
input, textarea, select { transition: border-color .15s ease, background-color .15s ease; }
input:hover, textarea:hover, select:hover { border-color: #a9a192; }
td, th { transition: background-color .12s ease; }
header.top nav a { position: relative; }
header.top nav a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 2px; width: 100%;
  background: #1e4fa3; transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
header.top nav a:hover:not(.active)::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
