/* ------------------------------------------------------------------
   Pixel8 Redact — brand tokens lifted from pixel8.ca
   ground #000 · accent #FF3D3D · text #D9D9D9
   display Unbounded · body Space Grotesk
   ------------------------------------------------------------------ */

:root {
  --ink:        #000000;
  --surface:    #0d0d0f;
  --surface-2:  #151517;
  --line:       #26262a;
  --line-soft:  #1c1c1f;
  --text:       #d9d9d9;
  --text-dim:   #8a8a90;
  --head:       #ffffff;
  --accent:     #ff3d3d;
  --accent-ink: #ffffff;
  --accent-wash: rgba(255, 61, 61, .12);

  --display: "Unbounded", "Arial Black", Impact, system-ui, sans-serif;
  --body: "Space Grotesk", -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 20px;

  --rail: 296px;
  --page: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--head);
  text-transform: uppercase;
  letter-spacing: -.01em;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--text); text-decoration-color: #ffffff44; text-underline-offset: 3px; }
a:hover { color: var(--head); text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 24px; }

/* ---------------- header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 20px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.brand img {
  height: 22px; width: auto; display: block;
  filter: invert(1);                 /* same treatment pixel8.ca uses on the mark */
}
.brand .div { width: 1px; height: 20px; background: var(--line); }
.brand .crumb {
  font-family: var(--display); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; color: var(--text-dim); text-transform: uppercase;
  white-space: nowrap;
}
.brand .crumb b { color: var(--head); font-weight: 700; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.site-nav a { font-size: 14px; text-decoration: none; color: var(--text); }
.site-nav a:hover { color: var(--head); }
.site-nav .cta {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 16px; font-weight: 500;
}
.site-nav .cta:hover { border-color: var(--accent); color: var(--head); }

/* ---------------- hero ---------------- */

.hero { padding: 56px 0 34px; }
#tool { scroll-margin-top: 84px; }
.hero .eyebrow {
  font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(38px, 6.4vw, 74px);
  font-weight: 900; line-height: .95; letter-spacing: -.02em;
  max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  margin: 20px 0 0; max-width: 58ch; font-size: 17px; color: var(--text);
}
.hero .facts {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding: 0; list-style: none;
}
.hero .facts li {
  font-size: 12.5px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px;
}
.hero .facts b { color: var(--head); font-weight: 500; }

/* ---------------- tool ---------------- */

.tool {
  display: grid; grid-template-columns: var(--rail) 1fr;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
  min-height: 560px;
}

.rail {
  border-right: 1px solid var(--line);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 20px;
}

.field { display: flex; flex-direction: column; gap: 10px; }
.field[hidden] { display: none; }
.legend {
  font-family: var(--display); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; color: var(--text-dim); text-transform: uppercase;
}
.inline { display: flex; align-items: center; gap: 10px; }
.inline > .btn { flex: 1; }

.btn {
  font: 500 13.5px/1 var(--body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.btn:hover:not(:disabled) { background: #1d1d21; border-color: #3a3a41; color: var(--head); }
.btn:disabled { opacity: .34; cursor: not-allowed; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 700; padding: 13px 12px;
}
.btn--primary:hover:not(:disabled) { background: #ff5555; border-color: #ff5555; color: #fff; }
.btn--file { display: block; width: 100%; text-align: center; }
.btn--file input { display: none; }

.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.seg button {
  flex: 1; border: 0; background: none; cursor: pointer;
  font: 500 13px/1 var(--body); color: var(--text-dim);
  padding: 9px 4px; border-radius: 4px;
  transition: background .13s, color .13s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--accent); color: #fff; font-weight: 700;
}

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; background: none; margin: 0; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); margin-top: -6.5px; border: 0;
}
input[type=range]::-moz-range-track { height: 2px; background: var(--line); }
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--accent);
}

input[type=number] {
  font: 400 13.5px var(--mono); width: 68px;
  background: var(--surface-2); color: var(--head);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}
input[type=color] {
  width: 34px; height: 30px; padding: 0; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.note { font-size: 12.5px; color: var(--text-dim); }
kbd {
  font: 500 11px/1.6 var(--mono); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px;
}
.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }
.grow { flex: 1; min-height: 4px; }

/* Export follows the viewport down a long page so it is always one click away. */
.rail__export {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--surface);
  padding: 14px 0 22px;
  margin-bottom: -22px;
}
.rail__export::before {
  content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px;
  background: linear-gradient(to top, var(--surface), transparent);
  pointer-events: none;
}

/* ---------------- stage ---------------- */

.stage {
  position: relative;
  display: grid; place-items: center;
  padding: 30px;
  background:
    radial-gradient(ellipse at 50% 0%, #17171b 0%, var(--ink) 72%);
  overflow: hidden;
}
#frame { position: relative; line-height: 0; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
#frame[hidden] { display: none; }

#canvas {
  display: block; max-width: 100%; max-height: 70vh;
  background-color: #3a3e47;
  background-image:
    linear-gradient(45deg, #262a31 25%, transparent 25%, transparent 75%, #262a31 75%),
    linear-gradient(45deg, #262a31 25%, transparent 25%, transparent 75%, #262a31 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  image-rendering: pixelated;
}
#overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; cursor: crosshair;
}
#overlay.is-off { pointer-events: none; }
#overlay.is-brush { cursor: none; }

#dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
  padding: 62px 48px; text-align: center; max-width: 460px;
  transition: border-color .16s, background .16s;
}
#dropzone[hidden] { display: none; }
#dropzone strong {
  display: block; font-family: var(--display); font-weight: 700;
  text-transform: uppercase; color: var(--head); font-size: 17px; margin-bottom: 10px;
}
#dropzone p { margin: 0 0 22px; color: var(--text-dim); font-size: 13.5px; }
#dropzone .btn { display: inline-block; padding: 12px 22px; }
body.is-dragging #dropzone { border-color: var(--accent); background: var(--accent-wash); }

#status {
  position: absolute; left: 18px; bottom: 14px;
  font: 400 11.5px var(--mono); color: var(--text-dim);
  font-variant-numeric: tabular-nums; pointer-events: none;
}

/* ---------------- explainer + ads + footer ---------------- */

.strip { padding: 64px 0 8px; }
.strip h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; margin-bottom: 28px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; background: var(--surface);
}
.card h3 {
  font-size: 14px; font-weight: 700; letter-spacing: .04em; margin-bottom: 10px;
}
.card p { margin: 0; font-size: 14px; color: var(--text-dim); }
.card .mark {
  font-family: var(--display); font-size: 11px; font-weight: 700; color: var(--accent);
  letter-spacing: .12em; display: block; margin-bottom: 14px;
}

.privacy {
  margin-top: 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 22px 24px; background: var(--surface);
}
.privacy h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.privacy p { margin: 0; font-size: 14px; color: var(--text-dim); max-width: 82ch; }

/* Ad slots stay collapsed until a publisher ID is configured, so the page
   never ships an empty grey rectangle. See scripts/ads.js. */
.ad { margin: 44px 0 0; display: none; text-align: center; }
.ad.is-live, .ad.is-preview { display: block; }
.ad__label {
  font: 500 9.5px/1 var(--body); letter-spacing: .18em; text-transform: uppercase;
  color: #5a5a60; margin-bottom: 8px;
}
.ad ins { display: block; }
.ad.is-preview .ad__box {
  border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: 34px 16px; color: var(--text-dim); font-size: 13px;
}

.site-footer {
  margin-top: 72px; border-top: 1px solid var(--line-soft);
  padding: 40px 0 56px; font-size: 13.5px; color: var(--text-dim);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { text-decoration: none; }
.site-footer .copy { margin-left: auto; }

@media (max-width: 640px) {
  .site-footer .copy { margin-left: 0; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.cta) { display: none; }
  .brand .crumb { display: none; }
  .hero { padding: 38px 0 26px; }

  /* Image first on a phone — controls read as a tray underneath it. */
  .tool { grid-template-columns: 1fr; min-height: 0; }
  .stage { order: -1; padding: 16px; min-height: 46vh; }
  #canvas { max-height: 52vh; }
  .rail { border-right: 0; border-top: 1px solid var(--line); max-height: none; }
  #dropzone { padding: 40px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
