/* ============================================================================
   Collab-it Dev Dashboard — styles.css
   Flavor skin. Mechanics live in app.js (portable, do not re-theme there).
   Palette + fonts drawn from the locked Collab-it design system
   (docs/mockups/ + CLAUDE.md "Design system (locked)").
   ============================================================================ */

/* ---- Fonts: self-hosted-feel via Google Fonts, with system fallbacks so the
        tool still renders offline off file://. Same three families and the exact
        italic/weight set the mockups use. ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Color tokens (locked Collab-it palette) ---- */
  --cream:        #F4EFE6;
  --cream-card:   #FBF8F2;
  --cream-deep:   #EAE3D5;
  --espresso:     #2A1C12;
  --charcoal:     #1A1310;
  --kraft:        #C7A878;
  --gold:         #BE8A2C;
  --gold-light:   #D9A648;
  --forest:       #2F4A35;
  --line:         #E0D6C6;

  /* ---- Semantic aliases used by components ---- */
  --surface:      var(--cream);
  --surface-card: var(--cream-card);
  --ink:          var(--espresso);
  --ink-soft:     #6b5844;
  --accent:       var(--gold);
  --accent-light: var(--gold-light);
  --edge:         var(--line);

  /* ---- Owner colors — the three-actor extension. Each story is tagged. ---- */
  --owner-andre:  var(--forest);   /* operator / credential work */
  --owner-cc:     var(--gold);     /* code */
  --owner-mike:   var(--kraft);    /* design / rulings */
  --owner-done:   #9aa89a;         /* completed, muted */

  /* ---- Fonts ---- */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Outfit', -apple-system, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* ---- Rhythm ---- */
  --radius:       14px;
  --radius-sm:    9px;
  --gap:          22px;
  --maxw:         1180px;
}

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

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 480px at 82% -8%, rgba(190,138,44,0.07), transparent 60%),
    var(--surface);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: clamp(18px, 3.2vw, 42px);
  min-height: 100vh;
}

.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ---- Eyebrow / mono labels: the "console" texture ---- */
.eyebrow, .pill, .tag, .kicker, .counter-label, .tab, .hint {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ============================ MASTHEAD ============================ */
.masthead {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding-bottom: 22px; margin-bottom: 26px;
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--charcoal);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 18px rgba(42,28,18,0.22);
}
.brand-mark svg { width: 28px; height: 28px; display: block; }
.eyebrow { font-size: 10px; color: var(--accent); margin-bottom: 3px; }
.project-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1;
  color: var(--ink); letter-spacing: -0.01em;
}
.project-title em { font-style: italic; color: var(--accent); font-weight: 500; }
.tagline { color: var(--ink-soft); font-size: 14px; margin-top: 5px; white-space: nowrap; }

.masthead-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.today-pill {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  background: var(--surface-card); border: 1px solid var(--edge);
  padding: 7px 12px; border-radius: 999px; color: var(--ink);
}
.chips { display: flex; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none;
  padding: 7px 12px; border-radius: 999px;
  background: var(--charcoal); color: var(--cream);
  border: 1px solid transparent; transition: transform .15s, background .15s;
}
.chip.ghost { background: transparent; color: var(--ink); border-color: var(--edge); }
.chip:hover { transform: translateY(-1px); background: var(--espresso); color: var(--cream); }

/* ============================ LAST SESSION STRIP ============================ */
.last-session {
  position: relative;
  background: var(--surface-card); border: 1px solid var(--edge);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: var(--gap);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  cursor: default;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--forest); flex: none; position: relative; }
.pulse::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--forest); opacity: 0.5;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity:.6 } 100% { transform: scale(1.7); opacity:0 } }
.ls-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); }
.ls-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.ls-summary { font-size: 14px; color: var(--ink); flex: 1 1 340px; }
.hint { font-size: 10px; color: var(--ink-soft); border: 1px dashed var(--edge); padding: 4px 9px; border-radius: 999px; }

.ls-popover {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20;
  background: var(--charcoal); color: var(--cream);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 18px 44px rgba(26,19,16,0.4);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.last-session:hover .ls-popover,
.last-session:focus-within .ls-popover { opacity: 1; visibility: visible; transform: translateY(0); }
/* Lift the whole strip into its own stacking context while active so the popover
   sits ABOVE the grid panels below it (relative + z-auto alone won't do this). */
.last-session:hover,
.last-session:focus-within { z-index: 40; }
.ls-popover h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 10px; }
.ls-popover ul { list-style: none; display: grid; gap: 7px; }
.ls-popover li { font-size: 13px; padding-left: 16px; position: relative; color: #e9e0d2; }
.ls-popover li::before { content: '▸'; position: absolute; left: 0; color: var(--gold-light); }

/* ============================ GRID ============================ */
.grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--gap); align-items: start; }

.panel { background: var(--surface-card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--edge); }
.tab {
  font-size: 11px; color: var(--ink-soft); background: none; border: none;
  padding: 8px 12px 12px; cursor: pointer; position: relative; letter-spacing: 0.12em;
}
.tab.active { color: var(--ink); }
.tab.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }

.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---- Up-next cards ---- */
.upnext-card {
  border: 1px solid var(--edge); border-radius: var(--radius-sm);
  padding: 15px 16px; margin-bottom: 12px; background: var(--surface);
  position: relative; overflow: hidden;
}
.upnext-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.upnext-rank { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.upnext-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); line-height: 1.1; margin-bottom: 5px; }
.upnext-title em { font-style: italic; color: var(--accent); }
.upnext-summary { font-size: 13.5px; color: var(--ink-soft); }

/* ---- Up-next top row: rank on the left, epic pill on the right ---- */
.upnext-toprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.upnext-toprow .upnext-rank { margin-bottom: 0; }

/* ---- Epic pill (shown on every Up Next + backlog story card) ---- */
.epic-tag {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  background: var(--cream-deep); border: 1px solid var(--edge);
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; flex: none;
}
.epic-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.story-body .epic-tag { margin-top: 8px; }

/* ---- Story rows (previous + backlog) ---- */
.story-row { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--edge); }
.story-row:last-child { border-bottom: none; }
.story-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); flex: none; width: 82px; padding-top: 2px; }
.story-body h5 { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.story-body p { font-size: 13px; color: var(--ink-soft); }

/* ---- Owner tag (the three-actor extension) ---- */
.tag {
  font-size: 9px; letter-spacing: 0.12em; padding: 3px 7px; border-radius: 5px;
  color: #fff; flex: none; align-self: flex-start; margin-top: 2px;
}
.tag[data-owner="Andre"] { background: var(--owner-andre); }
.tag[data-owner="CC"]    { background: var(--owner-cc); color: var(--charcoal); }
.tag[data-owner="Mike"]  { background: var(--owner-mike); color: var(--charcoal); }
.tag[data-owner="Done"]  { background: var(--owner-done); }

/* ---- Backlog ---- */
.backlog-head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 22px 0 6px; }
.backlog-list { max-height: 340px; overflow-y: auto; -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 14px), transparent); padding: 6px 2px; }
.backlog-list::-webkit-scrollbar { width: 7px; }
.backlog-list::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 6px; }

/* ============================ SIDEBAR ============================ */
.sidebar { display: grid; gap: var(--gap); }
.module h3 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 9px; }
.module p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }

.poster {
  background: var(--charcoal); color: var(--cream); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden;
}
.poster .kicker { font-size: 9.5px; color: var(--gold-light); margin-bottom: 12px; }
.poster blockquote { font-family: var(--font-display); font-style: italic; font-size: 22px; line-height: 1.25; color: var(--cream); margin-bottom: 12px; }
.poster cite { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--kraft); font-style: normal; }

.counter { text-align: center; padding: 20px; background: var(--surface-card); border: 1px solid var(--edge); border-radius: var(--radius); }
.counter-num { font-family: var(--font-display); font-size: 58px; font-weight: 600; color: var(--accent); line-height: 1; }
.counter-label { font-size: 10px; color: var(--ink-soft); margin-top: 6px; }

/* ============================ FOOTER ============================ */
.footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--edge); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---- Staggered reveal ---- */
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .masthead { flex-direction: column; }
  .masthead-right { align-items: flex-start; }
  .tagline { white-space: normal; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .pulse::after { animation: none; }
  * { transition: none !important; }
}

/* ---- Legend for owner colors ---- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.legend span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
