/* Dalmanutha app. Same tokens as the marketing site so the two read as one
   product; the layout is denser because this one is used, not read once. */

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader.woff2') format('woff2-variations');
  font-weight: 200 700; font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('/assets/fonts/inter.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
}

:root {
  --paper: #FCF8F4;
  --paper-2: #F6F1EA;
  --ink: #0D3829;
  --deep: #0E2528;
  --sage: #646D63;
  --muted: #4C5B50;
  --hair: rgba(13, 56, 41, .14);
  --hair-2: rgba(13, 56, 41, .07);
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'InterVar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1060px;
  --pad: 24px;
  --r: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--muted);
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 300; margin: 0; line-height: 1.2; }
p { margin: 0; }
button { font-family: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(a, button, input):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: .25; animation: pulse 1.1s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .8; transform: scale(1.35); } }

.overline {
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sage); padding-left: .18em;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  font-size: 13px; font-weight: 500; padding: 11px 20px; border-radius: 100px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: #0A2C20; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn-ghost:hover { background: transparent; border-color: var(--ink); }

/* ── gate ─────────────────────────────────────────────────────────────────── */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; }
.gate::before {
  content: ''; position: absolute; inset: 0;
  background: url('/assets/img/scene-dark.webp') center/cover no-repeat;
  opacity: .1;
}
.gate-card { position: relative; width: 100%; max-width: 380px; text-align: center; }
.gate-mark { width: auto; height: 46px; margin: 0 auto 22px; }
.gate h1 { font-size: 1.5rem; margin-bottom: 8px; }
.gate p { font-size: 14px; margin-bottom: 26px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate input {
  font-family: var(--sans); font-size: 16px; text-align: center;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 16px; border: 1px solid var(--hair); border-radius: 100px;
  background: transparent; color: var(--ink); min-width: 0;
}
.gate input::placeholder { color: var(--sage); letter-spacing: .08em; text-transform: none; }
.gate input:focus { outline: none; border-color: var(--ink); }
.gate-msg { min-height: 20px; font-size: 13px; color: #9C4B36; margin-top: 12px; }
.gate-foot { margin-top: 26px; font-size: 12.5px; color: var(--sage); }
.gate-foot a { color: var(--ink); }

/* ── chrome ───────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(252, 248, 244, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair-2);
}
.top-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; }
.brand img { width: auto; height: 28px; }
.brand span { font-family: var(--serif); font-size: 16px; color: var(--ink); transform: translateY(.16em); }
.tabs { display: flex; gap: 4px; }
.tab {
  background: none; border: 0; cursor: pointer; font-size: 13px; color: var(--muted);
  padding: 8px 12px; border-radius: 100px; transition: background .2s var(--ease), color .2s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-on { background: rgba(13, 56, 41, .07); color: var(--ink); }
.top-out { background: none; border: 0; cursor: pointer; font-size: 12.5px; color: var(--sage); padding: 8px; }
.top-out:hover { color: var(--ink); }

.view { padding: 40px 0 90px; }
.view-head { margin-bottom: 28px; }
.view-head h2 { font-size: 1.45rem; margin: 8px 0 6px; }
.view-head p { font-size: 14px; max-width: 60ch; }

/* ── feed ─────────────────────────────────────────────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  background: none; border: 1px solid var(--hair); border-radius: 100px;
  font-size: 12px; padding: 6px 13px; cursor: pointer; color: var(--muted);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: rgba(13, 56, 41, .32); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.items { display: flex; flex-direction: column; }
.item { padding: 22px 0; border-top: 1px solid var(--hair); }
.item:first-child { border-top: 0; padding-top: 0; }
.item-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.kind {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--hair); border-radius: 100px; padding: 3px 9px; color: var(--ink);
}
.kind[data-k="funding"] { border-color: rgba(13,56,41,.32); }
.kind[data-k="research"] { background: rgba(13,56,41,.06); }
.item-when { font-size: 11.5px; color: var(--sage); margin-left: auto; }
.item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.item-body { font-size: 14px; }
.item-links { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; }
.item-links a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); }
.item-links a:hover { border-bottom-color: var(--ink); }

/* ── projects ─────────────────────────────────────────────────────────────── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.pcard { background: var(--paper); padding: 22px 20px; cursor: pointer; text-align: left; border: 0; width: 100%; font-family: inherit; transition: background .2s var(--ease); }
.pcard:hover { background: var(--paper-2); }
.pcard-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.pcard h3 { font-size: 1.05rem; }
.pscore { margin-left: auto; font-family: var(--serif); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pmeta { font-size: 11.5px; color: var(--sage); margin-bottom: 10px; }
.pcard p { font-size: 13.5px; }

.detail { max-width: 720px; }
.back { background: none; border: 0; cursor: pointer; font-size: 12.5px; color: var(--sage); padding: 0 0 18px; }
.back:hover { color: var(--ink); }
.detail h2 { font-size: 1.7rem; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--sage); margin-bottom: 22px; }
.verdict { border-left: 2px solid var(--ink); padding: 4px 0 4px 16px; margin-bottom: 24px; font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.scores { margin: 26px 0; }
.srow { display: grid; grid-template-columns: 130px 1fr 40px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--hair-2); font-size: 13px; }
.sbar { height: 2px; background: var(--hair); position: relative; }
.sbar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.sval { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.detail h3 { font-size: 1rem; margin: 24px 0 8px; }
.detail p { font-size: 14.5px; margin-bottom: 12px; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.empty { padding: 56px 0; text-align: center; }
.empty h3 { font-size: 1.1rem; margin-bottom: 8px; }
.empty p { font-size: 14px; color: var(--sage); }
.err { color: #9C4B36; font-size: 14px; }

@media (max-width: 700px) {
  :root { --pad: 18px; }
  .top-in { height: 56px; gap: 10px; }
  .brand span { display: none; }
  .tab { padding: 8px 10px; font-size: 12.5px; }
  .view { padding: 28px 0 70px; }
  .pgrid { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 96px 1fr 36px; gap: 10px; font-size: 12.5px; }
}

/* Score-bar widths as classes. A strict style-src blocks BOTH style=""
   attributes and el.style.width, so the only CSP-clean way to draw a value is
   to have the value in the stylesheet. 0-100 in whole percent. */
.sbar i.w0 { width: 0%; }
.sbar i.w1 { width: 1%; }
.sbar i.w2 { width: 2%; }
.sbar i.w3 { width: 3%; }
.sbar i.w4 { width: 4%; }
.sbar i.w5 { width: 5%; }
.sbar i.w6 { width: 6%; }
.sbar i.w7 { width: 7%; }
.sbar i.w8 { width: 8%; }
.sbar i.w9 { width: 9%; }
.sbar i.w10 { width: 10%; }
.sbar i.w11 { width: 11%; }
.sbar i.w12 { width: 12%; }
.sbar i.w13 { width: 13%; }
.sbar i.w14 { width: 14%; }
.sbar i.w15 { width: 15%; }
.sbar i.w16 { width: 16%; }
.sbar i.w17 { width: 17%; }
.sbar i.w18 { width: 18%; }
.sbar i.w19 { width: 19%; }
.sbar i.w20 { width: 20%; }
.sbar i.w21 { width: 21%; }
.sbar i.w22 { width: 22%; }
.sbar i.w23 { width: 23%; }
.sbar i.w24 { width: 24%; }
.sbar i.w25 { width: 25%; }
.sbar i.w26 { width: 26%; }
.sbar i.w27 { width: 27%; }
.sbar i.w28 { width: 28%; }
.sbar i.w29 { width: 29%; }
.sbar i.w30 { width: 30%; }
.sbar i.w31 { width: 31%; }
.sbar i.w32 { width: 32%; }
.sbar i.w33 { width: 33%; }
.sbar i.w34 { width: 34%; }
.sbar i.w35 { width: 35%; }
.sbar i.w36 { width: 36%; }
.sbar i.w37 { width: 37%; }
.sbar i.w38 { width: 38%; }
.sbar i.w39 { width: 39%; }
.sbar i.w40 { width: 40%; }
.sbar i.w41 { width: 41%; }
.sbar i.w42 { width: 42%; }
.sbar i.w43 { width: 43%; }
.sbar i.w44 { width: 44%; }
.sbar i.w45 { width: 45%; }
.sbar i.w46 { width: 46%; }
.sbar i.w47 { width: 47%; }
.sbar i.w48 { width: 48%; }
.sbar i.w49 { width: 49%; }
.sbar i.w50 { width: 50%; }
.sbar i.w51 { width: 51%; }
.sbar i.w52 { width: 52%; }
.sbar i.w53 { width: 53%; }
.sbar i.w54 { width: 54%; }
.sbar i.w55 { width: 55%; }
.sbar i.w56 { width: 56%; }
.sbar i.w57 { width: 57%; }
.sbar i.w58 { width: 58%; }
.sbar i.w59 { width: 59%; }
.sbar i.w60 { width: 60%; }
.sbar i.w61 { width: 61%; }
.sbar i.w62 { width: 62%; }
.sbar i.w63 { width: 63%; }
.sbar i.w64 { width: 64%; }
.sbar i.w65 { width: 65%; }
.sbar i.w66 { width: 66%; }
.sbar i.w67 { width: 67%; }
.sbar i.w68 { width: 68%; }
.sbar i.w69 { width: 69%; }
.sbar i.w70 { width: 70%; }
.sbar i.w71 { width: 71%; }
.sbar i.w72 { width: 72%; }
.sbar i.w73 { width: 73%; }
.sbar i.w74 { width: 74%; }
.sbar i.w75 { width: 75%; }
.sbar i.w76 { width: 76%; }
.sbar i.w77 { width: 77%; }
.sbar i.w78 { width: 78%; }
.sbar i.w79 { width: 79%; }
.sbar i.w80 { width: 80%; }
.sbar i.w81 { width: 81%; }
.sbar i.w82 { width: 82%; }
.sbar i.w83 { width: 83%; }
.sbar i.w84 { width: 84%; }
.sbar i.w85 { width: 85%; }
.sbar i.w86 { width: 86%; }
.sbar i.w87 { width: 87%; }
.sbar i.w88 { width: 88%; }
.sbar i.w89 { width: 89%; }
.sbar i.w90 { width: 90%; }
.sbar i.w91 { width: 91%; }
.sbar i.w92 { width: 92%; }
.sbar i.w93 { width: 93%; }
.sbar i.w94 { width: 94%; }
.sbar i.w95 { width: 95%; }
.sbar i.w96 { width: 96%; }
.sbar i.w97 { width: 97%; }
.sbar i.w98 { width: 98%; }
.sbar i.w99 { width: 99%; }
.sbar i.w100 { width: 100%; }
.chip-n { opacity: .6; }

/* ── account creation ─────────────────────────────────────────────────────── */
.profile { max-width: 400px; }
.profile h1 { font-size: 1.35rem; }
.field { display: block; text-align: left; position: relative; }
.field-l {
  display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sage); margin-bottom: 6px; padding-left: 2px;
}
.field-l em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: .75; }
.field input {
  width: 100%; font-family: var(--sans); font-size: 16px; text-align: left;
  letter-spacing: 0; text-transform: none;
  padding: 11px 15px; border: 1px solid var(--hair); border-radius: 100px;
  background: transparent; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--ink); }
.field input.has-prefix { padding-left: 30px; }
/* The @ sits inside the field, so nobody types a second one. */
.field-p {
  position: absolute; left: 15px; bottom: 11px; color: var(--sage);
  font-size: 16px; pointer-events: none;
}
.field:has(.field-h) .field-p { bottom: 33px; }
.field-h { display: block; font-size: 11.5px; color: var(--sage); margin: 5px 0 0 2px; }
.profile .gate-form { gap: 14px; }
.profile .btn { margin-top: 4px; }
.who { font-size: 12.5px; color: var(--sage); }

@media (max-width: 700px) {
  .who { display: none; }
}

/* Sign-in mode */
.gate input.plain { letter-spacing: 0; text-transform: none; text-align: center; }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--ink); text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { opacity: .75; }
.gate-msg.ok { color: var(--sage); }
.gate-foot { line-height: 1.9; }

/* Password strength meter. Advisory; the server decides. */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-bar { flex: 1; height: 2px; background: var(--hair); position: relative; border-radius: 2px; }
.pw-bar::after {
  content: ''; position: absolute; inset: 0 auto 0 0; border-radius: 2px;
  transition: width .25s var(--ease), background .25s var(--ease);
  width: 0; background: var(--ink);
}
.pw-bar.s1::after { width: 25%; background: #9C4B36; }
.pw-bar.s2::after { width: 50%; background: #8a6d1f; }
.pw-bar.s3::after { width: 75%; background: #4C5B50; }
.pw-bar.s4::after { width: 100%; background: var(--ink); }
.pw-word { font-size: 11px; color: var(--sage); min-width: 52px; text-align: right; }

/* Gate spacing: the empty status line used to reserve 20px plus two margins,
   leaving 58px of dead air between the button and the footer. */
.gate-msg { min-height: 0; margin-top: 10px; }
.gate-msg:empty { margin-top: 0; }
.gate-foot { margin-top: 18px; }

/* Profile */
.who {
  background: none; border: 0; cursor: pointer; font: inherit;
  font-size: 12.5px; color: var(--sage); padding: 6px 8px; border-radius: 100px;
}
.who:hover { color: var(--ink); background: rgba(13, 56, 41, .06); }
.pform { display: flex; flex-direction: column; gap: 14px; max-width: 420px; margin: 18px 0 34px; }
.pform .btn { align-self: flex-start; }
.detail h3 { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--hair); }
.danger-h { color: #9C4B36; }
.danger p { font-size: 13.5px; max-width: 52ch; }
.btn-danger { background: #9C4B36; border-color: #9C4B36; }
.btn-danger:hover { background: #8a4230; }
.gate-msg.ok { color: var(--sage); }

/* A locked field. Cosmetic only — the API is what refuses the change. */
.field input.locked {
  background: rgba(13, 56, 41, .04);
  color: var(--sage);
  cursor: default;
}
.field input.locked:focus { border-color: var(--hair); }
