/* WorxOS — AIM build board. Tokens follow ABOUT ME/aim-design-system (orange #FF8220, Ubuntu structure, Nunito prose). */
@font-face { font-family: "Ubuntu"; src: url("fonts/Ubuntu-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("fonts/Ubuntu-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-var.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("fonts/Ubuntu-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --brand: #FF8220;
  --brand-deep: #E0701A;
  --brand-soft: #FFF1E5;
  --ink: #111111;
  --ink-2: #3D3A36;
  --identity: #75716B;
  --muted: #8A857D;
  --paper: #F6F5F2;
  --card: #FFFFFF;
  --line: #E4E2DD;
  --line-strong: #CFCBC4;
  --hero: #000000;
  --hero-ink: #FFFFFF;
  --st-attention: #FF8220;
  --st-blocked: #DC2626;
  --st-building: #2563EB;
  --st-live: #15803D;
  --st-planned: #7C7770;
  --st-retiring: #A8A29E;
  --block-bg: #FEF2F2;
  --block-ink: #991B1B;
  --due-bg: #FFF1E5;
  --font-head: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Nunito", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: #2A1B0E;
    --ink: #F2F0EC; --ink-2: #CFCBC4; --identity: #A8A29A; --muted: #8E887F;
    --paper: #0E0E0D; --card: #181816; --line: #2A2926; --line-strong: #3A3834;
    --st-blocked: #F87171; --st-building: #60A5FA; --st-live: #4ADE80; --st-planned: #A8A29E; --st-retiring: #78716C;
    --block-bg: #2A1414; --block-ink: #FCA5A5; --due-bg: #2A1B0E;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-soft: #2A1B0E;
  --ink: #F2F0EC; --ink-2: #CFCBC4; --identity: #A8A29A; --muted: #8E887F;
  --paper: #0E0E0D; --card: #181816; --line: #2A2926; --line-strong: #3A3834;
  --st-blocked: #F87171; --st-building: #60A5FA; --st-live: #4ADE80; --st-planned: #A8A29E; --st-retiring: #78716C;
  --block-bg: #2A1414; --block-ink: #FCA5A5; --due-bg: #2A1B0E;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.bar { background: var(--hero); color: var(--hero-ink); position: sticky; top: 0; z-index: 20; }
.bar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand b { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand span { font-family: var(--font-head); color: #A8A29A; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .grow { flex: 1; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid #2E2D2A; background: transparent; color: #E7E4DE; cursor: pointer; font-family: var(--font-head); font-size: 13px; }
.iconbtn:hover { border-color: #57534E; }
.iconbtn:focus-visible, .chip:focus-visible, .btn:focus-visible, .card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Hero */
.hero { background: linear-gradient(180deg, #000 0%, #141210 100%); color: #fff; padding: 28px 0 24px; }
.eyebrow { font-family: var(--font-head); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #A8A29A; margin: 0 0 6px; }
.hero h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 4.4vw, 40px); line-height: 1.1; margin: 0 0 6px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.sub { margin: 0; color: #CFCBC4; max-width: 60ch; }
.tally { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.tally button { text-align: left; background: #1A1917; border: 1px solid #2A2926; color: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.tally button[aria-pressed="true"] { border-color: var(--brand); background: #221A12; }
.tally .n { display: block; font-family: var(--font-head); font-weight: 700; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tally .l { display: flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 12px; color: #CFCBC4; }
.st-attention { --c: var(--st-attention); } .st-blocked { --c: var(--st-blocked); } .st-building { --c: var(--st-building); }
.st-live { --c: var(--st-live); } .st-planned { --c: var(--st-planned); } .st-retiring { --c: var(--st-retiring); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, var(--muted)); }

/* Needs you */
.needs { margin: 20px 0 8px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.needs h2 { font-family: var(--font-head); font-size: 16px; margin: 0; padding: 14px 16px 6px; display: flex; align-items: center; gap: 8px; }
.needs ol { list-style: none; margin: 0; padding: 0 8px 8px; }
.needs li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; padding: 10px 8px; border-top: 1px solid var(--line); }
.needs li:first-child { border-top: 0; }
.needs .who { font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.needs .what { color: var(--ink-2); grid-column: 1; font-size: 14px; }
.needs .go { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.needs .more { margin: 0 16px 14px; }
.needs .empty { padding: 4px 16px 16px; color: var(--muted); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 6px; }
.search { position: relative; flex: 1 1 240px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); padding: 0 12px 0 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; font-family: var(--font-head); font-size: 13px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.resultline { font-family: var(--font-head); font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* Board */
.section { margin: 26px 0 6px; }
.section h2 { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .04em; }
.section h2 small { font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; position: relative; }
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.card.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: var(--shadow); } }
.card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-family: var(--font-head); font-size: 11.5px; font-weight: 500; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.pill.private { color: var(--identity); }
.card h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin: 0; line-height: 1.25; letter-spacing: -.005em; }
.lbl { font-family: var(--font-head); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 2px; }
.card p { margin: 0; }
.card .now { color: var(--ink-2); font-size: 14px; }
.card .next { font-size: 14.5px; font-weight: 600; display: flex; gap: 6px; }
.card .next svg { color: var(--brand); margin-top: 3px; }
.card .next.none { font-weight: 400; color: var(--muted); }
.blocker { background: var(--block-bg); color: var(--block-ink); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; display: flex; gap: 8px; }
.blocker svg { margin-top: 2px; }
.blocker b { font-family: var(--font-head); }
.due { background: var(--due-bg); color: var(--brand-deep); border-radius: 6px; padding: 2px 8px; font-family: var(--font-head); font-size: 12px; font-weight: 700; white-space: nowrap; }
.due.over { background: var(--block-bg); color: var(--block-ink); }
.card footer { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--font-head); font-size: 12px; color: var(--muted); }
.card footer .grow { flex: 1; }
.quiet { color: var(--identity); }
.btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; font-family: var(--font-head); font-size: 12px; color: var(--ink-2); text-decoration: none; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #000; font-weight: 700; }
.empty-board { padding: 40px 0; text-align: center; color: var(--muted); }

/* Banner, footer, toast */
.banner { background: var(--brand-soft); border-bottom: 1px solid var(--line); font-family: var(--font-head); font-size: 13px; color: var(--ink-2); }
.banner .wrap { padding-top: 8px; padding-bottom: 8px; }
.foot { margin: 40px 0 30px; font-family: var(--font-head); font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-family: var(--font-head); font-size: 13px; transition: .2s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Sign-in */
.gate { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px 16px; }
.gate form { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.gate h1 { font-family: var(--font-head); font-size: 22px; margin: 0 0 4px; }
.gate p { color: var(--ink-2); margin: 0 0 16px; font-size: 14px; }
.field { display: block; margin: 0 0 12px; }
.field span { display: block; font-family: var(--font-head); font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); padding: 9px 11px; }
.field textarea { min-height: 72px; resize: vertical; }
.gate .btn.primary, dialog .btn.primary { height: 40px; width: 100%; justify-content: center; font-size: 14px; }
.gate .err { color: var(--st-blocked); font-size: 13px; min-height: 18px; margin: 6px 0 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--identity); text-decoration: underline; cursor: pointer; font-family: var(--font-head); font-size: 12px; margin-top: 12px; }

dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); padding: 20px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { font-family: var(--font-head); font-size: 18px; margin: 0 0 12px; }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog .actions { display: flex; gap: 8px; margin-top: 8px; }
dialog .actions .btn { height: 40px; flex: 1; justify-content: center; }

@media (max-width: 900px) { .tally { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .brand span { display: none; }
  .tally { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tally .l { font-size: 11px; }
  .grid { grid-template-columns: 1fr; }
  .needs li { grid-template-columns: 1fr; }
  .needs .go { grid-row: auto; grid-column: 1; justify-self: start; }
  dialog .row { grid-template-columns: 1fr; }
  .iconbtn .t { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .bar, .controls, .card footer .btn, .tally { display: none; } .hero { background: none; color: #000; } }
.resultline .linkbtn { margin: 0; }
