/* Diaspora Skills Registry — shared stylesheet.
   System fonts only: the Content-Security-Policy blocks remote font loading,
   and a government demo should not depend on a CDN being reachable. */

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

:root {
  --ink:        #0c0f0d;
  --ink-2:      #131815;
  --surface:    #1a211c;
  --surface-2:  #212a23;
  --line:       #2e3a31;
  --line-soft:  #252f28;

  --text:       #e9ede9;
  --text-dim:   #a8b3aa;
  --text-faint: #76817a;

  --gold:       #d4af37;
  --gold-dim:   #8a7328;
  --green:      #2f9e5f;
  --red:        #c0392b;
  --amber:      #d98c2b;

  --accent:     var(--gold);

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --radius: 4px;
  --max: 1180px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }

p { max-width: 68ch; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 760px; }

/* --- the band that must appear wherever this could be mistaken for a visa --- */
.notice {
  border: 1px solid var(--gold-dim);
  background: rgba(212, 175, 55, 0.07);
  border-left: 3px solid var(--gold);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: #e6dcc0;
}
.notice strong { color: var(--gold); }
.notice.stern {
  border-color: #7a3730;
  border-left-color: var(--red);
  background: rgba(192, 57, 43, 0.08);
  color: #f0d6d2;
}
.notice.stern strong { color: #e8897c; }
.notice + .notice { margin-top: 0.75rem; }

/* --- masthead ------------------------------------------------------------- */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  position: sticky; top: 0; z-index: 50;
}
.masthead-inner {
  max-width: var(--max); margin: 0 auto; padding: 0.85rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.crest {
  display: flex; align-items: center; gap: 0.7rem;
  font-weight: 600; letter-spacing: -0.01em; color: var(--text);
}
.crest:hover { text-decoration: none; }
.crest-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--green) 66% 100%);
  flex: none; position: relative;
}
.crest-mark::after {
  content: ''; position: absolute; inset: 6px;
  border-radius: 50%; background: var(--ink-2);
}
.crest-text { display: flex; flex-direction: column; line-height: 1.15; }
.crest-text small {
  font-size: 0.68rem; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500;
}
.masthead nav { margin-left: auto; display: flex; gap: 1.3rem; align-items: center; }
.masthead nav a { color: var(--text-dim); font-size: 0.88rem; }
.masthead nav a:hover, .masthead nav a[aria-current] { color: var(--text); text-decoration: none; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--gold); color: #1a1407; border: 1px solid var(--gold);
  padding: 0.65rem 1.25rem; border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 0.93rem;
  cursor: pointer; transition: filter 0.15s, background 0.15s;
  text-align: center;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-faint); }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.82rem; }

/* --- cards & panels ------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.panel h3 { margin-bottom: 0.6rem; }

.grid { display: grid; gap: 1rem; }
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four  { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- stat tiles ----------------------------------------------------------- */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.stat .value {
  font-size: 1.95rem; font-weight: 650; letter-spacing: -0.02em;
  color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat .label {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-faint); margin-top: 0.3rem; font-weight: 500;
}
.stat .sub { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.4rem; }

/* --- forms ---------------------------------------------------------------- */
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); margin-bottom: 0.35rem; }
label .req { color: var(--gold); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], select, textarea {
  width: 100%; background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.6rem 0.75rem; font: inherit; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(212, 175, 55, 0.4); outline-offset: -1px;
  border-color: var(--gold-dim);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
select { appearance: none; background-image: none; cursor: pointer; }

.field { margin-bottom: 1.1rem; }
.field .hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.3rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* chip-style multi and single select */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid var(--line); background: var(--ink);
  color: var(--text-dim); border-radius: 100px;
  padding: 0.42rem 0.9rem; font-size: 0.86rem; cursor: pointer;
  font: inherit; font-size: 0.86rem; transition: 0.13s;
}
.chip:hover { border-color: var(--text-faint); color: var(--text); }
.chip[aria-pressed=true] {
  background: rgba(212, 175, 55, 0.14); border-color: var(--gold);
  color: var(--gold); font-weight: 550;
}

.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 0.22rem; accent-color: var(--gold); flex: none; }
.check span { font-size: 0.92rem; color: var(--text); }

/* --- tables --------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  background: var(--ink-2); text-align: left; padding: 0.7rem 0.85rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
tbody td { padding: 0.68rem 0.85rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- badges --------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 0.14rem 0.5rem; border-radius: 3px;
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.new         { background: rgba(168,179,170,0.14); color: #b9c3bb; }
.badge.screened    { background: rgba(47,158,95,0.14);  color: #6fcf97; }
.badge.shortlisted { background: rgba(212,175,55,0.16); color: var(--gold); }
.badge.matched     { background: rgba(47,158,95,0.2);   color: #7ddba2; }
.badge.deployed    { background: var(--green); color: #07140c; }
.badge.declined    { background: rgba(192,57,43,0.16);  color: #e8897c; }
.badge.withdrawn   { background: rgba(118,129,122,0.14); color: var(--text-faint); }

.badge.strong    { background: var(--green); color: #07140c; }
.badge.promising { background: rgba(47,158,95,0.2); color: #7ddba2; }
.badge.possible  { background: rgba(217,140,43,0.18); color: #e0a561; }
.badge.weak      { background: rgba(118,129,122,0.16); color: var(--text-faint); }

.badge.blocked { background: rgba(192,57,43,0.18); color: #e8897c; }
.badge.ok      { background: rgba(47,158,95,0.16); color: #6fcf97; }

.mono { font-family: var(--mono); font-size: 0.86em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* --- score bar ------------------------------------------------------------ */
.score { display: flex; align-items: center; gap: 0.55rem; }
.score-bar {
  width: 54px; height: 5px; border-radius: 3px;
  background: var(--line); overflow: hidden; flex: none;
}
.score-bar i { display: block; height: 100%; background: var(--gold); }
.score-num { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.85rem; min-width: 2ch; }

/* --- misc ----------------------------------------------------------------- */
.section { padding: 3.5rem 0; }
.section.tight { padding: 2.2rem 0; }
.eyebrow {
  font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--gold); font-weight: 600; margin-bottom: 0.7rem;
}
.rule { height: 1px; background: var(--line); border: 0; margin: 2rem 0; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.loading { color: var(--text-faint); font-size: 0.9rem; padding: 1.5rem 0; }
.error {
  color: #f0d6d2; background: rgba(192,57,43,0.12);
  border: 1px solid #7a3730; border-radius: var(--radius);
  padding: 0.7rem 0.9rem; font-size: 0.89rem;
}
.empty { color: var(--text-faint); padding: 2.5rem 1rem; text-align: center; font-size: 0.92rem; }

footer.site {
  border-top: 1px solid var(--line); margin-top: 4rem;
  padding: 2rem 0 3rem; color: var(--text-faint); font-size: 0.85rem;
}
footer.site .wrap > * + * { margin-top: 0.6rem; }

/* --- demo watermark: this build must never be mistaken for the real thing -- */
.demo-flag {
  background: repeating-linear-gradient(45deg, rgba(192,57,43,0.16) 0 10px, rgba(192,57,43,0.08) 10px 20px);
  border-bottom: 1px solid #7a3730;
  color: #f3cec8; font-size: 0.78rem; text-align: center;
  padding: 0.4rem 1rem; letter-spacing: 0.03em; font-weight: 550;
}

@media (max-width: 640px) {
  .masthead-inner { gap: 0.8rem; }
  .masthead nav { gap: 0.9rem; width: 100%; margin-left: 0; }
  .section { padding: 2.5rem 0; }
  .panel { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
