:root {
  --ground: #070E1C;
  --ground-2: #0B1730;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #0F1B33;
  --raised: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #F8FAFC;
  --ink-2: rgba(248, 250, 252, 0.74);
  --ink-3: rgba(248, 250, 252, 0.48);
  --amber: #F5A623;
  --amber-light: #FFC65C;
  --amber-ink: #0A1628;
  --green: #5EDC8F;
  --red: #FF7B6B;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --glow: 0 0 0 1px rgba(245, 166, 35, 0.35), 0 22px 60px rgba(245, 166, 35, 0.16);
  --display: "Titan One", "Arial Black", Impact, sans-serif;
  --sans: "Rubik", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  background-image:
    radial-gradient(900px 520px at 8% -10%, rgba(245, 166, 35, 0.16), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, rgba(96, 140, 255, 0.14), transparent 60%),
    radial-gradient(1200px 800px at 50% 120%, rgba(245, 166, 35, 0.06), transparent 60%),
    linear-gradient(180deg, var(--ground-2), var(--ground) 40%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--amber-light); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--raised); padding: 1px 7px; border-radius: 7px; border: 1px solid var(--line); }
.mono { font-family: var(--mono); font-size: 0.8em; color: var(--ink-3); }
svg { display: inline-block; vertical-align: middle; }

/* ---------- Top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px clamp(12px, 3vw, 32px);
  padding: 10px var(--gutter);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(7, 14, 28, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--display); font-size: 21px; letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35); }
.brand b { color: var(--amber); font-weight: 400; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.nav a { color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 7px 13px; border-radius: 999px; transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease; }
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--raised); }
.nav a[aria-current="page"] { color: var(--amber-ink); background: linear-gradient(135deg, var(--amber-light), var(--amber)); box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35); }
.count { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 11px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.1em; }
.count b { font-family: var(--display); font-size: 36px; line-height: 1; font-weight: 400; background: linear-gradient(135deg, var(--amber-light), var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (max-width: 720px) {
  .top { grid-template-columns: 1fr auto; }
  .nav { grid-column: 1 / -1; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* ---------- Page ---------- */
.page { max-width: 1040px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 32px 64px; }
.page.wide { max-width: 1180px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); margin: 0 0 8px; }

.prose h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 5vw, 48px); line-height: 1.04; margin: 0 0 14px; letter-spacing: 0.005em; text-wrap: balance; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 28px); margin: 44px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--amber-light); letter-spacing: 0.01em; }
.prose h2:first-of-type { margin-top: 28px; }
.prose h3 { font-size: 17px; margin: 22px 0 6px; }
.prose p, .prose li { max-width: 74ch; color: var(--ink-2); }
.prose p strong, .prose li strong, .prose td strong { color: var(--ink); }
.prose li { margin: 5px 0; }
.prose del { color: var(--ink-3); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose blockquote { margin: 16px 0; padding: 10px 18px; border-left: 3px solid var(--amber); background: var(--panel); border-radius: 0 12px 12px 0; }
.prose pre { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; font-size: 13px; }
.prose pre code { background: none; padding: 0; border: 0; }
.lead > p:first-of-type { font-size: 17px; color: var(--ink); }

/* Tables that stay tables */
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 14px 0 24px; font-size: 14.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.prose thead th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.prose td { padding: 11px 14px; vertical-align: top; border-top: 1px solid var(--line); color: var(--ink-2); min-width: 60px; }
.prose tbody tr:first-child td { border-top: 0; }
.prose td:first-child { font-family: var(--mono); font-size: 13px; color: var(--amber); white-space: nowrap; }
.prose tbody tr:hover td { background: rgba(245, 166, 35, 0.05); }
.prose table p { margin: 0; }

/* Index lists */
.index { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; max-width: none; }
.index li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: none; transition: border-color 0.18s ease, background 0.18s ease; }
.index li:hover { border-color: var(--line-strong); background: var(--raised); }
.index li a { font-weight: 600; color: var(--ink); }
.index li a:hover { color: var(--amber-light); }
.state { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); background: rgba(245, 166, 35, 0.12); padding: 2px 9px; border-radius: 999px; }

/* Pills and chips */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
.pill-ok { color: var(--green); background: rgba(94, 220, 143, 0.12); border-color: rgba(94, 220, 143, 0.3); }
.pill-hot { color: var(--red); background: rgba(255, 123, 107, 0.12); border-color: rgba(255, 123, 107, 0.32); }
.pill-wait { color: var(--amber-light); background: rgba(245, 166, 35, 0.12); border-color: rgba(245, 166, 35, 0.34); }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip-for-zaal { background: rgba(245, 166, 35, 0.18); color: var(--amber-light); }
.chip-for-iman { background: rgba(94, 220, 143, 0.15); color: var(--green); }
.chip-link { background: rgba(245, 166, 35, 0.14); color: var(--amber-light); }
.chip-link:hover { text-decoration: none; background: rgba(245, 166, 35, 0.26); }

/* ---------- Task cards: the whole card is the link ---------- */
.tlist { display: grid; gap: 10px; margin: 16px 0 28px; max-width: none; }
.tcard {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 26px;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.tcard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(400px 120px at 0% 0%, rgba(245, 166, 35, 0.14), transparent 70%); opacity: 0; transition: opacity 0.22s ease; pointer-events: none; }
.tcard:hover, .tcard:focus-visible { text-decoration: none; transform: translateY(-2px); border-color: rgba(245, 166, 35, 0.45); box-shadow: var(--glow), 0 18px 40px rgba(0, 0, 0, 0.35); }
.tcard:hover::after { opacity: 1; }
.tcard:active { transform: translateY(0) scale(0.995); }
.tnum {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 16px;
  font-family: var(--display); font-size: 22px; line-height: 1; color: var(--amber-ink);
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.35), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.tnum.big { width: 72px; height: 72px; border-radius: 22px; font-size: 32px; }
.tbody { display: grid; gap: 4px; min-width: 0; }
.ttitle { font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--ink); letter-spacing: -0.005em; }
.tsum { color: var(--ink-2); font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tgo { color: var(--ink-3); justify-self: end; transition: transform 0.22s ease, color 0.22s ease; }
.tcard:hover .tgo { color: var(--amber-light); transform: translateX(3px); }
.tcard.is-done { opacity: 0.72; }
.tcard.is-done .tnum { background: linear-gradient(135deg, rgba(94, 220, 143, 0.9), rgba(94, 220, 143, 0.6)); box-shadow: 0 8px 20px rgba(94, 220, 143, 0.2); }
.tcard.is-done .ttitle { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.35); text-decoration-thickness: 1px; }
.tcard.is-done:hover { opacity: 1; }
@media (max-width: 560px) {
  .tcard { grid-template-columns: 44px 1fr; padding: 14px; gap: 12px; }
  .tnum { width: 44px; height: 44px; border-radius: 14px; font-size: 19px; }
  .tgo { display: none; }
  .ttitle { font-size: 16px; }
}

/* ---------- Task detail page ---------- */
.thero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin: 4px 0 20px; }
.task-page h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4.4vw, 42px); line-height: 1.08; margin: 0 0 12px; text-wrap: balance; }
.task-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.task-row { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 18px 24px; font-size: 17px; line-height: 1.6; color: var(--ink); margin-bottom: 8px; box-shadow: var(--shadow); }
.task-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--amber-light), var(--amber)); }
.draft-inline { margin: 28px 0; padding: 6px 22px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.draft-inline .card-head { margin-top: 14px; }
.draft-inline h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0; color: var(--amber-light); border: 0; padding: 0; }
.draft-inline h1 { font-size: 26px; }
.hist h3 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 20px 0 6px; }
.hist h3 a { color: var(--amber-light); }
.hist ul, .task-page ul { padding-left: 18px; }
.hist li { color: var(--ink-2); margin: 5px 0; }
@media (max-width: 560px) {
  .thero { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Issues ---------- */
.issue { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 10px 0; }
.issue-head a { font-weight: 600; color: var(--ink); font-size: 16px; }
.issue-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.issue details { margin-top: 10px; }
.issue summary { cursor: pointer; color: var(--amber-light); font-weight: 600; font-size: 14px; }
.issue .prose { margin-top: 8px; font-size: 15px; }

/* ---------- Footer ---------- */
.foot { max-width: 1040px; margin: 0 auto; padding: 18px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.foot a { color: var(--ink-2); }

/* ---------- Office (home) ---------- */
.office { display: grid; gap: 20px; }
.office-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; padding: 6px 0 10px; }
.office-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 5vw, 50px); line-height: 1.02; margin: 0 0 10px; text-wrap: balance; }
.asof { margin: 0; color: var(--ink-2); max-width: 70ch; font-size: 16.5px; }
.kpis { display: grid; grid-template-columns: repeat(4, auto); gap: 10px; }
.kpi { display: grid; gap: 3px; padding: 12px 16px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)); border: 1px solid var(--line); border-radius: 16px; color: var(--ink-3); font-size: 12px; line-height: 1.2; min-width: 130px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.kpi:hover { text-decoration: none; border-color: rgba(245, 166, 35, 0.4); transform: translateY(-2px); box-shadow: var(--glow); }
.kpi b { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; background: linear-gradient(135deg, var(--amber-light), var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; min-width: 0; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 10px; }
.card h2 { font-family: var(--display); font-weight: 400; font-size: 23px; margin: 0; color: var(--amber-light); letter-spacing: 0.01em; }
.card h2 .mono { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.card .tlist { margin: 6px 0 0; }
.more { font-size: 13px; font-weight: 600; }
.muted { color: var(--ink-3); }
.lead-line { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.items li { padding: 12px 14px; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.18s ease, background 0.18s ease; }
.items li:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.08); }
.item-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.item-sum { margin: 4px 0 6px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.item-sum a { color: var(--amber-light); }
.item-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranked li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 14.5px; }
.ranked li:first-child { border-top: 0; }
.ranked .rank { font-family: var(--display); font-size: 20px; color: var(--amber); line-height: 1.2; text-align: center; }
.ranked .task { color: var(--ink-2); }
.ranked .task strong { color: var(--ink); }
.ranked .sug { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; padding-left: 10px; border-left: 2px solid var(--amber); }
.sugs li { grid-template-columns: 34px 1fr; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.proj { display: grid; gap: 6px; padding: 14px 16px; background: var(--raised); border-radius: 16px; color: var(--ink-2); font-size: 13.5px; border: 1px solid var(--line); transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.proj:hover { text-decoration: none; border-color: rgba(245, 166, 35, 0.4); transform: translateY(-2px); box-shadow: var(--glow); }
.proj-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.proj-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.proj p { margin: 0; }
.live, .towards { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.live li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; color: var(--ink-2); }
.live b { color: var(--ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(94, 220, 143, 0.18), 0 0 12px rgba(94, 220, 143, 0.6); align-self: center; }
.towards li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; color: var(--ink-2); padding: 5px 0; border-top: 1px solid var(--line); }
.towards li:first-child { border-top: 0; }
.towards .when { color: var(--amber); align-self: start; padding-top: 3px; }
.towards strong { color: var(--ink); }
@media (max-width: 860px) {
  .two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .towards li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
