/* JoeAIWorks – "show your working": evidence is marked like a highlighter on paper. */
:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink: #172033;
  --ink-2: #4a5568;
  --line: #d5dce4;
  --cobalt: #2446c7;
  --cobalt-ink: #ffffff;
  --mark: #ffe27a;
  --ok: #0f7a5c;
  --warn: #a35a00;
  --bad: #b42318;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius-lg: 14px;
  --radius-sm: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1520; --surface: #172030; --ink: #e8edf4; --ink-2: #a7b2c3; --line: #2a3546;
    --cobalt: #7b95ff; --cobalt-ink: #0f1520; --mark: #6b5a12; --ok: #4fd1a5; --warn: #f0b35a; --bad: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--cobalt); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--cobalt); outline-offset: 2px;
}
mark { background: var(--mark); color: inherit; padding: 0 .15em; border-radius: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--cobalt); }
.top nav { display: flex; gap: 18px; font-size: .92rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--cobalt); background: var(--cobalt);
  color: var(--cobalt-ink); font: 600 .95rem var(--sans); padding: 10px 18px; border-radius: 999px; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--cobalt); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

/* hero */
.hero { display: grid; grid-template-columns: 200px 1fr; gap: 44px; align-items: start; padding: 40px 0 56px; }
.portrait { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 6px solid var(--surface);
  box-shadow: 0 1px 0 var(--line); }
.hero h1 { font: 600 clamp(2.1rem, 4.6vw, 3.4rem)/1.08 var(--serif); letter-spacing: -.02em; margin: 6px 0 18px; max-width: 16ch; }
.hero p { font-size: 1.08rem; color: var(--ink-2); max-width: 60ch; margin: 0 0 22px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.working { margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; font: .82rem/1.55 var(--mono); max-width: 640px; }
.working .q { font-family: var(--sans); font-size: .9rem; margin-bottom: 8px; color: var(--ink); }
.working ol { margin: 0; padding-left: 1.4em; color: var(--ink-2); }
.working li { opacity: 0; animation: reveal .5s ease forwards; }
.working li:nth-child(1) { animation-delay: .4s; } .working li:nth-child(2) { animation-delay: 1.2s; }
.working li:nth-child(3) { animation-delay: 2.0s; } .working li:nth-child(4) { animation-delay: 2.8s; }
@keyframes reveal { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .working li { animation: none; opacity: 1; } }

/* sections */
section { padding: 36px 0; border-top: 1px solid var(--line); }
section > h2 { font: 600 1.6rem/1.2 var(--serif); margin: 0 0 6px; letter-spacing: -.01em; }
section > .lead { color: var(--ink-2); margin: 0 0 22px; max-width: 70ch; }

/* project rows */
.project { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 16px; }
.project h3 { font: 600 1.35rem/1.25 var(--serif); margin: 0 0 6px; }
.project .tagline { margin: 0 0 12px; font-size: 1.02rem; }
.project .desc { color: var(--ink-2); font-size: .95rem; margin: 0 0 16px; }
.project ul.hl { margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.project ul.hl li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.project ul.hl li:last-child { border-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.tag { font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.state { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; margin-bottom: 10px; }
.state.live { background: rgba(15,122,92,.12); color: var(--ok); }
.state.coming_soon { background: rgba(163,90,0,.12); color: var(--warn); }
.state.in_development { background: var(--bg); color: var(--ink-2); }
.project .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.later { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.later div { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.later h3 { font: 600 1.1rem var(--serif); margin: 0 0 4px; }
.later p { margin: 0; color: var(--ink-2); font-size: .93rem; }

.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ways h3 { font: 600 1.08rem var(--sans); margin: 0 0 4px; }
.ways p { margin: 0; color: var(--ink-2); font-size: .94rem; }

footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--ink-2); font-size: .88rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* invite page */
.welcome { padding: 34px 0 20px; }
.welcome h1 { font: 600 clamp(1.9rem, 4vw, 2.6rem)/1.15 var(--serif); margin: 0 0 10px; }
.welcome p { color: var(--ink-2); max-width: 66ch; margin: 0 0 8px; }
.expiry { display: inline-block; background: var(--mark); color: var(--ink); padding: 3px 10px; border-radius: 4px; font-weight: 600; font-size: .92rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .expiry { color: #fff; } }
.note { background: var(--surface); border-left: 4px solid var(--cobalt); padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .92rem; color: var(--ink-2); margin: 18px 0; max-width: 760px; }

/* simple pages */
.center { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.center h1 { font: 600 2rem var(--serif); margin: 0 0 8px; }
.center p { color: var(--ink-2); max-width: 52ch; }

/* forms + admin */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px; }
.panel h2 { font: 600 1.25rem var(--serif); margin: 0 0 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
label .hint { font-weight: 400; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .92rem; }
.checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }
.created { background: var(--mark); color: var(--ink); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px; }
.created code { font: .95rem var(--mono); word-break: break-all; }
.linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th { text-align: left; font-weight: 600; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.active { background: rgba(15,122,92,.12); color: var(--ok); }
.pill.expired { background: var(--bg); color: var(--ink-2); }
.pill.revoked { background: rgba(180,35,24,.12); color: var(--bad); }
.muted { color: var(--ink-2); font-size: .85rem; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--cobalt); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; text-decoration: underline; }
.linkbtn.danger { color: var(--bad); }
.error { color: var(--bad); font-weight: 600; }
.table-scroll { overflow-x: auto; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
  .portrait { width: 120px; height: 120px; }
  .project, .later, .ways, .grid2 { grid-template-columns: 1fr; }
  .project { padding: 20px; gap: 16px; }
  .top nav { gap: 12px; }
  .wrap { padding: 0 16px; }
}

/* project options for visitors + request button */
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.opt { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  color: var(--ink); text-decoration: none; background: var(--bg); }
.opt svg { width: 20px; height: 20px; color: var(--cobalt); margin-bottom: 4px; }
.opt b { font-size: .9rem; line-height: 1.25; }
.opt span { font-size: .78rem; color: var(--ink-2); }
a.opt.open { border-color: var(--cobalt); }
a.opt.open span { color: var(--cobalt); font-weight: 600; }
.req { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; text-align: center; }
.req .muted { font-size: .8rem; }
.btn.mark { background: var(--mark); border-color: #d9b93b; color: #172033; font-weight: 600; }
.btn.mark:hover { filter: brightness(.96); }
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: .75rem; line-height: 1.4em; text-align: center; }
dialog#reqDlg { border: 0; border-radius: var(--radius-lg); padding: 24px; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); }
dialog#reqDlg::backdrop { background: rgba(15, 21, 32, .55); }
dialog#reqDlg h2 { font: 600 1.3rem var(--serif); margin: 0 0 4px; }
dialog#reqDlg fieldset { border: 0; padding: 0; margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 8px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 720px) { .options { grid-template-columns: 1fr; } }
tr.dim td { opacity: .55; }

/* wide hero illustration */
.hero.wide { grid-template-columns: minmax(260px, 400px) 1fr; align-items: center; }
.hero-art { width: 100%; height: auto; aspect-ratio: 626 / 382; object-fit: cover; border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15, 21, 32, .25); display: block; }
@media (max-width: 860px) { .hero.wide { grid-template-columns: 1fr; } .hero-art { max-width: 520px; } }
