/* fclaro.net shared styles
   One file for every page: tokens, type, layout, and the components the
   tools share. Page files only add what is unique to them. Each page sets
   its own --accent (see body style attribute). */

@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* surfaces */
  --bg: #090b10;
  --panel: #10131a;
  --panel-2: #151922;
  --panel-3: #1b2029;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* text */
  --text: #eef1f6;
  --muted: #8f98a9;

  /* tool colours (tally lights) */
  --hue-blue: #4f8dff;
  --hue-orange: #ff9f4f;
  --hue-purple: #a06bff;
  --hue-green: #3ddc97;
  --hue-red: #ff5f6b;
  --accent: var(--hue-blue);
  --accent-ink: #070a10;

  /* type */
  --sans: "Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* spacing scale: use only these */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;

  --radius: 8px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  /* faint engineering grid instead of a colour glow */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  padding: var(--s6) var(--s4) var(--s7);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 780px; margin: 0 auto; }
.wrap.wide { max-width: 1000px; }

a { color: inherit; }

/* ---------- breadcrumb (replaces eyebrow + back link) ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--s6);
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }
.crumb .sep { opacity: 0.5; }
.crumb .here { color: var(--text); }
button.crumb-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
button.crumb-btn:hover { color: var(--text); }

/* ---------- page head ---------- */
.page-head { margin-bottom: var(--s6); }
.page-head h1 {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 var(--s2);
}
.subtitle { color: var(--muted); font-size: 0.95rem; margin: 0; max-width: 60ch; }

/* tally light: the one place a tool's colour shows up in a heading */
.tally {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  margin-bottom: var(--s5);
}

/* ---------- form controls ---------- */
label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: var(--s1); }
.field { margin-bottom: var(--s5); }
.row { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s5); }
.row .field { flex: 1; min-width: 140px; margin-bottom: 0; }

input[type=text], input[type=number], select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--s2) var(--s3);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
select { color-scheme: dark; }
select option { background-color: var(--panel-2); color: var(--text); }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }

/* ---------- buttons ---------- */
.btn, button.primary, .secondary {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
button.primary, .btn.primary {
  width: 100%;
  padding: var(--s3);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.btn.primary { width: auto; padding: var(--s2) var(--s4); font-size: 0.875rem; }
button.primary:hover:not(:disabled), .btn.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 85%, white);
}
button.primary:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.secondary, .btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--s2) var(--s3);
}
.secondary:hover, .btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--panel-3); }
.btn.small { padding: var(--s1) var(--s3); font-size: 0.8rem; }
.btn.ghost { background: transparent; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--s7) var(--s4);
  text-align: center;
  cursor: pointer;
  background: var(--panel);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.dropzone:hover, .dropzone.drag, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--panel-2);
}
.dropzone .title { font-weight: 500; }
.dropzone .hint { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: var(--s2); }
.dropzone .filename {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--hue-green);
  margin-top: var(--s3);
  word-break: break-all;
}

/* ---------- sticky status bar ---------- */
.status-panel {
  position: sticky;
  top: var(--s3);
  z-index: 20;
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.status-line {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.status-line .left { display: flex; align-items: center; gap: var(--s2); }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite ease-in-out;
  flex-shrink: 0;
}
.dot.done { background: var(--hue-green); animation: none; }
.dot.error { background: var(--hue-red); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- two-screen slider ---------- */
.slider-viewport { overflow: hidden; }
.slider-track {
  display: flex;
  align-items: flex-start;
  width: 200%;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.slider-track.show-results { transform: translateX(-50%); }
.slide { width: 50%; flex-shrink: 0; min-width: 0; }
.slide:first-child { padding-right: 1px; }
.slide:last-child { padding-left: 1px; }

/* ---------- result metadata ---------- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.meta-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s2) var(--s3);
}
.meta-item .k { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.meta-item .v { font-size: 0.95rem; margin-top: 2px; }
.v.ok { color: var(--hue-green); }
.v.warn { color: var(--muted); }

/* ---------- errors ---------- */
.error-box {
  border: 1px solid rgba(255, 95, 107, 0.4);
  background: rgba(255, 95, 107, 0.08);
  color: #ffb3b8;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* ---------- footer ---------- */
.site-foot {
  margin-top: var(--s7);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

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

[hidden] { display: none !important; }

@media (max-width: 560px) {
  body { padding: var(--s5) var(--s4) var(--s7); }
  .page-head h1 { font-size: 1.45rem; }
  .panel { padding: var(--s4); }
}
