/* ═══════════════════════════════════════════════════════════════
   Alvin's Hub: shared theme
   Deep-ink dark theme, warm amber accent, serif display headings.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:          #0b0d12;
  --bg-soft:     #0e1118;
  --surface:     #12151d;
  --surface-hi:  #171b26;
  --border:      #222736;
  --border-soft: #1a1e2b;

  --accent:      #e5b25c;   /* reading-lamp amber */
  --accent-hi:   #f2ca85;
  --accent-dim:  rgba(229, 178, 92, 0.14);
  --accent-line: rgba(229, 178, 92, 0.35);

  --text:        #e9ebf3;
  --muted:       #9aa3bd;
  --faint:       #5d6580;

  --ok:          #4ade80;
  --ok-bg:       rgba(74, 222, 128, 0.10);
  --warn:        #f0a44a;
  --warn-bg:     rgba(240, 164, 74, 0.10);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
  --maxw:      980px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(229, 178, 92, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-dim); color: var(--accent-hi); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

/* ── top navigation ──────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.9rem;
}
.nav .wordmark {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.nav .wordmark:hover { color: var(--accent-hi); }
.nav .wordmark .mark {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--accent-dim), rgba(229,178,92,0.03));
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.95rem;
  font-family: var(--serif);
}
.nav .spacer { flex: 1; }
.nav .nav-link {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.nav .nav-link:hover { color: var(--text); background: var(--surface-hi); border-color: var(--border-soft); }
.nav .nav-link.active { color: var(--accent); }

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

/* ── inputs & buttons ────────────────────────────────────────── */
.input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface-hi);
}

.chip {
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on {
  color: var(--accent-hi);
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-hi);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.08em 0.35em;
  color: var(--accent-hi);
}
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 0.82rem; line-height: 1.6; }

/* ── footer ──────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.78rem;
  color: var(--faint);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav { padding: 0.9rem 1rem 0.7rem; }
  .page { padding: 0 1rem 4rem; }
}

/* ── auth / share ────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.auth-card .auth-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.auth-card label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.4rem;
}
.auth-card .input { margin-bottom: 0.9rem; }
.auth-btn {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0b0d12;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.72rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-btn:hover { background: var(--accent-hi); }
.auth-btn:disabled { opacity: 0.55; cursor: default; }
.auth-error {
  margin-top: 0.85rem;
  font-size: 0.84rem;
  color: #f0a44a;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
}

.card-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 0; /* guides gap handles spacing */
}
.card-row .card { flex: 1; min-width: 0; }
.card-row .share-btn {
  flex-shrink: 0;
  align-self: center;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.card-row .share-btn:hover {
  color: var(--accent-hi);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.guides.is-admin .card-row { margin-bottom: 0; }

#share-modal[hidden] { display: none !important; }
#share-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
#share-modal .share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.72);
}
#share-modal .share-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
}
.share-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.share-panel-head h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
}
.share-close {
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.share-close:hover { color: var(--text); }
.share-note-title {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.share-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}
.share-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.share-row .input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.55rem 0.7rem;
}
.share-copy, .share-copy-all {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}
.share-copy:hover, .share-copy-all:hover {
  border-color: var(--accent-line);
  color: var(--accent-hi);
}
.share-copy-all {
  width: 100%;
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-hi);
  margin-top: 0.15rem;
}
.share-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--ok);
}
