:root {
  color-scheme: dark;
  --bg: #060A12;
  --surface: #0C1322;
  --surface-2: #0A101D;
  --raised: #121C32;
  --line: #1D2A46;
  --line-strong: #2C3E66;
  --text: #E6ECFF;
  --muted: #98A5C4;
  --acc: #4DE3FF;
  --acc-ink: #031219;
  --warn: #FFB547;
  --pass: #3EEBA6;
  --fail: #FF6B5E;
  --gutter: clamp(16px, 4vw, 48px);
  --display: "Chakra Petch", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Geist", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .28;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.01em; line-height: 1.08; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 600; max-width: 20ch; }
h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--acc); color: var(--acc-ink); padding: 10px 14px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header and navigation */
header { padding: 16px 0; position: sticky; top: 0; z-index: 10; background: rgba(6,10,18,.92); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: 0; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.logo img { display: block; height: 28px; width: auto; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.97rem; color: var(--muted); transition: color .15s; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--acc); text-underline-offset: 8px; text-decoration-thickness: 2px; }
.has-sub { position: relative; }
.sub {
  list-style: none; margin: 0; padding: 8px 0; position: absolute; top: 100%; left: -16px; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; display: none;
}
.sub a { display: block; padding: 8px 16px; }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
.menu-btn { display: none; font: inherit; font-weight: 600; background: none; border: 1px solid var(--line-strong); border-radius: 4px; padding: 8px 14px; color: var(--text); cursor: pointer; }

.btn {
  display: inline-block; padding: 13px 22px; border-radius: 4px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 1px solid var(--acc); background: var(--acc); color: var(--acc-ink);
  cursor: pointer; font-family: inherit; transition: background .15s, box-shadow .15s;
}
.nav a.btn { color: var(--acc-ink); }
.btn:hover { background: #8CEEFF; box-shadow: 0 0 24px -4px rgba(77,227,255,.6); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--raised); border-color: var(--acc); box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
section { padding: clamp(56px, 8vw, 104px) 0; }
.sheet-bg { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.page-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.page-hero h1 { max-width: 20ch; }
.page-hero p.lead { margin-top: 24px; font-size: 1.2rem; color: var(--muted); }
.crumb { font-size: .92rem; margin-bottom: 20px; color: var(--muted); font-family: var(--mono); }
.crumb a { text-underline-offset: 4px; }

/* Corner-bracket frame for instrument-style panels */
.frame { position: relative; }
.frame::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--acc), var(--acc)) top left / 16px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) top left / 2px 16px no-repeat,
    linear-gradient(var(--acc), var(--acc)) top right / 16px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) top right / 2px 16px no-repeat,
    linear-gradient(var(--acc), var(--acc)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) bottom left / 2px 16px no-repeat,
    linear-gradient(var(--acc), var(--acc)) bottom right / 16px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) bottom right / 2px 16px no-repeat;
}

/* Home hero */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 112px); }
.net { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .75; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.8vw, 4.8rem); }
.hero p.lead { margin-top: 28px; font-size: 1.2rem; color: var(--muted); }

.lint { background: rgba(12,19,34,.94); border: 1px solid var(--line-strong); border-radius: 4px; }
.lint-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); font-family: var(--mono); }
.lint-bar.foot { border-top: 1px solid var(--line); border-bottom: 0; }
.lint-bar .status { font-size: .82rem; font-weight: 500; }
.status.warn { color: var(--warn); }
.status.pass { color: var(--pass); }
.lint ol { list-style: none; margin: 0; padding: 0; }
.issue { padding: 18px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 24px 1fr; gap: 0 12px; }
.issue:last-child { border-bottom: 0; }
.issue .mark { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); margin-top: 9px; justify-self: center; transition: background .3s, box-shadow .3s; box-shadow: 0 0 10px var(--warn); }
.issue .text { font-size: 1.08rem; font-weight: 500; line-height: 1.4; }
.issue .text span { text-decoration: underline wavy var(--warn); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.issue .note { grid-column: 2; margin-top: 8px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.issue.fixed .mark { background: var(--pass); box-shadow: 0 0 10px var(--pass); }
.issue.fixed .text span { text-decoration: underline solid var(--pass); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.issue.fixed .note { color: var(--pass); }
.replay { white-space: nowrap; margin: 0; border: 0; background: none; font: inherit; font-family: var(--mono); font-size: .82rem; font-weight: 500; color: var(--acc); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 4px; }

/* Rows (services, deliverables) */
.rows { border-top: 1px solid var(--acc); }
.row { display: grid; grid-template-columns: 0.9fr 1.4fr 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row p { color: var(--muted); }
.row h3 a { text-decoration: none; }
.row h3 a:hover { color: var(--acc); }
.row .more { display: inline-block; margin-top: 12px; font-weight: 500; font-size: .95rem; color: var(--acc); text-underline-offset: 4px; }
.checks { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .85rem; line-height: 1.9; color: var(--muted); }
.checks li::before { content: "+ "; color: var(--acc); }

/* Before and after pairs */
.pairs { border-top: 1px solid var(--acc); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.pair .side { font-weight: 500; }
.pair .side small { display: block; margin-top: 6px; font-family: var(--mono); font-size: .8rem; font-weight: 400; color: var(--muted); }
.pair .before span { text-decoration: underline wavy var(--warn); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.pair .after span { text-decoration: underline solid var(--pass); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.pair .after small { color: var(--pass); }

/* Role demo */
.panel-demo { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.panel-demo .copy p { margin-top: 24px; color: var(--muted); }
.roles { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.roles button { font: inherit; font-weight: 500; font-size: .95rem; padding: 9px 16px; border-radius: 4px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.roles button:hover { border-color: var(--acc); }
.roles button[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.admin { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.admin-head { display: flex; justify-content: space-between; padding: 14px 18px; background: var(--raised); font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--line); }
.admin-head small { font-family: var(--mono); font-weight: 400; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); }
th { font-weight: 500; color: var(--muted); font-size: .85rem; }
td:first-child { font-family: var(--mono); }
td.act button { font: inherit; font-size: .85rem; font-weight: 500; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); border-radius: 3px; padding: 4px 10px; cursor: pointer; margin-right: 6px; }
td.act button.danger { border-color: var(--fail); color: var(--fail); background: transparent; }
td.act button:hover { border-color: var(--acc); }
td.act button.danger:hover { background: var(--fail); color: var(--bg); }
td.act em { color: var(--muted); font-style: normal; font-size: .85rem; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: .82rem; font-weight: 500; border: 1px solid; }
.tag.paid { color: var(--pass); border-color: rgba(62,235,166,.4); background: rgba(62,235,166,.08); }
.tag.wait { color: var(--warn); border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.08); }
.tag.ship { color: var(--acc); border-color: rgba(77,227,255,.4); background: rgba(77,227,255,.08); }
.admin-foot { padding: 12px 18px; font-size: .88rem; color: var(--muted); }
.scroll-x { overflow-x: auto; }

/* Process steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--acc); counter-reset: s; }
.steps li { padding: 24px 24px 0 0; counter-increment: s; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--mono); font-weight: 500; font-size: 1rem; color: var(--acc); margin-bottom: 12px; }
.steps p { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.steps.three { grid-template-columns: repeat(3, 1fr); }

/* About prose */
.prose { display: grid; gap: 28px; }
.prose h2 { max-width: none; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.prose p { max-width: 64ch; margin-top: 10px; color: var(--muted); }
.placeholder { border: 1px dashed var(--line-strong); border-radius: 4px; padding: 20px; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); }
form { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
input, textarea, select { font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--text); width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--acc); }
textarea { min-height: 130px; resize: vertical; }
[aria-invalid="true"] { border-color: var(--fail); }
.err { color: var(--fail); font-weight: 500; font-size: .9rem; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { display: none; padding: 16px; border-radius: 4px; font-weight: 500; border: 1px solid; }
.form-msg.show { display: block; }
.form-msg.ok { color: var(--pass); border-color: rgba(62,235,166,.4); background: rgba(62,235,166,.08); }
.form-msg.bad { color: var(--fail); border-color: rgba(255,107,94,.4); background: rgba(255,107,94,.08); }
.form-msg a { color: inherit; }

footer { padding: 40px 0 48px; font-size: .95rem; color: var(--muted); border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer strong { color: var(--text); display: block; margin-bottom: 8px; font-family: var(--display); font-weight: 600; }
footer .cols { display: flex; gap: 48px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero .wrap, .intro, .panel-demo, .contact { grid-template-columns: 1fr; }
  .row, .pair { grid-template-columns: 1fr; gap: 10px; }
  .steps, .steps.three { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 24px; }
  .js .menu-btn { display: inline-block; }
  .js .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line-strong); padding: 16px var(--gutter) 24px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .js .nav.open { display: flex; }
  .sub { display: block; position: static; border: 0; background: none; padding: 4px 0 0 12px; min-width: 0; }
  .sub a { padding: 6px 0; }
}
@media (max-width: 520px) {
  .steps, .steps.three { grid-template-columns: 1fr; }
  .steps li, .steps li + li { border-left: 0; padding-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
