/* Ubuntu (Ubuntu Font Licence 1.0), served from this site so every device renders the brand font. Latin subset. Licence: fonts/UFL.txt */
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ubuntu-regular.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ubuntu-medium.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ubuntu-bold.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ubuntu-italic.woff2") format("woff2"); }
/* Layout: one centered column; header, drop zone, then a two-pane workspace (image | color panels) that stacks on narrow screens. */
:root {
  --bg: #000000;          /* pitch-black, by brand requirement */
  --surface: #07090c;     /* panels, slight blue bias */
  --line: #1a2027;
  --line-strong: #2b343e;
  --fg: #eef4f8;
  --muted: #7f8b97;
  --brand-a: #8b66f4;     /* wordmark gradient start (violet), fitted from the logo files */
  --brand-b: #29c6e2;     /* wordmark gradient end (cyan) */
  --brand-gradient: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  --accent: #4aa2eb;      /* gradient midpoint, used for flat UI accents */
  --accent-dim: rgba(74, 162, 235, 0.08);
  --accent-dim: rgba(143, 212, 255, 0.08);
  --danger: #ff8f8f;
  --font-display: "Ubuntu Viewizer", "Ubuntu", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Ubuntu Viewizer", "Ubuntu", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace; /* system faces: no third-party font request */
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding-block: 56px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */
.brand { --wm-size: clamp(56px, 10vw, 96px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand-icon { width: 76px; height: 76px; margin-bottom: 18px; display: block; }
.gradient-text {
  color: var(--accent);
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--wm-size);
  line-height: 1;
  letter-spacing: 0;
}
.wordmark .view { font-weight: 700; }
.wordmark .izer { font-weight: 400; }
.tagline { margin: 0; font-size: calc(var(--wm-size) * 0.333); font-weight: 400; line-height: 1.15; } /* same 3:1 ratio as the logo */
.slogan { margin: 10px 0 0; font-size: 15px; font-style: italic; font-weight: 400; }

/* Drop zone */
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-dim); }
.dropzone.is-over { border-style: solid; }
.dz-icon { width: 36px; height: 36px; color: var(--accent); }
.dz-title { margin: 0; font-size: 16px; font-weight: 500; }
.dz-title strong { color: var(--accent); font-weight: 700; }
.dz-sub { margin: 0; font-size: 13px; color: var(--muted); }
.dz-privacy { margin: 4px 0 0; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dz-error { margin: 4px 0 0; font-size: 13px; color: var(--danger); }

/* Workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 820px) { .workspace { grid-template-columns: minmax(0, 1fr); } }

.viewer { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.viewer-meta .name { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.viewer-meta .dims { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
  min-height: 240px;
}
.frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
#view {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  width: auto; height: auto;
  border-radius: 6px;
  cursor: none;
  touch-action: none;
}
html.lens-drag, html.lens-drag * { cursor: none !important; } /* pointer dragging the lens past the image edge */
.hint { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }

/* Loupe */
.loupe {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translate(-50%, -50%);
  z-index: 5;
  line-height: 1.2;
}
.loupe-lens {
  width: 150px; height: 150px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px #000, 0 12px 32px rgba(0,0,0,.6);
  background: #000;
}
.loupe-lens canvas { display: block; width: 150px; height: 150px; }
.loupe-label {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); /* inside the lens, so clipping keeps it with the circle */
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: rgba(0, 0, 0, .78); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px 10px 3px 6px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.loupe-label i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); display: block; }

/* Panels */
.panels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg); }
.panel-note { font-size: 12px; color: var(--muted); }
.text-btn { background: none; border: 0; padding: 2px 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.text-btn:hover { color: var(--accent); }

.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.swatch {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.swatch .fill { display: block; width: 100%; aspect-ratio: 1 / 1.15; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .12s; }
.swatch:hover .fill { transform: translateY(-2px); }
.swatch[aria-pressed="true"] .fill { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.swatch .hex { font-family: var(--font-mono); font-size: 11px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.swatch .share { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }

.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 8px; }
.pick { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.pick.is-new { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
.empty { margin: 0; font-size: 13px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; text-align: center; }

/* Color data */
.detail-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-chip { width: 56px; height: 56px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.detail-title { min-width: 0; }
.detail-title .big { font-family: var(--font-mono); font-size: 20px; font-weight: 500; }
.detail-title .src { font-size: 12px; color: var(--muted); }
.values { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.value-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; background: #000;
}
.value-row dt { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin: 0; }
.value-row dd { margin: 0; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; user-select: all; }
.copy-btn {
  background: none; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--fg);
  display: inline-flex; align-items: center; gap: 6px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; }
.detail-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.detail-foot .text-btn { white-space: nowrap; flex: none; }

.main { display: flex; flex-direction: column; gap: 28px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px); opacity: 0;
  background: var(--brand-gradient); color: #000; font-weight: 500; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  transition: opacity .18s, transform .18s; pointer-events: none; z-index: 20;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { margin-top: auto; text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); padding-block: 20px 0; }
footer p { margin: 0; }

@media (max-width: 480px) {
  .page { padding-block: 36px 24px; gap: 28px; }
  .swatches { gap: 6px; }
  .swatch .share { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
