/*
 * Remix Systems client portal template.
 * Light by default, dark on the toggle. Green accent from the systems brand.
 */
:root, :root[data-theme="light"] {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --fg: #16181a;
  --muted: #5b6168;
  --line: #e2e3de;
  --accent: #127a44;
  --accent-soft: #e6f3ec;
  --accent-fg: #ffffff;
  --done: #9aa0a6;
  --shadow: 0 1px 2px rgba(20, 24, 28, .05), 0 4px 16px rgba(20, 24, 28, .04);
}
:root[data-theme="dark"] {
  --bg: #0f1112;
  --surface: #181b1d;
  --fg: #eceeee;
  --muted: #a3aaae;
  --line: #2a2f32;
  --accent: #4fd48a;
  --accent-soft: #16271e;
  --accent-fg: #0b1a12;
  --done: #6b7277;
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg);
  font: 16.5px/1.6 Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.locked > :not(#gate) { visibility: hidden; }
a { color: var(--accent); }
code, pre { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

.wrap { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }

/* top bar */
#top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: 48rem; margin: 0 auto; padding: 1.1rem 1rem; border-bottom: 1px solid var(--line);
}
.brand a { color: var(--fg); text-decoration: none; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.brand .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
.dim { color: var(--muted); font-weight: 400; }
nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: .35rem .65rem; border-radius: .5rem; font-size: .92rem; }
nav a:hover { color: var(--fg); background: var(--surface); }
nav a.on { color: var(--fg); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.theme { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: .5rem; padding: .3rem .6rem; font: inherit; font-size: .82rem; cursor: pointer; }

/* hero */
.hero { padding: 2.5rem 0 1.5rem; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .5rem; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin-bottom: .9rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .4rem; }
.lede { color: var(--muted); margin-top: .75rem; max-width: 40rem; }
.lede.small { margin: 0 0 1rem; }
section { padding: 1.25rem 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-top: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: .8rem; box-shadow: var(--shadow); }
.stat .n { font-size: 1.5rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .82rem; }

/* checklist */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.count { color: var(--muted); font-size: .88rem; }
.checks { list-style: none; display: grid; gap: .5rem; }
.checks li { display: flex; align-items: flex-start; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: .85rem 1rem; box-shadow: var(--shadow); }
.checks label { display: flex; gap: .8rem; flex: 1; cursor: pointer; }
.checks input { position: absolute; opacity: 0; }
.checks .box { flex: none; width: 1.25rem; height: 1.25rem; border: 2px solid var(--line); border-radius: .35rem; margin-top: .15rem; display: grid; place-items: center; }
.checks input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checks input:checked + .box::after { content: ''; width: .35rem; height: .65rem; border: solid var(--accent-fg); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checks input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks .txt { display: grid; gap: .15rem; }
.checks .txt span { color: var(--muted); font-size: .92rem; }
.checks li.done strong { text-decoration: line-through; color: var(--done); }
.checks li.done .txt span { color: var(--done); }
.go { flex: none; font-size: .88rem; font-weight: 600; text-decoration: none; padding: .2rem 0; }
.note { color: var(--muted); font-size: .8rem; margin-top: .6rem; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.tile { display: grid; gap: .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile span { color: var(--muted); font-size: .9rem; }

.tip { background: var(--accent-soft); border-radius: .75rem; padding: 1rem 1.1rem; margin: 1rem 0; }

/* message */
.msg p { color: var(--muted); margin: -.5rem 0 .6rem; }
textarea { width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: .7rem .8rem; resize: vertical; }
.btn { display: inline-block; margin-top: .6rem; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; padding: .55rem 1rem; border-radius: .6rem; }

/* what Andy is doing next, one line each, context on expand */
.ax { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); }
.ax details { border-bottom: 1px solid var(--line); }
.ax details:last-child { border-bottom: 0; }
.ax summary { cursor: pointer; list-style: none; padding: .7rem 1rem; display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; font-size: .95rem; }
.ax summary::-webkit-details-marker { display: none; }
.ax summary::after { content: '+'; color: var(--accent); font-weight: 700; }
.ax details[open] summary::after { content: '\2212'; }
.ax details p { padding: 0 1rem .8rem; color: var(--muted); font-size: .92rem; }

/* prompts */
.prompt { display: flex; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.prompt .num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.prompt .body { flex: 1; min-width: 0; }
.why { color: var(--muted); margin: .2rem 0 .7rem; }
.cmd { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: .85rem 4.5rem .85rem .9rem; }
.cmd pre { white-space: pre-wrap; word-wrap: break-word; font-size: .88rem; line-height: 1.55; }
.copy { position: absolute; top: .55rem; right: .55rem; font: inherit; font-size: .8rem; font-weight: 600; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: .4rem; padding: .3rem .6rem; cursor: pointer; }
.copy.done { opacity: .7; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; }
td, th { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .94rem; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cmds td:first-child { width: 34%; }
.plain { padding-left: 1.2rem; display: grid; gap: .4rem; }
section.tip + section.tip { margin-top: -.25rem; }
@media (max-width: 640px) { .cmds td, .cmds th { padding: .55rem .6rem; font-size: .88rem; } }
.cmds code { color: var(--accent); font-weight: 600; }
.pill { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .8rem; padding: .15rem .5rem; border-radius: 1rem; }

/* sessions */
.session { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.session summary { cursor: pointer; padding: .9rem 1rem; display: grid; gap: .1rem; list-style: none; }
.session summary::-webkit-details-marker { display: none; }
.session summary::after { content: 'Show'; color: var(--accent); font-size: .82rem; font-weight: 600; }
.session[open] summary::after { content: 'Hide'; }
.session .when, .session .meta { color: var(--muted); font-size: .85rem; }
.session .inner { padding: 0 1rem 1rem; }
.session ul { padding-left: 1.2rem; }
.session li { margin: .2rem 0; }

footer#foot { max-width: 48rem; margin: 2rem auto 0; padding: 1.5rem 1rem 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* gate */
#gate { position: fixed; inset: 0; background: var(--bg); z-index: 99; display: flex; align-items: center; justify-content: center; }
#gate .g { max-width: 23rem; width: 100%; padding: 0 1rem; text-align: center; }
#gate .mark { color: var(--accent); font-weight: 600; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 1.5rem; }
#gate p { color: var(--muted); margin: .5rem 0 1.25rem; }
#gate .row { display: flex; gap: .5rem; }
#gate input { flex: 1; min-width: 0; font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); color: var(--fg); }
#gate button { font: inherit; font-weight: 600; padding: .6rem 1rem; border: 0; border-radius: .6rem; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
#gate .err { color: #c0392b; font-size: .88rem; margin-top: .75rem; visibility: hidden; }
#gate .err.show { visibility: visible; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr; }
  nav { margin-left: 0; width: 100%; }
  .prompt { gap: .7rem; }
  .cmd { padding-right: .9rem; padding-top: 2.6rem; }
}
