/* ═══════════════════════════════════════════════
   BASE.CSS — Calisthenics Tracker Design System
   · Cormorant + Montserrat
   Shared across ALL pages
   ═══════════════════════════════════════════════ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  --gold: #D1B9B4;
  --gold-light: #DFD1C9;
  --gold-dim: rgba(209,185,180,0.12);
  --gold-border: rgba(209,185,180,0.25);
  --dark: #1C1A19;
  --dark2: #444444;
  --dark3: #555;
  --dark4: #716D64;
  --cream: #FAF8F6;
  --text: #DFD1C9;
  --text-dim: rgba(223,209,201,0.5);
  --text-dimmer: rgba(223,209,201,0.3);
  --done: #9B997B;
  --done-bg: rgba(155,153,123,0.22);
  --done-border: rgba(155,153,123,0.25);
  --unlock: #DFD1C9;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  cursor: none;
  min-height: 100vh;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* ── CUSTOM CURSOR (desktop only) ── */
.cursor {
  width: 8px; height: 8px;
  background: var(--gold); border-radius: 50%;
  position: fixed; pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid rgba(209,185,180,0.5);
  border-radius: 50%;
  position: fixed; pointer-events: none;
  z-index: 9998;
  transition: all 0.15s ease;
  transform: translate(-50%, -50%);
}
@media (hover: none) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0; z-index: 100;
  height: 64px;
  background: rgba(28,26,25,0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(209,185,180,0.1);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 0;
  transition: background 0.3s;
}

/* Gold progress bar on top */
.nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 40%;
  background: linear-gradient(90deg, rgba(209,185,180,0.35), var(--gold), var(--gold-light));
  border-radius: 0 2px 2px 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}
.nav-logo-icon {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}
.nav-logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  font-weight: 600;
  line-height: 1;
}
.nav-logo-text em {
  font-style: normal;
  color: var(--cream);
  font-size: 0.6em;
  display: block;
  letter-spacing: 0.2em;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 3px;
  opacity: 0.5;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.nav-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s, background 0.2s;
  position: relative;
  text-transform: uppercase;
}
.nav-links a svg {
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.nav-links a:hover {
  color: var(--gold-light);
  background: rgba(209,185,180,0.07);
}
.nav-links a:hover svg { opacity: 1; }
.nav-links a.active {
  color: var(--gold);
  background: rgba(209,185,180,0.1);
}
.nav-links a.active svg { opacity: 1; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--gold);
  border-radius: 1px 1px 0 0;
  opacity: 0.8;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--dark);
  background: var(--gold);
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}

/* Nav user status */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  flex-shrink: 0;
  padding: 0 8px;
}
.nav-user .nu-avatar { font-size: 16px; }
.nav-user .nu-name { color: var(--gold); }
.nav-user .nu-signin {
  color: var(--text-dim); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--gold-border);
  border-radius: 4px; transition: all 0.3s;
  font-size: 8px; letter-spacing: 2px; text-transform: uppercase;
}
.nav-user .nu-signin:hover { color: var(--gold); border-color: var(--gold); }
.nav-user .nu-sync {
  font-size: 7px; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 3px;
}
.nav-user .nu-sync.online { color: var(--done); }
.nav-user .nu-sync.offline { color: var(--text-dim); }

/* Mobile hamburger */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-burger:hover { background: rgba(209,185,180,0.08); }
.nav-burger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--gold);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0; transform: scaleX(0);
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--gold);
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0; bottom: 0;
  background: rgba(28,26,25,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-direction: column;
  padding: 24px 20px 40px;
  gap: 6px;
  overflow-y: auto;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  will-change: transform, opacity;
  z-index: 99;
}
.nav-drawer.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: all;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s, background 0.2s;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.drawer-link svg { opacity: 0.5; transition: opacity 0.2s; }
.drawer-link:hover,
.drawer-link.active {
  color: var(--gold-light);
  background: rgba(209,185,180,0.08);
  border-color: rgba(209,185,180,0.15);
}
.drawer-link.active { color: var(--gold); }
.drawer-link:hover svg,
.drawer-link.active svg { opacity: 1; }

.drawer-user {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(209,185,180,0.1);
  text-align: center;
}
.drawer-user .du-signin {
  display: block;
  padding: 12px;
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  color: var(--gold);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.2s;
}
.drawer-user .du-signin:hover { background: rgba(209,185,180,0.08); }
.drawer-user .du-authed {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
}
.drawer-user .du-avatar { font-size: 20px; }
.drawer-user .du-name { color: var(--gold); }

/* ── FOOTER ── */
footer {
  background: var(--dark);
  border-top: 1px solid rgba(209,185,180,0.1);
  padding: 28px 48px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; color: var(--cream);
}
.footer-logo span { color: var(--gold); }
.footer-copy {
  font-size: 8px; letter-spacing: 2px;
  color: var(--text-dim); text-transform: uppercase;
}

/* ── SHARED PILLS ── */
.pill {
  display: inline-block; padding: 5px 14px;
  font-size: 10px; font-weight: 500; white-space: nowrap;
  border: 1px solid; letter-spacing: 0.5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  border-radius: 4px;
}
.pill-s { background: rgba(209,185,180,0.08); color: var(--gold); border-color: var(--gold-border); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav { padding: 0 20px; }
  footer { padding: 24px 28px; }
}

@media (max-width: 767px) {
  .nav-links { display: none; }
  .nav-user { display: none; }
  .nav-burger { display: flex; }
  .nav-drawer { display: flex; }
  footer { padding: 20px 16px; flex-direction: column; text-align: center; gap: 10px; }
}
