/* Project pages — shares tokens with the homepage */
:root {
  --bg: #05070f; --surface: #0b101d; --surface-hover: #111828;
  --border: rgba(148,163,184,0.14); --text: #e7ecf5; --muted: #97a3b8;
  --accent: #5b8def; --accent-2: #a78bfa; --accent-soft: rgba(91,141,239,0.12);
  --grad: linear-gradient(120deg, #5b8def, #a78bfa);
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.65; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(91,141,239,0.14), transparent 60%);
  background-repeat: no-repeat;
}
h1, h2, h3 { font-family: 'Archivo', system-ui, sans-serif; line-height: 1.15; letter-spacing: -0.02em; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: #fff; font-weight: 600; padding: 0.75rem 1.25rem; border-radius: 0.5rem; text-decoration: none; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* nav — same as homepage */
nav.site { position: sticky; top: 0; z-index: 50; background: rgba(5,7,15,0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
nav.site .inner { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; height: 4rem; display: flex; align-items: center; justify-content: space-between; }
nav.site .logo { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.5rem; }
nav.site .logo svg { width: 1.15rem; height: 1.15rem; color: var(--accent); }
nav.site .links { display: flex; align-items: center; gap: 0.35rem; }
nav.site .links a { font-size: 0.875rem; color: var(--muted); text-decoration: none; padding: 0.5rem 0.9rem; border-radius: 0.5rem; transition: color .2s, background .2s; }
nav.site .links a:hover, nav.site .links a[aria-current="page"] { color: var(--text); background: var(--surface-hover); }
nav.site .links a.btn { color: #fff; background: var(--accent); font-weight: 500; margin-left: 0.35rem; }
nav.site .links a.btn:hover { background: #6f9bf2; }
@media (max-width: 600px) { nav.site .links a:not(.btn):not(.keep) { display: none; } }

/* breadcrumb + header */
.crumbs { font-size: 0.8rem; color: var(--muted); padding-top: 2.25rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.crumbs li + li::before { content: '/'; margin-right: 0.4rem; opacity: 0.5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.p-head { padding: 1.5rem 0 1.5rem; }
.p-head .kicker { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.p-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
.p-head .lede { margin-top: 0.9rem; font-size: clamp(1rem, 1.8vw, 1.15rem); color: var(--muted); max-width: 44rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.75rem; background: rgba(11,16,29,0.6); }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tag.public .dot { background: var(--ok); }
.tag.private .dot { background: var(--warn); }
.tag.local .dot { background: var(--accent-2); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.actions a, .actions span.note {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; text-decoration: none;
  padding: 0.7rem 1.25rem; border-radius: 0.6rem; transition: filter .2s, border-color .2s, transform .2s;
}
.actions a svg, .actions span.note svg { width: 1rem; height: 1rem; }
.actions .primary { background: var(--grad); color: #fff; box-shadow: 0 8px 28px rgba(91,141,239,0.25); }
.actions .primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.actions .secondary { border: 1px solid var(--border); color: var(--text); background: rgba(11,16,29,0.6); }
.actions .secondary:hover { border-color: var(--accent); transform: translateY(-1px); }
.actions span.note { border: 1px dashed var(--border); color: var(--muted); cursor: default; }

/* demo frame */
.demo-wrap { margin: 1.75rem 0 0.5rem; }
.demo {
  position: relative; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden;
  background: linear-gradient(180deg, rgba(11,16,29,0.9), rgba(8,11,22,0.95));
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.demo canvas { display: block; width: 100%; }
.demo-badge {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 4; display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: #1a1206; background: var(--warn); border-radius: 999px; padding: 0.28rem 0.7rem; pointer-events: none;
}
.demo-badge.illus { color: #0b1020; background: #a5b4fc; }
.demo-caption { font-size: 0.8rem; color: var(--muted); margin-top: 0.7rem; }
.demo.game { height: min(72vh, 560px); min-height: 380px; }
.demo.game .bw-root { position: absolute; inset: 0; }

/* body sections */
.p-body { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2.5rem; padding: 2.5rem 0 3rem; }
@media (max-width: 860px) { .p-body { grid-template-columns: 1fr; } }
.p-body section + section { margin-top: 2.25rem; }
.p-body h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
.p-body p { color: #c9d2e3; }
.p-body p + p { margin-top: 0.8rem; }
.p-body ul.built { list-style: none; display: grid; gap: 0.6rem; }
.p-body ul.built li { position: relative; padding-left: 1.4rem; color: #c9d2e3; }
.p-body ul.built li::before { content: ''; position: absolute; left: 0.2rem; top: 0.65em; width: 7px; height: 7px; border-radius: 2px; background: var(--grad); }
aside.facts { align-self: start; position: sticky; top: 5.5rem; background: rgba(11,16,29,0.62); border: 1px solid var(--border); border-radius: 1rem; padding: 1.25rem; }
aside.facts h2 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-family: 'Space Grotesk', sans-serif; margin-bottom: 0.9rem; }
aside.facts dl { display: grid; gap: 0.85rem; }
aside.facts dt { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
aside.facts dd { font-size: 0.9rem; color: var(--text); }
aside.facts dd a { color: var(--accent); text-decoration: none; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font-size: 0.76rem; color: var(--text); border: 1px solid var(--border); background: rgba(91,141,239,0.08); border-radius: 0.45rem; padding: 0.2rem 0.55rem; }
.callout { border: 1px solid rgba(251,191,36,0.3); background: rgba(251,191,36,0.06); border-radius: 0.8rem; padding: 0.9rem 1rem; font-size: 0.88rem; color: #e8dcc0; }
.callout strong { color: #fde68a; }

/* prev/next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-bottom: 3.5rem; }
.pn a { display: block; border: 1px solid var(--border); border-radius: 0.9rem; padding: 1rem 1.2rem; text-decoration: none; background: rgba(11,16,29,0.55); transition: border-color .2s, transform .2s; }
.pn a:hover { border-color: rgba(91,141,239,0.55); transform: translateY(-2px); }
.pn small { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pn b { color: var(--text); font-weight: 600; }
.pn .next { text-align: right; }

/* projects index */
.p-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; padding: 1rem 0 3rem; }
@media (max-width: 900px) { .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .p-grid { grid-template-columns: 1fr; } }
.p-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; text-decoration: none; background: rgba(11,16,29,0.62); transition: border-color .25s, transform .25s, box-shadow .25s; }
.p-card:hover { border-color: rgba(91,141,239,0.55); transform: translateY(-4px); box-shadow: 0 14px 40px rgba(91,141,239,0.13); }
.p-card .thumb { aspect-ratio: 16 / 9; background: #0a0e1a; overflow: hidden; }
.p-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-card .body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.p-card h2, .p-card h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.p-card p { font-size: 0.86rem; color: var(--muted); flex: 1; }
.p-card .meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.p-card .tag { font-size: 0.7rem; padding: 0.2rem 0.6rem; }
.group-title { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }

footer.site { border-top: 1px solid var(--border); padding: 1.75rem 0; text-align: center; font-size: 0.82rem; color: var(--muted); }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); }

/* shared mock-dashboard pieces used by demos */
.mock { padding: 1.1rem; font-size: 0.82rem; color: var(--text); }
.mock .row { display: grid; gap: 0.75rem; }
.mock .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .mock .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mock .kpi { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 0.7rem; padding: 0.7rem 0.8rem; }
.mock .kpi span { display: block; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mock .kpi b { display: block; font-size: 1.15rem; font-family: 'Archivo', sans-serif; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.mock .kpi i { font-style: normal; font-size: 0.72rem; color: var(--ok); }
.mock .kpi i.neg { color: var(--bad); }
.mock .panel { background: rgba(255,255,255,0.025); border: 1px solid var(--border); border-radius: 0.7rem; padding: 0.8rem; min-width: 0; }
.mock .panel h4 { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 0.5rem; font-family: 'Space Grotesk', sans-serif; }
.mock table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.mock th { text-align: left; font-weight: 500; color: var(--muted); padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mock td { padding: 0.4rem; border-bottom: 1px solid rgba(148,163,184,0.07); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mock .pill { display: inline-block; font-size: 0.66rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: rgba(52,211,153,0.14); color: var(--ok); }
.mock .pill.w { background: rgba(251,191,36,0.14); color: var(--warn); }
.mock .pill.b { background: rgba(91,141,239,0.16); color: #9db8f5; }
.mock .pill.r { background: rgba(248,113,113,0.14); color: var(--bad); }
.mock .scroll-x { overflow-x: auto; }

/* live app embed */
.live-wrap { width: min(80rem, calc(100vw - 2rem)); position: relative; left: 50%; transform: translateX(-50%); }
.live-frame {
  border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; background: var(--surface);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.live-bar {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem; font-size: 0.78rem; color: var(--muted);
  border-bottom: 1px solid var(--border); background: rgba(11,16,29,0.9);
}
.live-bar > span:nth-child(2) { color: var(--text); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.7rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.55); } 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.live-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.live-bar a { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; color: var(--accent); text-decoration: none; font-weight: 500; white-space: nowrap; }
.live-bar a:hover { color: var(--text); }
.live-bar a svg { width: 0.9rem; height: 0.9rem; }
.live-frame iframe { display: block; width: 100%; height: 80vh; min-height: 520px; border: 0; background: #f6f7fb; }
@media (min-width: 1024px) { .live-frame iframe { height: 88vh; min-height: 680px; } }
@media (max-width: 480px) { .live-host { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-wrap .demo-caption { max-width: 64rem; margin-left: auto; margin-right: auto; padding: 0 0.5rem; }
