/* ============================================================================
   styles.css — Modern DevOps tracker
   Monochrome (black / white / grey) + light & dark themes.
   Character identity is carried by the monogram + emoji, NOT by colour.
   Design language: minimal, lots of whitespace, dashes & arrows as separators.
   ============================================================================ */

/* ---------- THEME TOKENS ---------- */
:root {
  /* dark is the default; [data-theme="light"] overrides below */
  --bg:      #0b0b0c;
  --bg2:     #111113;
  --panel:   #161618;
  --panel2:  #1c1c1f;
  --line:    #2a2a2e;
  --line2:   #38383d;
  --ink:     #f4f4f3;
  --muted:   #a6a6a8;
  --faint:   #6e6e72;
  --on-ink:  #0b0b0c;   /* text that sits ON an --ink fill */

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 980px;

  --display: "Fraunces", Georgia, serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;
}

[data-theme="light"] {
  --bg:      #ffffff;
  --bg2:     #fafafa;
  --panel:   #ffffff;
  --panel2:  #f5f5f4;
  --line:    #e6e6e4;
  --line2:   #d4d4d1;
  --ink:     #131313;
  --muted:   #555555;
  --faint:   #8a8a8a;
  --on-ink:  #ffffff;
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

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

/* ---------- TOP NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.brand .dot { color: var(--faint); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--muted); padding: 6px 10px; border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--ink); background: var(--panel2); }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.iconbtn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--radius-sm); height: 34px; padding: 0 12px;
  font-family: var(--mono); font-size: 12px; display: inline-flex;
  align-items: center; gap: 7px; transition: .15s;
}
.iconbtn:hover { border-color: var(--line2); color: var(--ink); }
.iconbtn.sq { width: 34px; padding: 0; justify-content: center; font-size: 15px; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .iconbtn .lbl { display: none; }
  .iconbtn { padding: 0 11px; }
}

/* ---------- generic section heading ("eyebrow") ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--faint);
  margin: 64px 0 18px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: "—"; color: var(--line2); }

/* ---------- HERO ---------- */
.hero { padding: 64px 0 8px; }
.onair {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--muted); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px;
}
.onair::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink); animation: blink 2s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(40px, 8vw, 78px); line-height: .98;
  margin: 18px 0 0; letter-spacing: -.025em;
}
h1 .sub {
  display: block; font-family: var(--body); font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 16px;
}
.tagline { color: var(--muted); font-size: 16px; max-width: 54ch; margin: 22px 0 0; }
.tagline b { color: var(--ink); font-weight: 600; }

/* ---------- overall progress meter ---------- */
.meter { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 34px; }
.pct { font-family: var(--mono); font-weight: 700; font-size: 26px; white-space: nowrap; }
.pct small { display: block; color: var(--faint); font-weight: 500; font-size: 12px; margin-top: 2px; }
.bar {
  flex: 1; min-width: 220px; height: 8px; border-radius: 99px;
  background: var(--panel2); border: 1px solid var(--line); overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: var(--ink); transition: width .6s cubic-bezier(.2,.8,.2,1);
}

/* ---------- CONFESSIONAL ---------- */
.confessional {
  margin-top: 30px; display: flex; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.confessional .body { flex: 1; min-width: 0; }
.confessional q {
  font-family: var(--display); font-style: italic; font-size: 19px; line-height: 1.4;
}
.confessional .who {
  display: block; margin-top: 8px; font-size: 12px; color: var(--faint);
  font-family: var(--mono); letter-spacing: .04em;
}
.reshoot {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px;
  font-family: var(--mono); white-space: nowrap; transition: .15s;
}
.reshoot:hover { border-color: var(--line2); color: var(--ink); }

/* ---------- AVATARS (monochrome monogram + emoji badge) ---------- */
.av {
  width: 40px; height: 40px; border-radius: 11px; flex: none; position: relative;
  display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--line2);
  font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink);
}
.av.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
.av .emo {
  position: absolute; bottom: -7px; right: -7px; font-size: 13px; line-height: 1;
  background: var(--bg); border: 1px solid var(--line); border-radius: 50%; padding: 2px;
}
.av.sm .emo { font-size: 10px; bottom: -6px; right: -6px; }

/* ---------- CAST GRID ---------- */
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.castcard {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: var(--panel);
}
.castcard .top { display: flex; align-items: center; gap: 12px; }
.castcard .name { font-family: var(--display); font-weight: 600; font-size: 18px; }
.castcard .role {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  letter-spacing: .08em; text-transform: uppercase;
}
.castcard q {
  display: block; margin-top: 14px; font-style: italic;
  color: var(--muted); font-size: 14px; line-height: 1.5;
}

/* ---------- EPISODES ---------- */
.ep {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 12px; overflow: hidden;
}
.ephead {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 18px 20px;
}
.ephead:hover { background: var(--panel2); }
.epno {
  font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line2); border-radius: 7px; padding: 5px 8px; flex: none;
}
.eptitle { font-family: var(--display); font-weight: 600; font-size: 19px; flex: 1; min-width: 0; }
.eptitle .meta {
  display: block; font-family: var(--body); font-size: 12.5px;
  color: var(--faint); font-weight: 400; margin-top: 3px;
}
.epcount { font-family: var(--mono); font-size: 12px; color: var(--faint); flex: none; }
.epbar {
  width: 84px; height: 6px; border-radius: 99px; background: var(--panel2);
  border: 1px solid var(--line); overflow: hidden; flex: none;
}
.epbar > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .5s; }
.chev { transition: transform .3s; color: var(--faint); flex: none; font-size: 13px; }
.ep.open .chev { transform: rotate(90deg); }
.epbody { display: none; padding: 4px 14px 16px; }
.ep.open .epbody { display: block; }

.task {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
}
.task:hover { background: var(--panel2); }
.task input {
  appearance: none; width: 22px; height: 22px; flex: none; margin-top: 1px;
  border-radius: 6px; border: 2px solid var(--line2); background: transparent;
  display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.task input:checked { background: var(--ink); border-color: var(--ink); }
.task input:checked::after { content: "✓"; color: var(--on-ink); font-weight: 800; font-size: 13px; }
.task .txt { font-size: 15px; }
.task.done .txt { color: var(--faint); text-decoration: line-through; }
.task .tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); margin-top: 5px; display: inline-flex; align-items: center; gap: 7px;
}
.task .tag.cp { color: var(--ink); font-weight: 700; }

/* ---------- CALENDAR ---------- */
.calwrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.calhead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.calhead .mo { font-family: var(--display); font-weight: 600; font-size: 21px; flex: 1; min-width: 140px; }
.navbtn {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius-sm);
  width: 34px; height: 34px; font-size: 16px; display: grid; place-items: center; transition: .15s;
}
.navbtn:hover { border-color: var(--ink); }
.streak {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 11px;
}
.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 7px; }
.dow span {
  text-align: center; font-family: var(--mono); font-size: 10px;
  color: var(--faint); letter-spacing: .08em;
}
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg2); color: var(--muted); position: relative;
  font-family: var(--mono); font-size: 13px;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 7px 8px;
  transition: .12s;
}
.cell.empty { background: transparent; border-color: transparent; }
.cell.today { border-color: var(--ink); color: var(--ink); }
.cell.logged { background: var(--panel2); color: var(--ink); }
.cell .mark { position: absolute; left: 6px; bottom: 5px; font-size: 13px; line-height: 1; }
.cell:hover:not(.empty) { border-color: var(--line2); }
.cell.today:hover { border-color: var(--ink); }

/* ---------- DAY EDITOR ---------- */
.editor {
  display: none; margin-top: 16px; border: 1px solid var(--line2);
  border-radius: var(--radius); background: var(--bg2); padding: 20px;
}
.editor.show { display: block; }
.editor h3 { font-family: var(--display); font-weight: 600; margin: 0 0 4px; font-size: 20px; }
.editor .hint { color: var(--faint); font-size: 13px; margin: 0 0 14px; }
.editor label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin: 14px 0 6px;
}
.editor textarea, .editor input[type=url] {
  width: 100%; background: var(--bg); border: 1px solid var(--line2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 13px; font-family: var(--body); font-size: 14px;
}
.editor textarea { min-height: 64px; resize: vertical; }
.editor textarea:focus, .editor input[type=url]:focus { outline: none; border-color: var(--ink); }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.roles button {
  background: var(--bg); border: 1px solid var(--line2); color: var(--muted);
  border-radius: 99px; padding: 7px 12px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 7px; transition: .12s;
}
.roles button:hover { border-color: var(--ink); color: var(--ink); }
.roles button.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.linkrow { display: flex; gap: 9px; align-items: center; margin-top: 8px; }
.linkrow:first-of-type { margin-top: 0; }
.linkrow .glyph { width: 28px; text-align: center; font-size: 15px; flex: none; }
.editor .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.save { background: var(--ink); color: var(--on-ink); border: 0; border-radius: var(--radius-sm); padding: 11px 20px; font-weight: 700; }
.save:hover { opacity: .88; }
.ghost { background: transparent; border: 1px solid var(--line2); color: var(--muted); border-radius: var(--radius-sm); padding: 11px 16px; }
.ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- FOOTER ---------- */
footer {
  margin: 80px 0 60px; padding-top: 28px; border-top: 1px solid var(--line);
  text-align: center; color: var(--faint); font-size: 12.5px; font-family: var(--mono);
  letter-spacing: .03em;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--on-ink); font-weight: 700;
  padding: 10px 20px; border-radius: 99px; font-size: 13px;
  font-family: var(--mono); opacity: 0; transition: .3s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* hidden file input for Import */
#importFile { display: none; }

/* ---------- MOTION / RESPONSIVE ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media (max-width: 560px) {
  .ephead { flex-wrap: wrap; }
  .epbar { order: 4; width: 100%; }
  .epcount { order: 3; }
  .confessional { flex-wrap: wrap; }
  .reshoot { margin-left: 0; }
  h1 .sub { margin-top: 12px; }
}

/* ============================================================================
   OPTIONAL: re-enable character COLOUR
   ----------------------------------------------------------------------------
   This theme is intentionally monochrome. If you ever want the characters'
   signature colours back (avatars, calendar marks, task tags), the colour for
   each character already lives in data.js as `color`. app.js sets a CSS
   variable --c on coloured elements; uncomment the rules below to use it:

   .av            { background: var(--c); border-color: var(--c); color: #111; }
   .castcard      { border-left: 4px solid var(--c); }
   .task .tag     { color: var(--c); }
   .cell .mark    { color: var(--c); }
   ============================================================================ */
