/* MuseHub: sunrise field, ink-titled windows, dithered dawn hero */
:root {
  --marigold: #f4b23e;
  --marigold-2: #f7c465;
  --ember: #e06b2d;
  --cream: #fff1cf;
  --ink: #1b1916;
  --paper: #fffdf7;
  --win: #e3dfd6;
  --line: #cfc9bd;
  --night: #16140f;
  --ultra: #3346d3;
  --approve: #1f9d63;
  --rework: #c98300;
  --reject: #cf3b3b;
  --muted: #6f685d;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --max: 1152px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--marigold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ultra); outline-offset: 2px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: var(--night); color: #f5f0e6; border-bottom: 1px solid #332f28; }
.nav-in { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 11px 20px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.logo svg { width: 20px; height: 20px; display: block; }
.x-link { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #5a544a; color: #f5f0e6; text-decoration: none; margin-left: -10px; }
.x-link:hover { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }
.nav-links { display: flex; gap: 18px; font-size: 13.5px; }
.nav-links a { text-decoration: none; color: #f5f0e6; opacity: .7; white-space: nowrap; }
.nav-links a:hover, .nav-links a.on { opacity: 1; }
.nav-links a.on { box-shadow: inset 0 -1px 0 var(--marigold); }
.nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 6px 12px; font-size: 13px; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--cream); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sun { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }
.btn-sun:hover { background: var(--marigold-2); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #3a352d; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.burger { display: none; background: none; border: 1px solid #5a544a; color: inherit; padding: 3px 9px; font-size: 15px; }

/* ---------- token strip ---------- */
.ca-bar { position: sticky; top: 45px; z-index: 39; background: #24211b; color: #f5f0e6; border-bottom: 1px solid #332f28; font-family: var(--mono); font-size: 12px; }
.ca-in { max-width: var(--max); margin: 0 auto; padding: 6px 20px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ca-soft { opacity: .6; }
.ca-note { color: var(--cream); overflow: hidden; text-overflow: ellipsis; }
.ca-addr { background: none; border: 0; color: inherit; font: inherit; padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-addr b { font-weight: 500; color: var(--cream); }
.ca-addr .ca-short { display: none; }
.ca-hint { color: var(--marigold); margin-left: 4px; }
.ca-addr:hover .ca-hint { text-decoration: underline; }
.ca-link { margin-left: auto; color: var(--marigold); text-decoration: none; }
.ca-link:hover { text-decoration: underline; }

/* ---------- tags ---------- */
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 7px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); line-height: 1.4; white-space: nowrap; }
.t-sun { background: var(--marigold); }
.t-dark { background: var(--ink); color: var(--paper); }
.g-approve, .g-rework, .g-reject { color: #fff; border-color: transparent; }
.g-approve { background: var(--approve); }
.g-rework { background: var(--rework); }
.g-reject { background: var(--reject); }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--night); color: #f5f0e6; overflow: hidden; min-height: min(92vh, 860px); display: flex; align-items: flex-end; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hero-in { position: relative; max-width: var(--max); margin: 0 auto; width: 100%; padding: 300px 20px 76px; text-align: center; text-shadow: 0 0 28px rgba(22,20,15,.7); pointer-events: none; }
.hero-in a { pointer-events: auto; }
.kicker { font-family: var(--mono); font-size: 12px; opacity: .82; }
.hero h1 { font-size: clamp(42px, 7.6vw, 96px); line-height: .96; letter-spacing: -.04em; font-weight: 600; margin: 18px 0 20px; text-wrap: balance; }
.hero p.sub { max-width: 34em; margin: 0 auto 30px; font-size: 17px; line-height: 1.55; opacity: .86; }
.cta { display: inline-flex; flex-wrap: wrap; justify-content: center; }
.cta a { padding: 12px 20px; font-size: 16px; border: 1px solid var(--marigold); text-decoration: none; }
.cta a:first-child { background: var(--marigold); color: var(--ink); }
.cta a:first-child:hover { background: var(--marigold-2); }
.cta a:last-child { background: rgba(22,20,15,.72); color: #f5f0e6; }
.cta a:last-child:hover { background: rgba(22,20,15,.9); }
.hint { position: absolute; right: 26px; top: 22px; font-family: var(--mono); font-size: 11px; opacity: .45; }
.frame { position: absolute; width: 14px; height: 14px; border: 0 solid #f5f0e6; opacity: .65; }
.frame.tl { left: 22px; top: 22px; border-left-width: 1px; border-top-width: 1px; }
.frame.bl { left: 22px; bottom: 22px; border-left-width: 1px; border-bottom-width: 1px; }
.frame.br { right: 22px; bottom: 22px; border-right-width: 1px; border-bottom-width: 1px; }

/* ---------- field of windows ---------- */
.field { background: var(--marigold); background-image: radial-gradient(rgba(27,25,22,.2) 1px, transparent 1.2px); background-size: 6px 6px; padding: 56px 20px 76px; }
.field-in { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; align-items: start; }
.win { background: var(--win); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); min-width: 0; }
.win-t { background: var(--ink); color: var(--paper); font-family: var(--pixel); font-size: 16px; line-height: 1; padding: 5px 6px 5px 9px; display: flex; align-items: center; gap: 10px; }
.win-t small { font-family: var(--mono); font-size: 10.5px; opacity: .6; }
.win-t .ctl { margin-left: auto; display: flex; gap: 4px; }
.win-t .ctl i { width: 11px; height: 11px; border: 1px solid #8a8378; display: block; }
.win-t .ctl i:last-child { background: var(--marigold); border-color: var(--marigold); }
.win-big { background: var(--ink); color: var(--paper); font-family: var(--pixel); font-size: 44px; line-height: 1; padding: 8px 10px 10px; margin: 3px; overflow-wrap: anywhere; }
.win-big.md { font-size: 30px; }
.win-big.sm { font-size: 24px; }
.win-b { padding: 9px 11px 11px; font-size: 14.5px; line-height: 1.5; }
.win-b a, .win-p a { color: var(--ultra); }
.win-p { background: var(--paper); margin: 3px; padding: 10px 12px; font-size: 14px; line-height: 1.55; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

/* tally bars */
.tally { display: grid; grid-template-columns: 76px 1fr 44px; gap: 10px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.tally:last-child { border-bottom: 0; }
.track { height: 12px; border: 1px solid var(--ink); background: repeating-linear-gradient(90deg, #fff 0 5px, #efebe3 5px 6px); position: relative; display: block; }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.tally b { text-align: right; font-weight: 500; }
.tally-note { font-size: 13px; color: #5c554b; padding: 8px 2px 2px; }

/* terminal lines */
.cmd { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #f5f0e6; font-family: var(--mono); font-size: 12.5px; padding: 8px 10px; margin: 3px; overflow-x: auto; white-space: nowrap; }
.cmd::before { content: "$"; color: var(--marigold); }
.cmd .cp { margin-left: auto; background: var(--win); color: var(--ink); border: 0; font-family: var(--pixel); font-size: 13px; padding: 1px 8px; }
.cmd .cp:hover { background: var(--marigold); }

/* ask muse (home) */
.ask label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ask-row { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chips button { border: 1px dashed #8a8378; background: transparent; font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; color: #4a443b; }
.chips button:hover { border-style: solid; border-color: var(--ink); color: var(--ink); }
.verdict { display: grid; grid-template-columns: 150px 1fr; gap: 3px; margin: 3px; }
.verdict[hidden] { display: none; }
.v-gate { background: var(--paper); padding: 12px; display: grid; align-content: center; gap: 6px; }
.v-gate .word { font-family: var(--pixel); font-size: 34px; line-height: 1; padding: 4px 9px 6px; color: #fff; justify-self: start; }
.v-gate .why { font-size: 12.5px; color: #5c554b; line-height: 1.45; }
.v-bars { background: var(--paper); padding: 10px 12px; display: grid; gap: 7px; }
.v-bars .tally { border: 0; padding: 0; grid-template-columns: 110px 1fr 70px; }
.pop .word { animation: pop .35s steps(3); }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

/* project rows (home) */
.proj { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.proj:last-child { border-bottom: 0; }
.proj a { text-decoration: none; overflow-wrap: anywhere; }
.proj a:hover { text-decoration: underline; }
.own { color: var(--muted); font-weight: 400; }

/* pulse feed */
.feed { max-height: 380px; overflow-y: auto; }
.ev { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed #c4bdb0; font-size: 13.5px; line-height: 1.45; align-items: baseline; }
.ev time { font-family: var(--mono); font-size: 11px; color: #8a8378; }
.ev b { font-weight: 600; }
.ev .tag { margin: 0 2px; }
.ev .muse { background: var(--marigold); border-color: var(--marigold); }
.ev.fresh { animation: flash 1.4s ease; }
@keyframes flash { from { background: var(--cream); } to { background: transparent; } }
.page .ev { grid-template-columns: 70px 1fr; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }

/* numbered steps: only for real sequences */
.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(s); font-family: var(--pixel); font-size: 18px; background: var(--ink); color: var(--marigold); width: 24px; height: 24px; display: grid; place-items: center; }

/* ---------- inner pages ---------- */
.page { max-width: var(--max); width: 100%; margin: 0 auto; padding: 36px 20px 80px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding: 22px 18px; border: 1px solid var(--ink); background-color: var(--cream); background-image: radial-gradient(rgba(27,25,22,.16) 1px, transparent 1.2px); background-size: 7px 7px; }
.page-h h1 { font-size: clamp(32px, 4.6vw, 50px); font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.page-h p { font-size: 15px; color: #4a443b; margin-top: 10px; max-width: 40em; line-height: 1.55; }
.page-h p a { color: var(--ultra); }
.page h2.sub { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 30px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.input { width: 100%; border: 1px solid var(--ink); background: #fff; padding: 9px 11px; font-family: var(--mono); font-size: 13px; outline: none; color: var(--ink); }
.input:focus { box-shadow: 3px 3px 0 var(--marigold); }
textarea.input { min-height: 260px; resize: vertical; line-height: 1.5; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ink); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 8px 14px; font-size: 14px; background: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; white-space: nowrap; color: var(--ink); }
.tabs button.on { border-color: var(--ink); background: var(--paper); font-weight: 600; }
.tabs .n { font-family: var(--mono); font-size: 11px; background: var(--win); padding: 0 5px; margin-left: 5px; }

.list { border-top: 1px solid var(--ink); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.item:hover { background: #fff6e2; }
.item-t { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.item-t .tag { margin-left: 4px; vertical-align: 2px; }
.item-d { font-size: 14px; color: #4a443b; margin-top: 3px; }
.item-m { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.item-r { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: grid; gap: 6px; justify-items: end; }
.empty { padding: 36px 8px; text-align: center; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.empty a { color: var(--ultra); }

.page .field-in { margin-bottom: 8px; }
.soon { display: flex; gap: 12px; align-items: baseline; border: 1px solid var(--ink); background: var(--marigold); padding: 12px 16px; margin: -8px 0 24px; font-size: 15px; line-height: 1.5; }
.soon b { font-family: var(--pixel); font-weight: 400; font-size: 17px; white-space: nowrap; }

/* sites */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.site-card { display: block; text-decoration: none; background: var(--win); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.site-card:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--marigold); }
.site-thumb { height: 120px; margin: 3px; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--pixel); font-size: 22px; }
.site-card-b { background: var(--paper); margin: 3px; padding: 10px 12px; }
.site-card-b .host { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.site-card-b p { font-size: 13.5px; color: #4a443b; margin-top: 4px; }

/* review card */
.rv { border: 1px solid var(--ink); background: var(--win); box-shadow: 4px 4px 0 var(--ink); margin-bottom: 22px; }
.rv-notes { margin: 0 3px 3px; background: var(--paper); padding: 9px 14px; font-size: 13.5px; line-height: 1.6; }
.rv-notes div::before { content: "• "; color: var(--muted); }
.rv-notes .bad { color: var(--reject); }
.diff-file { border: 1px solid var(--ink); background: var(--paper); margin-bottom: 16px; }
.diff-h { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; background: var(--win); border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 12.5px; }
.diff { font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow-x: auto; }
.diff div { white-space: pre; padding: 0 12px; min-width: max-content; }
.diff .a { background: #e5f5ea; }
.diff .d { background: #fbe6e6; }
.diff .h { background: #f5efe2; color: #8a6a2c; }
.diff .flag { box-shadow: inset 3px 0 0 var(--reject); }
.plus { color: var(--approve); } .minus { color: var(--reject); }

/* muse / connect page */
pre.block { background: var(--night); color: #f1ece2; padding: 12px 14px; font-size: 12.5px; line-height: 1.55; overflow-x: auto; margin: 0; }
.tool-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tool-row:last-child { border-bottom: 0; }
.tool-row code { font-size: 12.5px; }
.prompt { font-size: 15px; line-height: 1.6; padding-bottom: 10px; }

/* docs */
.docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.docs > * { min-width: 0; }
.docs nav { position: sticky; top: 90px; align-self: start; display: grid; gap: 7px; font-size: 14px; }
.docs nav a { text-decoration: none; color: #5c554b; }
.docs nav a:hover { color: var(--ink); text-decoration: underline; }
.docs section { margin-bottom: 44px; scroll-margin-top: 100px; }
.docs h2 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 12px; }
.docs h3 { font-size: 17px; margin: 20px 0 8px; }
.docs p, .docs li { font-size: 15.5px; line-height: 1.65; margin-bottom: 10px; max-width: 42em; }
.docs ul { padding-left: 20px; }
.docs pre { background: var(--night); color: #f1ece2; padding: 14px 16px; font-size: 12.5px; line-height: 1.6; overflow-x: auto; margin: 10px 0 16px; }
.docs p code, .docs li code, .docs td code { background: #f3ecdc; padding: 1px 5px; font-size: .88em; }
.docs table { border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; width: 100%; }
.docs td, .docs th { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.docs th { background: var(--win); }
.docs a { color: var(--ultra); }

/* ---------- footer ---------- */
.foot { background: var(--night); color: #b5ad9f; font-size: 13px; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 28px 20px; display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.foot a { color: #f5f0e6; text-decoration: none; }
.foot a:hover { color: var(--marigold); }
.foot .links { display: flex; gap: 18px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12.5px; padding: 8px 14px; z-index: 99; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .nav-in { gap: 18px; }
  .nav-links { gap: 14px; font-size: 13px; }
  .nav-right .btn-ghost { display: none; }
}
@media (max-width: 900px) {
  .field-in > * { grid-column: span 12; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs nav { position: static; display: flex; flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 860px) {
  .burger { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--night); flex-direction: column; padding: 12px 20px 16px; gap: 14px; border-bottom: 1px solid #332f28; font-size: 15px; }
  .nav-links.open { display: flex; }
}
@media (max-width: 760px) {
  .ca-in { padding: 6px 16px; gap: 8px; }
  .ca-soft { display: none; }
  .ca-addr .ca-full { display: none; }
  .ca-addr .ca-short { display: inline; }
  .hero { min-height: 520px; }
  .hero-in { padding: 210px 16px 52px; }
  .hint { display: none; }
  .field { padding: 36px 16px 52px; }
  .verdict { grid-template-columns: 1fr; }
  .page { padding: 24px 16px 64px; }
  .item { grid-template-columns: 1fr; }
  .item-r { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; }
  .tool-row { grid-template-columns: 1fr; gap: 2px; }
  .page .ev { grid-template-columns: 52px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
