/* Joule design tokens and base components.
   Extracted from the landing page, console and deck sources in web/resources/ —
   the reference is web/design/DESIGN_PACK.md. Dark web mode is the default;
   [data-mode="light"] switches a page to the light web variant. */

:root {
  /* ground and surfaces (dark web mode) */
  --ground: #101109;
  --surface: #181A13;
  --surface-raised: #1A1C18;
  --surface-inset: #20221A;
  --hairline: #30322A;
  --divider: #22241C;

  /* text */
  --ink: #F2F2EC;
  --ink-secondary: #989A8E;
  --ink-muted: #7E8074;
  --ink-kicker: #8C8E84;
  --ink-list: #B9BBAF;

  /* accents */
  --blue: #5E78F0;
  --blue-hover: #6E86F4;
  --blue-tint: #9FB0F5;
  --blue-deep: #2C46D8;
  --amber: #E5A23F;
  --green: #3FB97A;

  /* inverted (light card on dark page, and the nav pill) */
  --paper: #FBFBF8;
  --paper-soft: #F2F2EC;
  --paper-hairline: #D8D8CC;
  --paper-ink: #1A1C18;

  /* type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* shape */
  --radius-control: 8px;
  --radius-button: 10px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 30px 90px -40px rgba(0, 0, 0, 0.8);
  --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.45);

  /* rhythm */
  --container: 1000px;
  --gutter: 16px;
}

[data-mode="light"] {
  --ground: #FFFFFF;
  --surface: #FBFBF8;
  --surface-raised: #FFFFFF;
  --surface-inset: #EDEEF1;
  --hairline: #E4E7EC;
  --divider: #EDEEF1;
  --ink: #1A1C18;
  --ink-secondary: #61666F;
  --ink-muted: #8A9099;
  --ink-kicker: #8A9099;
  --ink-list: #2E3138;
  --blue: #3258EE;
  --blue-hover: #2C46D8;
  --blue-tint: #EDF0FE;
  --blue-deep: #233BB0;
  --amber: #D98A1E;
  --green: #2E7D52;
  --shadow-card: 0 30px 90px -40px rgba(20, 24, 40, 0.25);
  --shadow-float: 0 10px 30px rgba(20, 24, 40, 0.12);
}

/* ── base ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(94, 120, 240, 0.35); }
::placeholder { color: var(--ink-muted); opacity: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 6px; }
input, textarea, button { font: inherit; }
img { max-width: 100%; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ── type ─────────────────────────────────────────────────────────────── */

.display-hero {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
}
.display-section {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-kicker);
}
.kicker .number { color: var(--blue); margin-right: 0.6em; }
.standfirst { color: var(--ink-secondary); max-width: 560px; }
.figure {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.mono { font-family: var(--font-mono); }

/* ── components ───────────────────────────────────────────────────────── */

.button {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-button);
  padding: 14px 26px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--blue-hover); }
.button.small { padding: 9px 16px; border-radius: var(--radius-control); }
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.button.ghost:hover { border-color: var(--ink-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-card);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 9px 15px;
  box-shadow: var(--shadow-float);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* the nav is an inverted pill: paper on the dark ground */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  background: #fff;
  border: 1px solid var(--paper-hairline);
  border-radius: var(--radius-pill);
  padding: 11px 21px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--paper-ink);
}
.nav-pill a { color: inherit; text-decoration: none; }

/* console chrome: dark window, traffic dots, mono address line */
.console {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--surface-inset);
  border-bottom: 1px solid var(--divider);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}
.console-bar .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--hairline);
}
.console-bar .address { margin-left: 8px; }
.console-body { padding: 18px; font-family: var(--font-mono); font-size: 13px; }

.status-good { color: var(--green); }
.status-waste { color: var(--amber); }
.status-live { color: var(--blue); }

/* ── motion ───────────────────────────────────────────────────────────── */

@keyframes jblink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes jfloat { from { transform: translateY(-5px); } to { transform: translateY(7px); } }
@keyframes jprog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes jmarq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.float { animation: jfloat 5.5s ease-in-out infinite alternate; }
.blink { animation: jblink 1.1s step-end infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
