/* ============================================================
   SIGNAL CHAIN ANALYSER stylesheet.
   Box Of Rules design system, inverted to a light "studio paper"
   direction: warm off-white ground, near-black ink, cyan drive,
   cyan drive, amber accent. Same token names as boxofrules.com so
   components port both ways; values are this site's own.
   ============================================================ */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/archivo-var.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-400italic.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-600.woff2") format("woff2");
}

:root {
  --paper:   #F7F3EA;   /* page ground */
  --card:    #FFFFFF;   /* raised surfaces */
  --card-2:  #EFE9DB;   /* sunken surfaces (tracks, wells) */
  --ink:     #17150F;   /* primary text */
  --ink-2:   #4E483C;   /* secondary text */
  --mute:    #8A8270;   /* muted text */
  --amber:   #F2A20C;   /* fills, buttons, highlights */
  --amber-2: #FFB938;
  --amber-deep: #B27200; /* amber as TEXT on light (contrast) */
  --cyan:    #23707F;   /* PRIMARY: links, buttons, active state */
  --cyan-deep: #17505C;  /* primary hover */
  --sunk:    #E4DED0;   /* quiet button / inset fill */
  --cyan-2:  #5FB4C4;
  --blood:   #B21D1D;
  --green:   #2F7A36;
  --line:    #DFD7C5;
  --maxw:    1140px;
  --ease:    cubic-bezier(.2,.6,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Barlow", system-ui, sans-serif; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-deep); }
img { display: block; max-width: 100%; }
h1,h2,h3,h4 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
::selection { background: var(--amber); color: var(--ink); }

.display { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; line-height: 1.08; }
.cond { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; letter-spacing: -.01em; }
.num { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.eyebrow {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-size: 12px; color: var(--amber-deep);
}
.muted { color: var(--mute); }
.small { font-size: 14px; }

/* ── NAV ─────────────────────────────────────────── */
header.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,243,234,.92); backdrop-filter: blur(8px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand .bn { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.brand .bt { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: var(--cyan); }
nav.links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
nav.links a, nav.links button {
  font-family: "Barlow", system-ui, sans-serif; font-weight: 500;
  font-size: 15px; color: var(--ink-2);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  transition: color .2s var(--ease);
}
nav.links a:hover, nav.links button:hover { color: var(--ink); }
nav.links a.active { color: var(--ink); font-weight: 600; }
.nav-credits {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--sunk); border-radius: 999px; padding: 6px 13px;
}
.nav-credits:hover { background: var(--card-2); color: var(--ink); }

/* ── BUTTONS / FORMS ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600;
  letter-spacing: .01em; font-size: 15px; line-height: 1.1;
  padding: 13px 22px; border-radius: 4px; border: 0;
  background: var(--cyan); color: #fff; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--cyan-deep); color: #fff; }
.btn.ghost { background: var(--sunk); color: var(--ink); }
.btn.ghost:hover { background: var(--card-2); color: var(--ink); }
.btn.accent { background: var(--amber); color: var(--ink); }
.btn.accent:hover { background: var(--amber-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--blood); padding-left: 0; padding-right: 0; }
.btn.danger:hover { color: #8C1616; }
.btn.small { padding: 8px 15px; font-size: 13px; }
.btn[disabled], .btn.disabled { background: var(--card-2); color: var(--mute); cursor: not-allowed; }

label { display: block; font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink-2); margin: 18px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--card-2); border: 0; border-radius: 4px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
input[type="file"] { width: 100%; color: var(--ink-2); padding: 10px 0; }
input[type="file"]::file-selector-button {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 14px;
  background: var(--sunk); color: var(--ink); border: 0; border-radius: 4px;
  padding: 10px 17px; margin-right: 14px; cursor: pointer;
}
.field-error { color: var(--blood); font-size: 14px; margin-top: 5px; }
form .hint { color: var(--mute); font-size: 14px; margin-top: 6px; }

/* ── FLASH ───────────────────────────────────────── */
.flash { background: #D6EAD8; color: #245C2A; padding: 14px 18px; border-radius: 5px; margin: 20px 0; }
.flash.error { background: #F6DADA; color: var(--blood); }

/* ── SECTIONS / CARDS ────────────────────────────── */
main { min-height: 70vh; }
.section { padding: 64px 0; }
.section.tight { padding: 36px 0; }
.section h2.display { font-size: clamp(26px, 4vw, 40px); margin-bottom: 18px; }
.hero { padding: 56px 0 64px; background: radial-gradient(1200px 500px at 70% -10%, rgba(35,112,127,.10), transparent 60%); }
.hero h1 { font-size: clamp(38px, 7vw, 74px); margin: 14px 0 20px; }
.hero .lede { font-size: 20px; max-width: 700px; color: var(--ink-2); }
.hero .cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border-radius: 6px; padding: 26px; }
.card h3 { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--ink); margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card.accent { background: #E7F0F1; }

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat { background: var(--card); border-radius: 6px; padding: 20px 26px; min-width: 150px; }
.stat .n { font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 38px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); }
.stat .l { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--mute); }

/* ── TABLES ──────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; }
table.data th {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px;
  color: var(--mute); text-align: left; padding: 12px 14px;
}
table.data td { padding: 13px 14px; vertical-align: top; background: var(--card); }
table.data tbody tr td:first-child { border-radius: 5px 0 0 5px; }
table.data tbody tr td:last-child { border-radius: 0 5px 5px 0; }
table.data tr:hover td { background: #FBF8F1; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-size: 11px; padding: 5px 11px; border-radius: 999px; color: var(--ink-2); background: var(--card-2);
}
.badge.done { background: #D6EAD8; color: #245C2A; }
.badge.failed { background: #F6DADA; color: var(--blood); }
.badge.queued, .badge.running { background: #F7E6C6; color: var(--amber-deep); }
.badge.credit-pos { background: #D6EAD8; color: #245C2A; }
.badge.credit-neg { background: #F6DADA; color: var(--blood); }

/* ── BAND BARS (frequency band energy) ───────────── */
.bands { display: grid; gap: 8px; }
.band-row { display: grid; grid-template-columns: 118px 1fr 64px; gap: 18px; align-items: center; font-size: 14px; }
.band-row .bl { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink-2); }
.band-row .bv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.band-track { display: block; background: var(--card-2); border-radius: 3px; height: 26px; overflow: hidden; }
.band-fill { display: block; background: var(--cyan-2); border-radius: 3px; height: 100%; }
.band-fill.alt { background: var(--amber); }
.band-fill.peak { background: var(--cyan); }

/* ── RUN DETAIL ──────────────────────────────────── */
.run-images { display: grid; gap: 26px; margin-top: 20px; }
.run-images figure { margin: 0; background: var(--card); border-radius: 6px; padding: 10px; }
.run-images figcaption { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink-2); padding: 8px 4px 8px; }
.feature-block { margin-top: 34px; }
.feature-block h3 { font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -.01em; color: var(--ink); margin-bottom: 4px; }
.feature-block .sub { color: var(--mute); font-size: 15px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.kv .item { background: var(--card); border-radius: 5px; padding: 14px 16px; }
.kv .k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-family: "Archivo", system-ui, sans-serif; }
.kv .v { font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin-top: 2px; }
.kv .hint { font-size: 13px; color: var(--mute); line-height: 1.4; margin-top: 3px; }

/* ── FIELD NOTES ─────────────────────────────────── */
.note-article { max-width: 760px; }
.note-article h2 { margin-top: 40px; }
.note-article blockquote { margin: 20px 0; padding: 14px 20px; border-left: 3px solid var(--amber); background: var(--card); color: var(--ink-2); }
.note-article ul { padding-left: 22px; }
.note-article li { margin-bottom: 6px; }

/* ── AUTH / NARROW FORMS ─────────────────────────── */
.narrow { max-width: 460px; margin: 0 auto; }
.narrow .card { padding: 32px; }
.auth-alt { margin-top: 18px; font-size: 15px; color: var(--mute); }

/* ── PAGINATION (Laravel default markup, restyled) ── */
nav[role="navigation"] { margin-top: 26px; }
nav[role="navigation"] svg { width: 18px; height: 18px; }

/* ── WAVEFORM ANIMATIONS ─────────────────────────── */
/* Hero "question marks in, measurements out" waveform.
   Left bars (.u): unknown signal, grey, jittering, "?" glyphs above.
   A scanline sweeps across; right bars (.k): measured, amber, steady,
   with real readout chips. Bars carry --i (index) and --h (peak 0-1). */
.wavelab {
  position: relative; height: 150px; margin: 0 0 44px;
  display: flex; align-items: center; gap: 4px; overflow: hidden;
}
.wavelab .bar {
  flex: 1 1 0; min-width: 3px; height: 100%; border-radius: 2px;
  transform: scaleY(var(--h)); transform-origin: center;
}
.wavelab .bar.u {
  background: #C7BFAC;
  animation: waveguess 1.3s steps(3, jump-none) infinite;
  animation-delay: calc(var(--i) * -.17s);
}
.wavelab .bar.k {
  background: linear-gradient(180deg, var(--amber-2), var(--amber) 55%, var(--amber-deep));
  animation: wavesettle 3.2s var(--ease) infinite;
  animation-delay: calc(var(--i) * -.11s);
}
@keyframes waveguess {
  0%, 100% { transform: scaleY(calc(var(--h) * .55)); }
  30%      { transform: scaleY(calc(var(--h) * 1.25)); }
  55%      { transform: scaleY(calc(var(--h) * .25)); }
  80%      { transform: scaleY(calc(var(--h) * .9)); }
}
@keyframes wavesettle {
  0%, 100% { transform: scaleY(calc(var(--h) * .92)); }
  50%      { transform: scaleY(var(--h)); }
}
.wavelab .q {
  position: absolute; top: 4px; font-family: "Archivo", system-ui, sans-serif;
  font-size: 26px; color: var(--mute); opacity: .7;
  animation: qbob 2.2s ease-in-out infinite;
}
.wavelab .q:nth-of-type(2) { animation-delay: -.7s; font-size: 19px; }
.wavelab .q:nth-of-type(3) { animation-delay: -1.4s; font-size: 22px; }
@keyframes qbob {
  0%, 100% { transform: translateY(0) rotate(-4deg); opacity: .45; }
  50%      { transform: translateY(-5px) rotate(4deg); opacity: .8; }
}
.wavelab .readout {
  position: absolute; z-index: 2;
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  background: var(--card); border: 1px solid var(--amber);
  border-radius: 3px; padding: 3px 9px; color: var(--ink);
  box-shadow: 0 1px 3px rgba(23,21,15,.12);
}
.wavelab .readout b { color: var(--amber-deep); font-weight: 600; }
.wavelab .scanline {
  position: absolute; top: 4%; bottom: 4%; left: 0; width: 2px; z-index: 1;
  background: var(--amber-deep);
  box-shadow: 0 0 14px rgba(242,162,12,.85);
  animation: scan 6s linear infinite;
}
@keyframes scan {
  0%   { left: 0; opacity: 0; }
  6%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Scrolling waveform divider: seamless repeating SVG wave. */
.wave-divider {
  height: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='46' viewBox='0 0 240 46'%3E%3Cpath d='M0 23 Q 15 4 30 23 T 60 23 Q 75 42 90 23 T 120 23 Q 135 9 150 23 T 180 23 Q 195 37 210 23 T 240 23' fill='none' stroke='%23F2A20C' stroke-width='2' stroke-linecap='round' opacity='.8'/%3E%3Cpath d='M0 23 Q 20 12 40 23 T 80 23 Q 100 34 120 23 T 160 23 Q 180 15 200 23 T 240 23' fill='none' stroke='%2323707F' stroke-width='1.5' stroke-linecap='round' opacity='.45'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 240px 46px; background-position: 0 50%;
  animation: wavescroll 9s linear infinite;
}
@keyframes wavescroll {
  from { background-position-x: 0; }
  to   { background-position-x: -240px; }
}
.wave-divider.tight { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .wavelab .bar, .wavelab .q, .wavelab .scanline, .wave-divider { animation: none; }
  .wavelab .scanline { display: none; }
}

/* ── FOOTER ──────────────────────────────────────── */
footer.site {
  margin-top: 70px; padding: 40px 0 50px;
  color: var(--mute); font-size: 14px; background: var(--card-2);
}
footer.site .foot-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer.site a { color: var(--cyan); }
footer.site a:hover { color: var(--cyan-deep); }
footer.site .foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── QUEUE STATE (loud, you should never wonder where your run is) ── */
.queue-state {
  display: flex; align-items: center; gap: 26px; margin-top: 24px;
  background: var(--card-2); border-radius: 6px; padding: 26px 28px;
}
.queue-state .qs-number {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(56px, 9vw, 96px); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  line-height: 1; color: var(--cyan); min-width: 76px; text-align: center;
}
.queue-state .qs-number.live { color: var(--cyan); animation: qs-pulse 1.2s ease-in-out infinite; }
.queue-state .qs-copy h3 { font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -.01em; margin: 0 0 8px; }
.queue-state .qs-copy p { margin: 0; }
@keyframes qs-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .queue-state .qs-number.live { animation: none; } }

/* ── BOR LOGO MARKS (brand blue #69afbf, from the press kit set) ───── */
.brand { align-items: center; }
.brand .bl { display: block; height: 52px; width: auto; }
.foot-logo { display: block; height: 64px; width: auto; margin-bottom: 12px; }


/* ── PROCESS STEPPER (upload -> analysing -> read-out) ───────────── */
.steps { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.steps .step {
  display: flex; align-items: center; gap: 8px;
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--mute);
}
.steps .step .dot {
  width: 20px; height: 20px; border-radius: 999px; background: var(--card-2); color: var(--mute);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.steps .step.done { color: var(--mute); }
.steps .step.done .dot { background: #CFE3E7; color: var(--cyan-deep); }
.steps .step.now { color: var(--ink); }
.steps .step.now .dot { background: var(--cyan); color: #fff; }
.steps .bar { width: 26px; height: 2px; background: var(--line); border-radius: 2px; }
.steps .bar.done { background: var(--cyan); }

/* ── VERDICT BAND (plain English before any number) ──────────────── */
.verdict { background: var(--ink); color: var(--bone, #ECE6D8); border-radius: 8px; padding: 30px 32px; margin: 26px 0 32px; }
.verdict .eyebrow { color: var(--cyan-2); }
.verdict h2 {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 27px;
  line-height: 1.3; letter-spacing: -.01em; max-width: 30ch; margin: 12px 0 16px;
}
.verdict p { color: #B7B0A0; max-width: 64ch; margin: 0; line-height: 1.6; }
.verdict .tags { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.verdict .tags span {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-size: 12px; background: #26241F; color: #ECE6D8;
  padding: 8px 13px; border-radius: 999px;
}

/* ── NEXT ACTIONS (what to do with the read-out) ─────────────────── */
.next-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 40px; }
.next-actions .card { display: flex; flex-direction: column; gap: 10px; }
.next-actions .card p { flex-grow: 1; margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.next-actions .card .btn { align-self: flex-start; }
@media (max-width: 860px) { .next-actions { grid-template-columns: 1fr; } }

/* ── ACCOUNT SHELL (runs, billing and settings in one place) ─────── */
.account { display: grid; grid-template-columns: 228px minmax(0,1fr); gap: 32px; align-items: start; }
.account-rail { display: flex; flex-direction: column; gap: 2px; }
.account-rail .grp {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-size: 12px; color: var(--mute); padding: 22px 14px 10px;
}
.account-rail .grp:first-child { padding-top: 0; }
.account-rail a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 6px; color: var(--ink-2); font-size: 15px;
}
.account-rail a:hover { background: var(--card-2); color: var(--ink); }
.account-rail a.active { background: var(--card); color: var(--ink); font-weight: 600; }
.account-rail a.active::before { content: ""; width: 5px; height: 20px; border-radius: 99px; background: var(--cyan); }
@media (max-width: 860px) {
  .account { grid-template-columns: 1fr; }
  .account-rail { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .account-rail .grp { display: none; }
}
