/* CompInfo — statutory deadline dashboard for Rogue Design Ltd.
   Mobile-first. Urgency is the colour language: the state of the data is the
   decoration. One hero instrument for the nearest deadline, a quiet ledger for
   the rest. Light and dark via prefers-color-scheme. */

:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --ink: #141a21;
  --ink-soft: #46535f;
  --ink-faint: #76838f;
  --line: #dde3ea;
  --line-strong: #c6cfd9;

  /* Urgency scale — used for text, borders and the hero wash. */
  --green: #0f8a55;
  --green-wash: #e3f5ec;
  --amber: #a9690a;
  --amber-wash: #fbefdc;
  --red: #c02b2b;
  --red-wash: #fbe4e2;
  --overdue: #8f1d1d;
  --overdue-wash: #f6dad7;

  --radius: 14px;
  --maxw: 34rem;
  --gutter: 16px;

  font-synthesis-weight: none;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  body { background: transparent; }

  :root {
    --bg: #0e1116;
    --panel: #171d25;
    --panel-2: #1c232d;
    --ink: #eef2f6;
    --ink-soft: #b2bdc9;
    --ink-faint: #7e8b98;
    --line: #28313c;
    --line-strong: #37424f;

    --green: #58d6a0;
    --green-wash: #10261d;
    --amber: #e4a94e;
    --amber-wash: #2a2011;
    --red: #f3756b;
    --red-wash: #2d1513;
    --overdue: #ff8a7e;
    --overdue-wash: #351311;
  }
}

* { box-sizing: border-box; }

/* The flowing WebGL canvas (flowing-bg.js, #flow-bg, z-index:-1) is dark-mode
   only — the masthead/footer text sits directly on the body, so a dark flow
   behind light mode would wreck contrast. Keep the solid --bg in light mode;
   in dark mode the body goes transparent so the canvas shows through. The
   --bg on <html> is the base/fallback behind the canvas. */
html { -webkit-tap-highlight-color: transparent; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding: max(env(safe-area-inset-top), 10px) var(--gutter) 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body > * { width: 100%; max-width: var(--maxw); }

.noscript {
  background: var(--red-wash); color: var(--red);
  padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
}

/* ---- staleness banner -------------------------------------------------- */
.stale {
  background: var(--overdue); color: #fff;
  padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem;
  font-weight: 600; font-size: .9rem;
}

/* ---- masthead ---------------------------------------------------------- */
.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .25rem 1rem;
  padding: .5rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.identity h1 {
  margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em;
}
.reg { margin: .15rem 0 0; color: var(--ink-faint); font-size: .82rem; }
.reg .status-dot { color: var(--green); font-weight: 700; }
.reg-link { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.reg-link:hover { color: var(--green); }
.asof {
  margin: 0; color: var(--ink-faint); font-size: .76rem;
  text-align: right; flex: 1 1 auto; min-width: 9rem;
}
.asof strong { color: var(--ink-soft); font-weight: 600; }

/* ---- hero: the nearest deadline, as an instrument ---------------------- */
.hero {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--u);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.4rem;
  margin-bottom: 1.6rem;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--u-wash); opacity: .55; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero .kicker {
  margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  color: var(--u); text-transform: uppercase;
}
.hero .label { margin: .3rem 0 .9rem; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; }

.countdown { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.countdown .days {
  font-size: clamp(3.6rem, 22vw, 5.2rem);
  font-weight: 800; line-height: .9; letter-spacing: -0.04em;
  color: var(--u); font-variant-numeric: tabular-nums;
}
.countdown .days-unit { font-size: 1.1rem; font-weight: 600; color: var(--ink-soft); }
.clock {
  margin: .5rem 0 0; font-variant-numeric: tabular-nums;
  font-size: 1.25rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em;
}
.hero.is-overdue .clock { color: var(--u); }

.hero .due { margin: 1rem 0 .15rem; font-size: 1.02rem; font-weight: 600; }
.hero .detail { margin: 0; color: var(--ink-soft); font-size: .9rem; }

.action {
  display: inline-block; margin-top: 1.15rem;
  background: var(--u); color: #fff; text-decoration: none;
  padding: .7rem 1.2rem; border-radius: 10px; font-weight: 650; font-size: .95rem;
}
.action:focus-visible { outline: 3px solid var(--u); outline-offset: 3px; }
@media (hover: hover) { .action:hover { filter: brightness(1.06); } }

/* ---- the ledger of remaining deadlines --------------------------------- */
.section-heading {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-faint); text-transform: uppercase;
  margin: 0 0 .6rem; padding-left: .1rem;
}
.rows, .done-rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: .4rem 1rem;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--u);
  border-radius: 11px; padding: .85rem 1rem; margin-bottom: .6rem;
  text-decoration: none; color: inherit;
}
.row:focus-visible { outline: 3px solid var(--u); outline-offset: 2px; }
.row .r-days {
  grid-row: span 2; text-align: center; min-width: 3.1rem;
  color: var(--u); font-variant-numeric: tabular-nums;
}
.row .r-days b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.row .r-days span { font-size: .66rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.row .r-label { font-weight: 650; font-size: 1rem; align-self: end; }
.row .r-due { color: var(--ink-faint); font-size: .8rem; align-self: start; grid-column: 2; }
.row .r-go { grid-row: span 2; color: var(--ink-faint); font-size: 1.2rem; }

/* ---- done strip -------------------------------------------------------- */
.done { margin-top: 1.6rem; }
.done-rows li {
  display: flex; align-items: center; gap: .6rem;
  color: var(--ink-faint); font-size: .9rem;
  padding: .55rem .9rem; border: 1px dashed var(--line-strong);
  border-radius: 10px; margin-bottom: .45rem; background: var(--panel-2);
}
.done-rows .tick { color: var(--green); font-weight: 800; }
.done-rows .d-label { text-decoration: line-through; text-decoration-thickness: 1px; }
.done-rows .d-note { margin-left: auto; font-size: .78rem; font-style: italic; }

/* ---- urgency bindings -------------------------------------------------- */
.u-green  { --u: var(--green);  --u-wash: var(--green-wash); }
.u-amber  { --u: var(--amber);  --u-wash: var(--amber-wash); }
.u-red    { --u: var(--red);    --u-wash: var(--red-wash); }
.u-overdue{ --u: var(--overdue);--u-wash: var(--overdue-wash); }

/* ---- misc -------------------------------------------------------------- */
.status { color: var(--ink-faint); font-size: .9rem; text-align: center; padding: 1.5rem 0; }
.status.error { color: var(--red); }
.footer {
  margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: .76rem; line-height: 1.5;
}
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
