/* Line Three app: one stylesheet. Colour, type and space are linethree-web's design
   tokens (src/styles/tokens.css), copied so the app matches https://linethree.ai.
   Fonts are self-hosted (OFL-1.1, licences alongside them in /static/fonts). */

@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/static/fonts/newsreader-latin-opsz-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/static/fonts/inter-latin-opsz-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/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('/static/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --paper: #f6f3ec;
  --paper-2: #eee9de;
  --ink: #0f1b2d;
  --ink-3: #1b2d47;
  --text: #0f1b2d;
  --text-soft: #3f4856;
  --rule: rgb(15 27 45 / 0.14);
  --rule-strong: rgb(15 27 45 / 0.28);
  --on-ink: #ece7dc;
  --rule-ink-strong: rgb(236 231 220 / 0.24);
  --accent: #d08a2e;
  --accent-text: #8a5210;
  --neg: #9c2f1f;
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-heading: clamp(1.875rem, 1.3rem + 1.9vw, 2.75rem);
  --fs-subheading: 1.375rem;
  --fs-body: 1.125rem;
  --fs-small: 1rem;
  --fs-label: 0.875rem;
  --fs-code: 0.9375rem;
  --fw-label: 500;
  --measure: 60ch;
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2.25rem;
  --s-7: 3.5rem;
  --s-8: 5rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) var(--gutter);
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 2px solid var(--accent);
}
header.top .brand { font-family: var(--serif); font-size: var(--fs-subheading); color: var(--on-ink); text-decoration: none; }
header.top nav { display: flex; align-items: center; gap: var(--s-5); font-size: var(--fs-small); }
header.top nav a { color: var(--on-ink); text-decoration: none; }
header.top nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
header.top form { margin: 0; }
header.top button {
  background: none;
  color: var(--on-ink);
  border: 1px solid var(--rule-ink-strong);
  padding: var(--s-1) var(--s-3);
  font-size: var(--fs-label);
}
header.top button:hover { background: var(--ink-3); }

main { max-width: calc(1100px + var(--gutter) * 2); margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-8); }

h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-heading); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 var(--s-6); }
h2 { font-family: var(--serif); font-weight: 450; font-size: var(--fs-subheading); line-height: 1.2; margin: var(--s-7) 0 var(--s-4); }
p { max-width: var(--measure); margin: 0 0 var(--s-4); }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.22em; }
code { font-family: var(--mono); font-size: var(--fs-code); }

dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-6); margin: 0 0 var(--s-5); }
dt { color: var(--text-soft); font-size: var(--fs-small); }
dd { margin: 0; }

table { width: 100%; border-collapse: collapse; margin: var(--s-5) 0; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
th { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule-strong); color: var(--text-soft); font-size: var(--fs-label); font-weight: var(--fw-label); }
td { padding: var(--s-3); border-bottom: 1px solid var(--rule); vertical-align: top; }

form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-4); margin: 0 0 var(--s-5); }
label { display: flex; flex-direction: column; gap: var(--s-1); color: var(--text-soft); font-size: var(--fs-label); font-weight: var(--fw-label); }
input, select {
  min-width: 16rem;
  padding: var(--s-2) var(--s-3);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs-small);
}
button {
  padding: var(--s-2) var(--s-5);
  color: var(--on-ink);
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
header.top :focus-visible { outline-color: var(--accent); }

td form { margin: 0; }
td button { padding: var(--s-1) var(--s-3); color: var(--neg); background: none; border: 1px solid currentColor; font-size: var(--fs-label); }
td button:hover { background: var(--paper-2); }

[role='alert'] { max-width: var(--measure); padding: var(--s-3) var(--s-4); color: var(--neg); background: var(--paper-2); border-left: 3px solid var(--neg); }

section { margin: 0 0 var(--s-5); padding: var(--s-5); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
section h2 { margin-top: 0; }

#new-key-value, #totp-secret, #new-user-password {
  display: block;
  padding: var(--s-3) var(--s-4);
  color: var(--on-ink);
  background: var(--ink);
  border-radius: var(--radius);
  word-break: break-all;
}

body.auth main { max-width: calc(28rem + var(--gutter) * 2); }
body.auth form { flex-direction: column; align-items: stretch; }
body.auth input { min-width: 0; width: 100%; }
