/* ══════════════════════════════════════════════════════════════════
   Ithildin UI
   ──────────────────────────────────────────────────────────────────
   Values derive from chronology.html, the reference implementation
   of the design language. See README.md for the contract.

     <link rel="stylesheet" href="/lib/ithildin.css">
     <script src="/lib/ithildin.js" defer></script>
   ══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Source+Sans+3:wght@300;400;700&display=swap');


/* ══════════════════════════════════════════════════════════════════
   TOKENS
   The durable layer. Stack-agnostic — these hold regardless of what
   renders them. Keep component-specific values out of this block;
   if a second component lands, this splits back into tokens.css.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Type ──────────────────────────────────────────────────
     EB Garamond is canonical. Playfair Display is legacy and
     survives only in unmigrated pages — do not add it back. */
  --font-serif: 'EB Garamond', Georgia, serif;
  --font-sans:  'Source Sans 3', system-ui, sans-serif;
  --font-mono:  'Courier New', monospace;

  /* ── Structural ────────────────────────────────────────────
     Already byte-identical across every desktop page. */
  --bg:            #ffffff;
  --surface:       #f5f5f5;
  --navbar:        #000000;
  --text:          #0f172a;
  --text2:         #475569;
  --text3:         #94a3b8;
  --border:        #e2e2e2;
  --border-strong: #d0d0d0;

  /* ── Brand ─────────────────────────────────────────────────
     --gold is RESERVED for interaction affordance: hover,
     active, open, selected. It is never a status or category
     color. If you need a goldish color to *mean* something,
     you want a semantic scale, not this token.
     See README, "The gold rule". */
  --gold: #B5860D;

  --garnet:        #7A1520;
  --garnet-bg:     #FAF0F1;  /* panel / card fill     */
  --garnet-badge:  #FDE8EB;  /* badge fill            */
  --garnet-border: #E8AAB2;  /* 1px border on a fill  */

  /* ── Chrome ────────────────────────────────────────────────*/
  --nav-h: 52px;
}


/* ══════════════════════════════════════════════════════════════════
   NAVBAR
   Rendered by <ith-navbar> in ithildin.js.
   ══════════════════════════════════════════════════════════════════ */

ith-navbar {
  height: var(--nav-h);
  background: var(--navbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* For pages that own the viewport (html, body { overflow: hidden })
   and need the bar out of flow. */
ith-navbar[layout="fixed"] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

.ith-nav-left {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo lockup — locked. Icon 36px shifted -2px, wordmark 20px,
   gap 0. These four values are not to be changed. */
.ith-nav-logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
}
.ith-nav-logo-icon { height: 36px; width: auto; transform: translateY(-2px); }
.ith-nav-logo-name { height: 20px; width: auto; }

.ith-nav-divider {
  width: 1px;
  height: 18px;
  background: #444;
  margin: 0 16px;
  flex-shrink: 0;
}

.ith-nav-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #ccc;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 150ms ease;
}
.ith-nav-label:hover { color: #fff; }

/* Per-service product name fused to the wordmark — the identity of the surface
   (e.g. "Ithildin Vault"). Brand serif at wordmark scale with airy caps, so it
   reads as a peer to the logotype rather than a breadcrumb label. */
.ith-nav-app-name {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 400;
  color: #cfcfcf;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ith-nav-sep {
  color: #555;
  margin: 0 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ith-nav-page {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #ccc;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ith-nav-action {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease;
}
.ith-nav-action:hover { background: #e8e8e8; }

.ith-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ith-nav-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #ccc;
  letter-spacing: 0.04em;
}

/* Deliberate green — the verified cue; `> svg` scopes it to the leading glyph. */
.ith-nav-user > svg { width: 13px; height: 13px; color: #46a878; flex-shrink: 0; }

.ith-nav-tip {
  position: absolute;
  top: calc(100% + 11px);
  right: 0;
  z-index: 10;
  /* 176px content wraps the body into two balanced lines, title on one line. */
  width: 176px;
  padding: 11px 13px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.24);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
  pointer-events: none;
}
.ith-nav-user:hover .ith-nav-tip,
.ith-nav-user:focus-within .ith-nav-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Caret sits on the card's top edge (clean triangle); ithildin.js sets
   --caret-x to align it with the leading shield. */
.ith-nav-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: var(--caret-x, 20px);
  width: 9px;
  height: 9px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  transform: rotate(45deg);
}
.ith-nav-tip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.ith-nav-tip-head svg { width: 14px; height: 14px; color: #46a878; flex-shrink: 0; }
.ith-nav-tip-body {
  display: block;
  margin-top: 5px;
  color: var(--text2);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  text-wrap: balance;
}

/* Utility action — quieter than .ith-nav-action, achromatic (not gold). */
.ith-nav-signout {
  background: transparent;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.ith-nav-signout:hover { color: #fff; border-color: #888; }
