/* =====================================================================
 * BAR LAB · Design System
 * Shared CSS for all pages on barlab.xyz
 * =====================================================================
 *
 * Aesthetic: Refined academic. Vintage gold + dark silver.
 * Typography: Cormorant Garamond (display) + JetBrains Mono (mono)
 *             Inter as functional sans-serif fallback (NOT primary).
 * ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg-base);
  color: var(--silver-1);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* === DESIGN TOKENS === */
:root {
  /* Background layers */
  --bg-base: #22252B;
  --bg-rise: #2D3036;
  --bg-card: #383B42;
  --bg-deep: #1A1C20;

  /* Silver scale */
  --silver-1: #E8EAED;   /* primary text */
  --silver-2: #C8CDD3;
  --silver-3: #9CA1A8;   /* secondary text */
  --silver-4: #6E7178;   /* tertiary */
  --silver-5: #4A4D54;   /* borders */
  --silver-6: #353840;   /* subtle dividers */

  /* Brand */
  --gold:        #C5A572;
  --gold-soft:   #B89968;
  --gold-deep:   #9C8455;
  --gold-glow:   rgba(197, 165, 114, 0.15);

  /* Accents */
  --orcid-green: #A5CE39;
  --warning:     #C9876B;
  --success:     #88B8A0;

  /* Typography */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Spacing scale (8pt grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Layout */
  --container: 1280px;
  --container-narrow: 880px;
  --content: 720px;

  /* Borders & shadows */
  --border-thin: 0.5px solid var(--silver-5);
  --border-soft: 0.5px solid var(--silver-6);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.2);
  --shadow-lift: 0 8px 40px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 80px var(--gold-glow);

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:  300ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === TYPOGRAPHY UTILITIES === */
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }

.h-display {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(48px, 8vw, 96px);
}
.h-display em {
  font-style: italic;
  color: var(--gold);
}
.h-section {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-size: clamp(36px, 5vw, 64px);
}
.h-section em {
  font-style: italic;
  color: var(--gold);
}
.h-card {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-4);
}
.eyebrow .marker {
  color: var(--gold);
  margin-right: 8px;
}
.lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  color: var(--silver-2);
  font-weight: 400;
}

/* === LAYOUT === */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* === GLOBAL NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(34, 37, 43, 0.85);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: var(--border-soft);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  color: var(--bg-deep);
  letter-spacing: 0.02em;
  line-height: 1;
}
.nav-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--silver-1);
}
.nav-name em {
  font-style: italic;
  color: var(--gold);
  margin-left: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  list-style: none;
}
.nav-link {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--silver-3);
  transition: color var(--t-fast);
  position: relative;
  padding: 8px 0;
}
.nav-link:hover { color: var(--silver-1); }
.nav-link.active { color: var(--gold); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
}
.nav-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  padding: 8px 16px;
  border-radius: 4px;
  transition: transform var(--t-fast);
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--silver-1);
  font-size: 24px;
  padding: 4px;
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-rise);
    flex-direction: column;
    padding: var(--s-5);
    gap: var(--s-4);
    border-bottom: var(--border-soft);
  }
}

/* === FOOTER === */
.footer {
  background: var(--bg-deep);
  border-top: var(--border-soft);
  padding: var(--s-9) 0 var(--s-5);
  margin-top: var(--s-10);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-7);
  margin-bottom: var(--s-7);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
}
.footer-brand h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-3);
}
.footer-brand h3 em { font-style: italic; color: var(--gold); }
.footer-brand p {
  font-family: var(--serif);
  font-style: italic;
  color: var(--silver-3);
  font-size: 16px;
  line-height: 1.5;
  max-width: 380px;
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s-4);
  font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--s-2); }
.footer-col a {
  color: var(--silver-3);
  font-size: 14px;
  transition: color var(--t-fast);
  border-bottom: 0.5px dotted transparent;
}
.footer-col a:hover {
  color: var(--silver-1);
  border-bottom-color: var(--silver-4);
}
.footer-bottom {
  border-top: var(--border-soft);
  padding-top: var(--s-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--silver-4);
  letter-spacing: 0.04em;
}
@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; gap: var(--s-3); text-align: center; }
}
.footer-bottom .lab-mark {
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
}

/* === SECTIONS === */
.section {
  padding: var(--s-9) 0;
}
.section-head {
  margin-bottom: var(--s-7);
  max-width: 720px;
}
.section-head .eyebrow { margin-bottom: var(--s-3); }
.section-head .lead { margin-top: var(--s-4); max-width: 640px; }

/* === CARDS === */
.card {
  background: var(--bg-rise);
  border: var(--border-thin);
  border-radius: 6px;
  padding: var(--s-5);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--silver-4);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--bg-deep);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-secondary {
  background: transparent;
  color: var(--silver-1);
  border: var(--border-thin);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-arrow::after {
  content: '→';
  transition: transform var(--t-fast);
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* === MARKER (small bullet) === */
.marker-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 12px;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--silver-5); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--silver-4); }

/* === ENTRANCE ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-up { animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
.animate-in { animation: fadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) backwards; }

/* === SELECTION === */
::selection { background: var(--gold); color: var(--bg-deep); }

/* === FOCUS === */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
