/* Tesser 3D — conceito: a mesa de impressão. Fundo cinza de chapa de aço, acento bronze da placa PEI texturizada,
   progresso desenhado como camadas empilhadas na cor do filamento que está no bico. */
:root {
  --plate: #E4E6E8;
  --sheet: #F4F5F6;
  --ink: #16191D;
  --ink-2: #59616A;
  --line: #C8CDD2;
  --pei: #94641F;
  --pei-soft: #E9DCC6;
  --ok: #2B7A4B;
  --bad: #B0352C;
  --warn: #9A6200;
  --shadow: 0 1px 0 rgba(22, 25, 29, .04), 0 8px 24px -16px rgba(22, 25, 29, .35);
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px;
  --gap: clamp(16px, 2.4vw, 28px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --plate: #121518;
    --sheet: #1A1E22;
    --ink: #E7E9EB;
    --ink-2: #99A1A9;
    --line: #2B3137;
    --pei: #D6A35F;
    --pei-soft: #3A2E1E;
    --ok: #62BD88;
    --bad: #E56A5F;
    --warn: #E2A640;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 28px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plate);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--pei) 70%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--pei); }
:focus-visible { outline: 2px solid var(--pei); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--plate); padding: 8px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 16px; }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--plate) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-size: 20px; letter-spacing: -.01em; font-variation-settings: "wdth" 112; font-weight: 500; }
.mark b { font-weight: 800; color: var(--pei); margin-left: 1px; }
.mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.mark .mark-noz { stroke: var(--pei); }
.pulse { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1.3 var(--f-mono); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); flex: none; }
.pulse.is-live .dot { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .pulse.is-live .dot { animation: ping 2.4s ease-out infinite; }
  @keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
}

/* ---------- seções ---------- */
main { display: flex; flex-direction: column; gap: clamp(36px, 6vw, 72px); padding-block: clamp(24px, 4vw, 44px) 24px; }
.sec-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.sec-head.row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
h1, h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 5.4vw, 58px); line-height: 1; font-variation-settings: "wdth" 72; text-transform: uppercase; }
h2 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.05; font-variation-settings: "wdth" 72; text-transform: uppercase; }
h3 { margin: 0; }
.sec-sub { margin: 0; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-2); }

/* ---------- impressoras ---------- */
.printers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--gap); }
.pcard { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.cam { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink) 6%, transparent) 0 1px, transparent 1px 7px), color-mix(in srgb, var(--ink) 8%, var(--sheet)); }
.cam img { width: 100%; height: 100%; object-fit: cover; display: none; }
.cam.has-video img { display: block; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--ink-2); font: 500 13px/1.4 var(--f-mono); }
.cam.has-video .cam-msg { display: none; }
.state { position: absolute; left: 12px; top: 12px; font: 500 12px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; padding: 7px 10px 6px; border-radius: 999px; background: color-mix(in srgb, var(--sheet) 92%, transparent); color: var(--ink); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 7px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.state[data-s="printing"]::before { background: var(--ok); }
.state[data-s="paused"]::before { background: var(--warn); }
.state[data-s="error"]::before { background: var(--bad); }
.pbody { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.pname { margin: 0 0 2px; font: 500 12px/1.3 var(--f-mono); color: var(--ink-2); letter-spacing: .05em; text-transform: uppercase; }
.job { font-family: var(--f-display); font-size: clamp(20px, 2.3vw, 26px); line-height: 1.15; font-weight: 650; font-variation-settings: "wdth" 90; overflow-wrap: anywhere; }
.job.is-idle { color: var(--ink-2); font-weight: 500; }

.meter { display: grid; grid-template-columns: 92px 1fr; gap: 20px; align-items: stretch; }
.gauge { display: flex; flex-direction: column; gap: 8px; }
.stack { flex: 1; display: flex; flex-direction: column-reverse; gap: 3px; padding: 7px 8px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1px solid var(--line); border-bottom: 4px solid var(--pei); min-height: 150px; }
.stack i { flex: 1; min-height: 4px; border-radius: 2px; border: 1px dashed color-mix(in srgb, var(--ink-2) 40%, transparent); }
.stack i.on { background: var(--fil, var(--pei)); border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28); }
.stack i.now { background: color-mix(in srgb, var(--fil, var(--pei)) 50%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); }
.pct { font: 700 26px/1 var(--f-display); font-variation-settings: "wdth" 70; text-align: center; font-variant-numeric: tabular-nums; }
.pct small { font: 500 13px var(--f-mono); color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .stack i.now { animation: blink 1.6s ease-in-out infinite; } @keyframes blink { 50% { opacity: .35; } } }
.read { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px 16px; align-content: center; }
.read div { min-width: 0; }
.read dt { font: 500 11px/1.2 var(--f-mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.read dd { margin: 3px 0 0; font: 500 20px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.read dd small { font-size: 12px; color: var(--ink-2); letter-spacing: 0; }

.spools { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 14px; }
.spools li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.spool { width: 22px; height: 22px; border-radius: 50%; background: var(--c, transparent); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--sheet) 0%, transparent), inset 0 0 0 7px color-mix(in srgb, #000 12%, transparent); flex: none; }
.spools li.is-active { color: var(--ink); font-weight: 600; }
.spools li.is-active .spool { outline: 2px solid var(--pei); outline-offset: 2px; }
.spools li.empty .spool { background: transparent; border-style: dashed; }

.pcard--ghost .cam { opacity: .7; }
.pcard--ghost .pbody { gap: 10px; }
.bar { display: block; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 8%, transparent); width: 70%; }
.bar.short { width: 40%; }
.no-printers { grid-column: 1 / -1; background: var(--sheet); border: 1px dashed var(--line); border-radius: var(--r); padding: 28px; color: var(--ink-2); }
.no-printers strong { color: var(--ink); display: block; font-size: 18px; margin-bottom: 4px; }

/* ---------- números ---------- */
.tot { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); border-top: 2px solid var(--ink); }
.tot div { padding: 14px 0 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; padding-right: 16px; }
.tot dt { font: 500 12px/1.3 var(--f-mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.tot dd { margin: 6px 0 0; font-family: var(--f-display); font-size: clamp(30px, 4vw, 44px); line-height: 1; font-weight: 700; font-variation-settings: "wdth" 70; font-variant-numeric: tabular-nums; }
.tot dd small { font: 500 14px var(--f-mono); color: var(--ink-2); margin-left: 4px; }

/* ---------- histórico ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 500 13px/1 var(--f-body); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-on { background: var(--ink); color: var(--plate); border-color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 76px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--fil, color-mix(in srgb, var(--ink) 8%, transparent)); border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--sheet); }
.thumb.no-img::after { content: ""; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 6px solid color-mix(in srgb, #000 16%, transparent); background: color-mix(in srgb, #fff 12%, transparent); }
.iline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.iname { font-size: 17px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.tag { font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; padding: 5px 8px 4px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.tag[data-s="ok"] { color: var(--ok); }
.tag[data-s="fail"] { color: var(--bad); }
.tag[data-s="cancel"] { color: var(--warn); }
.tag[data-s="run"] { color: var(--pei); }
.imeta { margin: 4px 0 0; font: 400 13px/1.45 var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ipeople { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.ipeople b { color: var(--ink); font-weight: 600; }
.swatches { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 120px; }
.swatches li { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.empty { color: var(--ink-2); padding: 24px 0; margin: 0; }
@media (max-width: 560px) {
  .item { grid-template-columns: 60px minmax(0, 1fr); }
  .thumb { width: 60px; }
  .swatches { grid-column: 2; justify-content: flex-start; max-width: none; }
  .meter { grid-template-columns: 72px 1fr; gap: 14px; }
}

/* ---------- menções ---------- */
.credits h2 { margin-bottom: 18px; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--gap); }
.cred-grid h3 { font: 500 12px/1.3 var(--f-mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.cred-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cred-list li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cred-list .n { font: 500 12px var(--f-mono); color: var(--ink-2); margin-left: 6px; }

.foot { padding-block: 28px 36px; color: var(--ink-2); font: 400 13px/1.4 var(--f-mono); }
.foot p { margin: 0; border-top: 1px solid var(--line); padding-top: 16px; }
