/* Metzion backend preview. Same tokens as the Koda Plus offers: #212721,
   malachite #26d07c, Cabinet Grotesk + Satoshi. Layers of the stack: Medusa
   neutral, Mercur malachite, apps on top outlined. */

@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/CabinetGrotesk-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --black: #212721;
  --black-2: #1b201b;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.08);
  --white: #fff;
  --text: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.46);
  --malachite: #26d07c;
  --malachite-10: rgba(38, 208, 124, 0.1);
  --malachite-soft: rgba(38, 208, 124, 0.16);
  --amber: #f5c451;
  --amber-10: rgba(245, 196, 81, 0.1);
  --amber-soft: rgba(245, 196, 81, 0.24);
  --red: #ff8a8a;
  --heading: "Cabinet Grotesk", system-ui, sans-serif;
  --body: "Satoshi", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--white);
  background:
    radial-gradient(70rem 42rem at 85% -10%, rgba(38, 208, 124, 0.13), transparent 60%),
    radial-gradient(50rem 34rem at -5% 110%, rgba(38, 208, 124, 0.07), transparent 58%),
    var(--black);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--malachite-soft); }
:focus-visible { outline: 0.125rem solid var(--malachite); outline-offset: 0.18rem; border-radius: 0.4rem; }
.wrap { max-width: 76rem; margin: 0 auto; padding-left: clamp(1rem, 4vw, 2.5rem); padding-right: clamp(1rem, 4vw, 2.5rem); }
.muted { color: var(--muted); }

/* ─── Header ─── */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--black) 84%, transparent); backdrop-filter: blur(0.75rem); -webkit-backdrop-filter: blur(0.75rem); border-bottom: 0.0625rem solid var(--line-2); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand img { height: 1.375rem; display: block; }
.brand-x { padding-left: 0.75rem; border-left: 0.0625rem solid var(--line); font-family: var(--heading); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.top-nav { display: flex; align-items: center; gap: 1.4rem; font-size: 0.92rem; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--white); }
.top-nav .top-cta { color: var(--malachite); font-weight: 700; }

/* ─── Hero ─── */
.hero { padding-top: clamp(3rem, 9vh, 5.5rem); padding-bottom: 3rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.94rem; font-weight: 500; color: var(--malachite); background: var(--malachite-10); padding: 0.48rem 0.95rem; border-radius: 99rem; }
.dot { width: 0.45rem; height: 0.45rem; border-radius: 99rem; background: var(--faint); }
.dot.ok { background: var(--malachite); box-shadow: 0 0 0.7rem var(--malachite); animation: pulse 2.4s ease-in-out infinite; }
.dot.bad { background: var(--amber); }
@keyframes pulse { 50% { box-shadow: 0 0 0.2rem var(--malachite); } }
@media (prefers-reduced-motion: reduce) { .dot.ok { animation: none; } }
h1 { margin-top: 1.4rem; font-family: var(--heading); font-weight: 800; font-size: clamp(2.3rem, 5.4vw, 4.2rem); line-height: 1.03; letter-spacing: -0.02em; max-width: 52rem; text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: var(--malachite); }
.lead { margin-top: 1.4rem; max-width: 46rem; font-size: clamp(1rem, 1.3vw, 1.16rem); line-height: 1.6; color: var(--muted); }
.stats { margin-top: 2.2rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; max-width: 52rem; }
.stats div { padding: 0.95rem 1.05rem; border-radius: 0.9rem; background: var(--panel); border: 0.0625rem solid var(--line-2); }
.stats dt { font-size: 0.8rem; color: var(--faint); font-weight: 600; }
.stats dd { margin-top: 0.3rem; font-family: var(--heading); font-weight: 800; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }

.stack { margin-top: 2.4rem; display: grid; gap: 0.45rem; }
.stack-row { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.7rem 0.8rem; border-radius: 0.8rem; border: 0.0625rem solid var(--line-2); font-size: 0.82rem; }
.stack-row .lbl { width: 6.5rem; flex-shrink: 0; align-self: center; font-size: 0.74rem; font-weight: 700; color: var(--faint); }
.stack-row.s-mercur .lbl { color: var(--malachite); }
.stack-row span { padding: 0.32rem 0.6rem; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.stack-row.s-top { border-style: dashed; border-color: rgba(255, 255, 255, 0.26); }
.stack-row.s-top span { background: transparent; border: 0.0625rem solid rgba(255, 255, 255, 0.18); }
.stack-row.s-api { background: rgba(255, 255, 255, 0.03); }
.stack-row.s-api span { font-family: var(--mono); font-size: 0.76rem; }
.stack-row.s-mercur { background: var(--malachite-10); border-color: var(--malachite-soft); }
.stack-row.s-mercur span { background: rgba(38, 208, 124, 0.14); }
.stack-row.s-medusa { background: rgba(255, 255, 255, 0.04); }

/* ─── Blocks ─── */
.block { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: 0.5rem; scroll-margin-top: 4.5rem; }
.block-h { max-width: 48rem; }
.kicker { display: block; font-size: 0.82rem; font-weight: 700; color: var(--malachite); letter-spacing: 0.01em; }
h2 { margin-top: 0.6rem; font-family: var(--heading); font-weight: 800; font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.block-h p { margin-top: 0.9rem; font-size: 1.02rem; line-height: 1.6; color: var(--muted); }
h3 { font-family: var(--heading); font-weight: 800; font-size: 1.3rem; line-height: 1.15; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 700; font-size: 0.94rem; padding: 0.82rem 1.3rem; border-radius: 0.625rem; border: 0.0625rem solid transparent; cursor: pointer; text-decoration: none; transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease; }
.btn:active { transform: translateY(0.0625rem); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-light { background: var(--white); color: #10140f; }
.btn-light:hover { background: color-mix(in srgb, var(--white) 88%, var(--malachite)); }
.btn-outline { background: transparent; color: var(--white); border-color: color-mix(in srgb, var(--malachite) 55%, transparent); }
.btn-outline:hover { background: var(--malachite-soft); border-color: var(--malachite); }
.btn-wide { width: 100%; }
.btn-row { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.arr { font-weight: 400; }

/* ─── Doors ─── */
.doors { margin-top: 1.8rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.door { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.4rem 1.35rem 1.35rem; border-radius: 1.1rem; background: var(--panel); border: 0.0625rem solid var(--line); }
.door-k { font-size: 0.8rem; font-weight: 700; color: var(--malachite); }
.door ul { list-style: none; display: grid; gap: 0.45rem; font-size: 0.9rem; line-height: 1.45; color: var(--muted); }
.door li { padding-left: 1rem; position: relative; }
.door li::before { content: ""; position: absolute; left: 0; top: 0.55rem; width: 0.35rem; height: 0.35rem; border-radius: 99rem; background: var(--malachite); }
.door p { font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.cred { margin-top: auto; display: grid; gap: 0.35rem; padding: 0.8rem 0.9rem; border-radius: 0.7rem; background: rgba(0, 0, 0, 0.22); border: 0.0625rem solid var(--line-2); }
.cred div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--faint); }
.cred code { font-family: var(--mono); font-size: 0.82rem; color: var(--white); cursor: copy; overflow-wrap: anywhere; }
.cred code:hover { color: var(--malachite); }
.req, .res { font-family: var(--mono); font-size: 0.78rem; line-height: 1.55; padding: 0.75rem 0.85rem; border-radius: 0.7rem; background: rgba(0, 0, 0, 0.28); border: 0.0625rem solid var(--line-2); overflow-x: auto; white-space: pre; }
.req b { color: var(--malachite); font-weight: 700; }
.res { max-height: 18rem; overflow: auto; color: var(--text); }

/* ─── Shop: catalog + basket ─── */
.shop { margin-top: 1.8rem; display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.2rem; align-items: start; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.7rem; }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 0.9rem; overflow: hidden; background: var(--panel); border: 0.0625rem solid var(--line-2); color: var(--white); cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.card:hover { border-color: rgba(255, 255, 255, 0.26); transform: translateY(-0.0625rem); }
.card.on { border-color: var(--malachite); box-shadow: 0 0 0 0.0625rem var(--malachite) inset; }
.card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: linear-gradient(135deg, rgba(38, 208, 124, 0.18), rgba(255, 255, 255, 0.04)); }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-badge { position: absolute; left: 0.5rem; top: 0.5rem; font-size: 0.68rem; font-weight: 700; padding: 0.25rem 0.45rem; border-radius: 0.35rem; background: rgba(33, 39, 33, 0.85); color: var(--amber); }
.card.on .card-img::after { content: "✓"; position: absolute; right: 0.5rem; top: 0.5rem; width: 1.5rem; height: 1.5rem; border-radius: 99rem; background: var(--malachite); color: #0f1a12; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; }
.card-body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.75rem 0.75rem; flex: 1; }
.card-t { font-weight: 700; font-size: 0.86rem; line-height: 1.25; }
.card-he { font-size: 0.82rem; color: var(--muted); }
.card-meta { font-size: 0.76rem; color: var(--faint); }
.card-foot { margin-top: auto; padding-top: 0.45rem; display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.card-seller { font-size: 0.72rem; color: var(--malachite); line-height: 1.2; }
.card-foot b { font-size: 0.9rem; white-space: nowrap; }

.basket { position: sticky; top: 5.2rem; padding: 1.2rem 1.15rem; border-radius: 1.1rem; background: var(--panel); border: 0.0625rem solid var(--line); }
.basket-h { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.basket-h span { font-size: 0.8rem; color: var(--faint); }
#basket-lines { list-style: none; margin-top: 0.9rem; display: grid; gap: 0.75rem; }
.bk-s { display: block; font-size: 0.76rem; font-weight: 700; color: var(--malachite); margin-bottom: 0.3rem; }
.bk-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center; font-size: 0.84rem; padding: 0.3rem 0; }
.bk-line small { display: block; font-size: 0.74rem; color: var(--faint); }
.bk-qty { display: inline-flex; align-items: center; gap: 0.3rem; }
.bk-qty button { width: 1.5rem; height: 1.5rem; border-radius: 0.35rem; border: 0.0625rem solid var(--line); background: none; color: var(--white); cursor: pointer; }
.bk-qty b { min-width: 0.9rem; text-align: center; font-size: 0.82rem; }
.basket-tot { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 0.0625rem solid var(--line-2); display: flex; justify-content: space-between; align-items: baseline; }
.basket-tot span { font-size: 0.82rem; color: var(--muted); }
.basket-tot b { font-family: var(--heading); font-weight: 800; font-size: 1.5rem; }
.basket-note { margin: 0.6rem 0 1rem; font-size: 0.8rem; line-height: 1.45; color: var(--faint); }

/* ─── Flow ─── */
.flow { list-style: none; margin-top: 1.4rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.55rem; }
.flow li { position: relative; padding: 0.85rem 0.9rem; border-radius: 0.8rem; border: 0.0625rem solid var(--line-2); background: var(--panel); display: grid; gap: 0.2rem; transition: border-color 0.3s ease, background 0.3s ease; }
.flow li b { font-size: 0.95rem; }
.flow li span:last-child { font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.fl-n { width: 1.5rem; height: 1.5rem; border-radius: 99rem; border: 0.0625rem solid var(--line); display: inline-grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: var(--faint); margin-bottom: 0.25rem; }
.flow li.now { border-color: var(--amber); background: var(--amber-10); }
.flow li.now .fl-n { border-color: var(--amber); color: var(--amber); animation: spin 1s linear infinite; border-top-color: transparent; }
.flow li.done { border-color: var(--malachite-soft); background: var(--malachite-10); }
.flow li.done .fl-n { background: var(--malachite); border-color: var(--malachite); color: #0f1a12; }
.flow li.fail { border-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Console ─── */
.console { margin-top: 1rem; border-radius: 0.9rem; border: 0.0625rem solid var(--line-2); background: rgba(0, 0, 0, 0.28); overflow: hidden; }
.console-h { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.9rem; border-bottom: 0.0625rem solid var(--line-2); font-size: 0.82rem; }
.console-h span { color: var(--faint); font-variant-numeric: tabular-nums; }
#console-lines { list-style: none; max-height: 16rem; overflow: auto; padding: 0.4rem 0; font-family: var(--mono); font-size: 0.76rem; }
#console-lines li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 2.6rem 4rem; gap: 0.6rem; align-items: baseline; padding: 0.28rem 0.9rem; }
#console-lines li .body { grid-column: 2 / -1; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#console-lines li.err { display: block; color: var(--red); }
#console-lines code { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m { font-weight: 700; }
.m-get { color: #8ab4ff; }
.m-post { color: var(--malachite); }
.st.ok { color: var(--malachite); }
.st.bad { color: var(--red); }
.ms { color: var(--faint); text-align: right; }

/* ─── Result ─── */
.result { margin-top: 1.4rem; padding: 1.4rem; border-radius: 1.1rem; border: 0.0625rem solid var(--malachite-soft); background: linear-gradient(180deg, rgba(38, 208, 124, 0.08), rgba(38, 208, 124, 0.02)); scroll-margin-top: 5rem; }
.res-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-end; }
.res-h h3 { margin-top: 0.35rem; font-size: 1.45rem; }
.res-sum { display: flex; gap: 1.4rem; }
.res-sum span { display: block; font-size: 0.78rem; color: var(--faint); }
.res-sum b { font-family: var(--heading); font-weight: 800; font-size: 1.45rem; }
.res-sum div:first-child b { color: var(--amber); }
.orders { margin-top: 1.1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; }
.order { padding: 1rem; border-radius: 0.9rem; background: var(--black-2); border: 0.0625rem solid var(--line-2); display: flex; flex-direction: column; gap: 0.7rem; }
.order header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.order header span { font-size: 0.78rem; color: var(--faint); }
.order ul { list-style: none; display: grid; gap: 0.55rem; }
.order li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.6rem; align-items: start; font-size: 0.84rem; }
.order li img, .order li .ph { width: 2.6rem; height: 2.6rem; border-radius: 0.45rem; object-fit: cover; background: var(--panel-2); }
.oi-t small { display: block; color: var(--faint); font-size: 0.76rem; }
.oi-t em { display: inline-block; margin-top: 0.25rem; font-style: normal; font-size: 0.72rem; color: var(--amber); }
.order dl { margin-top: auto; display: grid; gap: 0.3rem; padding-top: 0.7rem; border-top: 0.0625rem solid var(--line-2); }
.order dl div { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.82rem; }
.order dt { color: var(--muted); }
.order dd { text-align: right; }
.order dd.c { color: var(--amber); }
.order .keep { padding-top: 0.35rem; font-weight: 700; }
.order .keep dd { color: var(--malachite); }
.vat-note { font-size: 0.78rem; line-height: 1.45; color: var(--amber); padding: 0.55rem 0.65rem; border-radius: 0.55rem; background: var(--amber-10); border: 0.0625rem solid var(--amber-soft); }
.res-note { margin-top: 1rem; font-size: 0.9rem; line-height: 1.55; color: var(--muted); max-width: 52rem; }

/* ─── What we build ─── */
.two { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.col { padding: 1.4rem 1.35rem; border-radius: 1.1rem; border: 0.0625rem solid var(--line); }
.col ul { margin-top: 0.9rem; list-style: none; display: grid; gap: 0.6rem; font-size: 0.93rem; line-height: 1.5; color: var(--muted); }
.col li { padding-left: 1rem; position: relative; }
.col li::before { content: ""; position: absolute; left: 0; top: 0.6rem; width: 0.38rem; height: 0.38rem; border-radius: 99rem; background: var(--malachite); }
.col li b { color: var(--white); font-weight: 700; }
.col-box { background: var(--malachite-10); border-color: var(--malachite-soft); }
.col-custom { background: var(--amber-10); border-color: var(--amber-soft); }
.col-custom li::before { background: var(--amber); }

/* ─── Team ─── */
.people { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.person { display: flex; gap: 0.9rem; align-items: center; padding: 1rem; border-radius: 1rem; background: var(--panel); border: 0.0625rem solid var(--line-2); }
.person img { width: 3.5rem; height: 3.5rem; border-radius: 99rem; object-fit: cover; flex-shrink: 0; }
.person b { display: block; }
.person span { display: block; font-size: 0.84rem; color: var(--muted); }
.person a { font-size: 0.86rem; color: var(--white); text-decoration: none; border-bottom: 0.0625rem solid var(--malachite-soft); }

.foot { margin-top: 4rem; padding-top: 1.4rem; padding-bottom: 2.5rem; border-top: 0.0625rem solid var(--line-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; font-size: 0.82rem; color: var(--faint); }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 50; padding: 0.7rem 1.1rem; border-radius: 0.7rem; background: var(--white); color: #10140f; font-weight: 600; font-size: 0.9rem; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.4); max-width: calc(100vw - 2rem); }

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .shop { grid-template-columns: minmax(0, 1fr); }
  .basket { position: static; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .people { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .top-nav a:not(.top-cta) { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  #console-lines li { grid-template-columns: 3rem minmax(0, 1fr) 2.4rem; }
  #console-lines li .ms { display: none; }
  .res-sum { width: 100%; justify-content: space-between; }
}
.catalog > .muted { grid-column: 1 / -1; }
