/* Signet ID — registry/passport design system.
   Spectral (serif) for anything that reads as a document; Public Sans for the
   interface; IBM Plex Mono for identifiers. Indigo ink on warm paper, one
   vermilion wax-stamp accent reserved for authority marks. */

@font-face { font-family: 'Spectral'; src: url('/assets/fonts/Spectral-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('/assets/fonts/Spectral-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('/assets/fonts/Spectral-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/assets/fonts/PublicSans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/assets/fonts/PublicSans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/assets/fonts/PublicSans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/assets/fonts/PublicSans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/IBMPlexMono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/IBMPlexMono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 10px; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 4px; z-index: 10; border: 1px solid var(--hair); }
:root {
  color-scheme: light;
  --paper: #F7F5EF;
  --card: #FFFEFA;
  --ink: #20223F;
  --indigo: #2A2F63;
  --muted: #666B85;
  --dim: #8B90A8;
  --hair: #E2DED2;
  --seal: #A8382B;
  --seal-ink: #8C2C21;
  --ok: #2F6B4F;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16121F;
  --card: #1F1A2E;
  --ink: #ECE8F7;
  --indigo: #BBB6E8;
  --muted: #A79FC0;
  --dim: #7E7699;
  --hair: #342F4C;
  --seal: #C9543F;
  --seal-ink: #E5745C;
  --ok: #66C494;
}
* { box-sizing: border-box; }
body { margin: 0; background:
  linear-gradient(180deg, rgba(42, 47, 99, .035), rgba(42, 47, 99, 0) 220px),
  var(--paper);
  color: var(--ink); font: 400 15px/1.6 'Public Sans', system-ui, sans-serif;
  transition: background-color .25s ease, color .25s ease; }
a { color: var(--indigo); text-decoration: underline; text-decoration-color: rgba(42, 47, 99, .3); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--seal); color: var(--seal-ink); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 22px; }
.wrap.wide { max-width: 1120px; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.card, .pagehead, .auth-card { animation: rise .4s ease backwards; }
.card:nth-of-type(2) { animation-delay: .05s; }
.card:nth-of-type(3) { animation-delay: .1s; }

/* ---- masthead / chrome ---- */

.masthead { background: var(--card); border-bottom: 1px solid var(--hair); }
.band { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-mark { font: 600 19px 'Spectral', serif; letter-spacing: .01em; }
.brand-dot { color: var(--seal); }
.brand-sub { color: var(--dim); font-size: 12px; }
.seal { width: 34px; height: 34px; color: var(--seal); flex: none; }
.appnav { display: flex; gap: 4px; flex-wrap: wrap; }
.appnav a { color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 6px; font-size: 14.5px; transition: background .15s ease, color .15s ease; }
.appnav a:hover { background: rgba(42, 47, 99, .06); color: var(--ink); }
.appnav a[aria-current="page"] { background: rgba(168, 56, 43, .1); color: var(--seal-ink); }
.who { display: flex; align-items: center; gap: 12px; }
.who-mail { color: var(--dim); }
.linklike { background: none; border: none; color: var(--indigo); font: inherit; font-size: 14px; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: rgba(42, 47, 99, .3); }
.linklike:hover { color: var(--seal-ink); }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--hair); background: var(--card); color: var(--muted); cursor: pointer;
  transition: color .18s ease, border-color .18s ease, transform .12s ease, background-color .25s ease; }
.theme-toggle:hover { color: var(--seal-ink); border-color: var(--seal); transform: translateY(-1px); }
.theme-toggle:active { transform: none; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .ic-moon { display: none; fill: currentColor; stroke: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
.appnav a { position: relative; }
.appnav a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.appnav a:hover::after { transform: scaleX(1); }
.auth-head .theme-toggle { margin-left: auto; }
.stamp { display: inline-block; font: 600 11.5px 'Public Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--seal); border-radius: 999px; padding: 3px 10px; }
.stamp.small { font-size: 10.5px; padding: 2px 8px; background: var(--seal); }
.stamp.outline { background: none; color: var(--seal-ink); border: 1px solid currentColor; }

main.wrap { padding: 30px 22px 70px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 12.5px; padding-bottom: 44px; }

/* ---- page furniture ---- */

.pagehead { margin-bottom: 20px; }
h1 { font: 600 28px/1.2 'Spectral', serif; margin: 0 0 6px; letter-spacing: .005em; }
h2 { font: 600 20px 'Spectral', serif; margin: 26px 0 8px; }
h3 { font: 600 16px 'Public Sans', sans-serif; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0; max-width: 74ch; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: 4px; padding: 0; margin-bottom: 16px; box-shadow: 0 1px 0 rgba(32, 34, 63, .03);
  transition: background-color .25s ease, border-color .25s ease; }
.cardhead { padding: 12px 20px; border-bottom: 1px solid var(--hair); font: 500 13px 'Public Sans', sans-serif; color: var(--muted); letter-spacing: .02em; }
.card > p, .card > table, .card > .notes, .card > .creds, .card > pre, .card > .tickets { margin: 14px 20px 16px; }
.card > .cardhead + p { margin-top: 14px; }

table { border-collapse: collapse; width: 100%; }
th { text-align: left; font: 500 12px 'Public Sans', sans-serif; color: var(--dim); padding: 4px 14px 7px 0; border-bottom: 1px solid var(--hair); }
td { padding: 10px 14px 10px 0; border-bottom: 1px solid rgba(226, 222, 210, .7); vertical-align: top; }
tr:last-child td { border-bottom: none; }
table.kv td:first-child { color: var(--muted); white-space: nowrap; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: rgba(168, 56, 43, .035); }

.chip { display: inline-block; font: 500 11.5px 'Public Sans', sans-serif; letter-spacing: .02em; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--hair); color: var(--muted); background: #fff; }
.chip.ok { color: var(--ok); border-color: rgba(47, 107, 79, .35); }
.chip.bad { color: var(--seal-ink); border-color: rgba(168, 56, 43, .4); }
.error { color: var(--seal-ink); background: rgba(168, 56, 43, .07); border: 1px solid rgba(168, 56, 43, .28); border-radius: 4px; padding: 10px 12px; margin: 12px 0; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--dim); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--hair); flex: 1; }

/* ---- identity block ---- */

.identity-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px 6px; }
.identity-row .seal { width: 44px; height: 44px; }
.identity-name { font: 600 18px 'Spectral', serif; }
.identity-row .stamp { margin-left: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--hair); margin-right: 8px; }
.dot.on { background: var(--ok); }

/* ---- notes / vault ---- */

.notes { display: flex; flex-direction: column; gap: 12px; }
.note { border: 1px solid var(--hair); border-radius: 3px; background: #fff; padding: 14px 16px; }
.note h3 { font-family: 'Spectral', serif; font-size: 17px; display: inline-block; padding-bottom: 3px; border-bottom: 1px solid rgba(168, 56, 43, .45); margin-bottom: 8px; }
.note pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font: 400 13px/1.65 'IBM Plex Mono', monospace; color: #2A2D49; }
.creds { list-style: none; padding: 0; }
.creds li { padding: 8px 0; border-bottom: 1px solid rgba(226, 222, 210, .7); word-break: break-all; }
pre.block { background: #FBFAF4; border: 1px solid var(--hair); border-radius: 3px; padding: 12px 14px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---- forms ---- */

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }
input { width: 100%; padding: 10px 12px; background: #fff; border: 1px solid #CFCABA; border-radius: 3px; color: var(--ink); font: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus { border-color: var(--seal); outline: none; box-shadow: 0 0 0 3px rgba(168, 56, 43, .14); }
.btn { display: inline-block; margin-top: 16px; padding: 10px 18px; background: var(--indigo); color: #fff; border: 1px solid var(--indigo); border-radius: 3px; font: 500 15px 'Public Sans', sans-serif; cursor: pointer; transition: background .15s ease, transform .12s ease; }
.btn:hover { background: #343B7A; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.ghost { background: transparent; color: var(--indigo); }
.btn.ghost:hover { background: rgba(42, 47, 99, .06); }

/* ---- auth pages ---- */

.auth-body { display: grid; place-items: center; min-height: 100vh; background:
  radial-gradient(900px 520px at 18% -10%, rgba(168, 56, 43, .08), rgba(168, 56, 43, 0) 60%),
  var(--paper); }
.auth-card { width: min(430px, 94vw); background: var(--card); border: 1px solid var(--hair); border-radius: 4px; padding: 30px 30px 26px; box-shadow: 0 18px 50px rgba(32, 34, 63, .08); }
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.auth-head .seal { width: 40px; height: 40px; }
.auth-head .brand-mark { display: block; font: 600 20px 'Spectral', serif; }
.auth-head .brand-sub { display: block; color: var(--dim); font-size: 12px; }
.auth-card h1 { font-size: 24px; margin-top: 8px; }
.passkey-note { color: var(--muted); font-size: 13.5px; margin: 4px 0 10px; }
.fine { color: var(--dim); font-size: 13px; margin-top: 14px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .band { padding-top: 10px; padding-bottom: 10px; }
}

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

/* ---- sign-in: two-panel identity composition (SGN-02) ---- */
.login-body { display: block; min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100vh; }
.login-info { padding: 56px 54px; background: linear-gradient(160deg, color-mix(in srgb, var(--card) 92%, var(--seal) 8%), var(--card)); border-right: 1px solid var(--hair); display: flex; flex-direction: column; }
.login-info .auth-head { margin-bottom: 26px; }
.login-info h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; margin: 0 0 16px; }
.login-info .lede { max-width: 46ch; }
.login-facts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: var(--muted); }
.login-facts li { padding-left: 18px; position: relative; }
.login-facts li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); opacity: .75; }
.login-foot { margin-top: auto; color: var(--dim); font-size: 12.5px; padding-top: 30px; }
.login-panel { padding: 56px 54px; max-width: 520px; align-self: center; }
.login-panel h2 { font-size: 26px; margin: 0 0 6px; }
.btn-passkey { width: 100%; margin-top: 18px; padding: 13px 18px; font-size: 15.5px; background: var(--seal); border-color: var(--seal); }
.btn-passkey:hover { background: var(--seal-ink); }
.btn-passkey:disabled { opacity: .55; cursor: not-allowed; }
.passkey-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.login-panel form .btn { width: 100%; margin-top: 18px; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-info { border-right: 0; border-bottom: 1px solid var(--hair); padding: 34px 26px; }
  .login-panel { padding: 30px 26px 60px; max-width: none; }
}

/* responsive pass: contain tables, enlarge touch targets */
@media (max-width: 900px) {
  .card { overflow-x: auto; }
  table { min-width: 460px; }
  .who, .band { flex-wrap: wrap; }
  .theme-toggle { width: 44px; height: 44px; }
  .linklike { padding: 12px 2px; min-height: 44px; }
  .appnav a { padding: 11px 12px; }
  main.wrap { padding-left: 16px; padding-right: 16px; }
  html, body { overflow-x: clip; }
}
