@font-face { font-family: "Discovery"; src: url("fonts/discovery-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Discovery"; src: url("fonts/discovery-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Discovery"; src: url("fonts/discovery-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pompei Block"; src: url("fonts/pompei-block-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

/* His brand: highlighter yellow, petrol blue ink, a red dot */
:root {
  --bg: #04080a;
  --ink: #f1efe6;
  --muted: #93a09f;
  --brand-yellow: #ffe81a;
  --brand-teal: #00757c;
  --brand-red: #f2400f;
  --accent: var(--brand-yellow);
  --accent-soft: rgba(255, 232, 26, 0.14);
  --glass: rgba(6, 22, 25, 0.66);
  --edge: rgba(120, 220, 225, 0.12);
  --edge-strong: rgba(0, 170, 178, 0.55);
}
body[data-medium="salt"] {
  --accent: #bfe6ff;
  --accent-soft: rgba(191, 230, 255, 0.14);
  --edge-strong: rgba(191, 230, 255, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Discovery", system-ui, sans-serif;
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }

/* Subtle broadcast texture over the whole stage */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

/* ---------- Title ---------- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  padding: 26px 32px 60px;
  background: linear-gradient(to bottom, rgba(5, 6, 10, 0.9), rgba(5, 6, 10, 0));
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 10px var(--brand-red);
  animation: pulse 1.6s ease-in-out infinite;
}
.logo {
  position: relative;
  width: clamp(190px, 19vw, 280px);
  aspect-ratio: 200 / 92;
  margin: 8px 0 6px;
  background: url("brush.svg") center / 100% 100% no-repeat;
}
.logo img { position: absolute; top: 14%; left: 10%; width: 80%; height: 72%; }
.logo-dot {
  position: absolute;
  left: 6%;
  bottom: 22%;
  width: 4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--brand-red);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top p { margin: 0; color: var(--muted); font-size: 16px; font-weight: 300; }

@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Developer credit ---------- */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.credit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  pointer-events: auto;
}
.credit-name { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); padding-inline-start: 10px; line-height: 1.15; }
.credit-name small { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.credit-name strong { font-size: 14px; font-weight: 700; }
.credit-name:hover strong { color: var(--accent); }
.wa {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #25d366;
  color: #062b14;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 0 22px rgba(37, 211, 102, 0.3);
  transition: filter 0.2s, transform 0.15s;
}
.wa:hover { filter: brightness(1.08); }
.wa:active { transform: scale(0.97); }
.wa svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Live monitor ---------- */
.monitor {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 340px;
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: zoom-in;
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 3;
}
.monitor.big { width: min(calc(100vw - 48px), calc((100vh - 210px) * 4 / 3)); cursor: zoom-out; }
.monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  direction: ltr;
}
.rec { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; animation: pulse 1.2s infinite; }
.clock { font-variant-numeric: tabular-nums; }
.screen { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.screen canvas { display: block; width: 100%; height: auto; }
.corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--brand-teal); opacity: 0.8; }
.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  padding-top: 8px;
  border-top: 2px solid var(--edge);
  transition: color 0.3s, border-color 0.3s;
  white-space: nowrap;
}
.steps li::before { content: "0" counter(step) " "; font-weight: 700; opacity: 0.6; }
.steps li.done { color: var(--ink); border-color: var(--edge-strong); }
.steps li.now { color: var(--accent); border-color: var(--accent); }

.status {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink);
}
.status b { color: var(--accent); font-variant-numeric: tabular-nums; }
.status i { display: none; }

/* ---------- Control dock ---------- */
.dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 4;
}
.btn, .seg button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover, .seg button:hover { border-color: var(--edge-strong); }
.btn:active, .seg button:active { transform: scale(0.97); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04363a;
  box-shadow: 0 0 24px var(--accent-soft);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
/* The file input covers its button invisibly: a direct tap on a real input is
   the one way that reliably opens the photo picker on every phone browser */
.btn.primary { position: relative; overflow: hidden; }
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:hover { border-color: var(--edge); }
#download:not(:disabled) { border-color: var(--edge-strong); color: var(--accent); }

.seg { display: flex; padding: 3px; gap: 2px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--edge); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; color: var(--muted); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- Drop overlay ---------- */
.drop {
  position: fixed;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 24px;
  background: rgba(5, 6, 10, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.drop span { font-family: "Pompei Block", sans-serif; font-weight: 900; font-size: clamp(26px, 4vw, 44px); color: var(--accent); }
.drop.on { opacity: 1; }

@media (min-width: 641px) and (max-width: 1100px) {
  /* Tablet / narrow desktop: controls across the bottom, monitor above them */
  .dock { left: 24px; right: 24px; justify-content: center; flex-wrap: wrap; border-radius: 22px; }
  .monitor { width: 260px; bottom: 96px; }
  .monitor .steps li { font-size: 10px; }
}

@media (max-width: 640px) {
  /* Phone: title, one big live monitor, the artist, controls, small credit */
  .top { padding: 12px 14px 0; background: none; flex-direction: column; align-items: center; text-align: center; }
  .brand { display: flex; flex-direction: column; align-items: center; }
  .eyebrow { font-size: 11px; }
  .logo { width: 170px; margin: 6px auto 0; }
  .monitor { display: none; }
  .top p { display: none; }

  .monitor,
  .monitor.big {
    left: 12px;
    right: 12px;
    top: 98px;
    bottom: auto;
    width: auto;
    max-width: 520px;
    margin: 0 auto;
    padding: 8px;
    cursor: default;
  }
  .monitor-head { margin-bottom: 7px; font-size: 11px; }
  .steps { margin-top: 8px; }
  .steps li { font-size: 10px; padding-top: 6px; }
  .status { font-size: 12px; margin-top: 7px; }

  .dock {
    left: 12px;
    right: 12px;
    bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: 20px;
  }
  .btn, .seg button { font-size: 13px; padding: 8px 12px; }
  .seg button { padding: 6px 10px; }

  /* Credit becomes a slim line under the controls */
  .credit {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 8px;
    justify-content: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
  }
  .credit-name { flex-direction: row; align-items: baseline; gap: 5px; padding: 0; }
  .credit-name small { font-size: 11px; }
  .credit-name strong { font-size: 12px; }
  .wa { padding: 4px 10px; font-size: 11px; box-shadow: none; gap: 4px; }
  .wa svg { width: 13px; height: 13px; }
}
