/* SiroviAI prototype 2: the calm workshop. Warm paper, ink text, one accent, serif headings,
   mono for commands. Colleagues, not bots. */
:root {
  color-scheme: light dark;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --paper: #f7f3ec;
  --paper-deep: #efe9de;
  --card: #fffdf9;
  --ink: #1c1b18;
  --ink-soft: #3f3b34;
  --muted: #6b655c;
  --line: #d9d2c5;
  --line-strong: #bfb6a6;
  --accent: #9a4a2b;
  --accent-ink: #7a3820;
  --on-accent: #fffdf9;

  /* Hire states: differ in lightness as well as hue, and always carry a label. */
  --duty: #2f6b3a;
  --duty-bg: #e4efe3;
  --asleep: #4a4e8f;
  --asleep-bg: #e6e7f3;
  --waiting: #9a6a12;
  --waiting-bg: #f6ecd4;
  --error: #a63a2a;
  --error-bg: #f7e3df;

  --chart-a: var(--accent);
  --chart-b: #4a4e8f;
  --chart-grid: #d9d2c5;

  --radius: 4px;
  --measure: 64ch;
}

/* Dark theme, borrowed from the book: near-black ground, light text, one purple accent.
   Follows the system setting unless the viewer chose with the header toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #0b0a10;
    --paper-deep: #121118;
    --card: #16151d;
    --ink: #f0eef5;
    --ink-soft: #c9c5d6;
    --muted: #8f8a9e;
    --line: #26242f;
    --line-strong: #3a3747;
    --accent: #9d8cff;
    --accent-ink: #b7aaff;
    --on-accent: #0b0a10;
    --duty: #7fd39a;
    --duty-bg: #16271c;
    --asleep: #a9b0ff;
    --asleep-bg: #1c1d33;
    --waiting: #e9c46a;
    --waiting-bg: #2a2410;
    --error: #ff8a7a;
    --error-bg: #301a17;
    --chart-a: #7f6bff;
    --chart-b: #d07a5a;
    --chart-grid: #26242f;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0b0a10;
  --paper-deep: #121118;
  --card: #16151d;
  --ink: #f0eef5;
  --ink-soft: #c9c5d6;
  --muted: #8f8a9e;
  --line: #26242f;
  --line-strong: #3a3747;
  --accent: #9d8cff;
  --accent-ink: #b7aaff;
  --on-accent: #0b0a10;
  --duty: #7fd39a;
  --duty-bg: #16271c;
  --asleep: #a9b0ff;
  --asleep-bg: #1c1d33;
  --waiting: #e9c46a;
  --waiting-bg: #2a2410;
  --error: #ff8a7a;
  --error-bg: #301a17;
  --chart-a: #7f6bff;
  --chart-b: #d07a5a;
  --chart-grid: #26242f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3,
.serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 20px;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

pre {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow-x: auto;
  line-height: 1.5;
}

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

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.soft {
  color: var(--ink-soft);
}

.small {
  font-size: 15px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.measure {
  max-width: var(--measure);
}

/* Wordmark: the name carried like a firm's, not a product code. */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* The logo comes in two colourings; the theme picks one. Same rule as the colour tokens. */
.brand .logo {
  display: block;
  height: 34px;
  width: auto;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer-brand .logo {
  display: block;
  height: 22px;
  width: auto;
}

/* Visibility rules come after the sizing rules on purpose: same specificity, later wins. */
.logo.logo-on-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo.logo-on-light {
    display: none;
  }
  :root:not([data-theme='light']) .logo.logo-on-dark {
    display: block;
  }
}
:root[data-theme='dark'] .logo.logo-on-light {
  display: none;
}
:root[data-theme='dark'] .logo.logo-on-dark {
  display: block;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 16px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--line-strong);
}

.site-nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.session {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
}

.session strong {
  color: var(--ink);
  font-weight: 600;
}

/* Buttons */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover,
button:hover {
  background: #2e2c27;
}

.button-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.button-accent:hover {
  background: var(--accent-ink);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  font-weight: 500;
}

.button-secondary:hover {
  background: var(--paper-deep);
}

.button-large {
  min-height: 50px;
  padding: 0 26px;
  font-size: 17px;
}

.button-small,
button.button-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
label {
  font-size: 15px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9a9285;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
}

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 880px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container {
    padding: 0 20px;
  }

  .site-header {
    padding: 16px 20px;
  }
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.notice-ok {
  border-color: var(--duty);
  background: var(--duty-bg);
}

.notice-warn {
  border-color: var(--waiting);
  background: var(--waiting-bg);
}

.notice-error {
  border-color: var(--error);
  background: var(--error-bg);
}

/* Status pills: word + dot, never colour alone. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  color: var(--ink-soft);
  white-space: nowrap;
}

.pill::before {
  content: '';
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentcolor;
}

.pill-duty {
  color: var(--duty);
  background: var(--duty-bg);
  border-color: #a9c7ab;
}

.pill-asleep {
  color: var(--asleep);
  background: var(--asleep-bg);
  border-color: #b4b6d9;
}

.pill-waiting {
  color: var(--waiting);
  background: var(--waiting-bg);
  border-color: #dcc48e;
}

.pill-error {
  color: var(--error);
  background: var(--error-bg);
  border-color: #dba79e;
}

/* Hire badge: a staff card. */
.badge {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.badge:hover {
  border-color: var(--line-strong);
}

.badge-mark {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
}

.badge-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.badge-name {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.2;
}

.badge-role {
  color: var(--ink-soft);
  font-size: 15px;
}

.badge-body > .pill {
  align-self: flex-start;
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.badge-meta {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

/* Tables */
.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  font-size: 15px;
}

caption {
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 28px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

/* Prototype-only controls: visible, labelled, never part of the product. */
.proto-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 40px;
  background: #1c1b18;
  color: #d9d2c5;
  font-size: 13px;
  font-family: var(--font-mono);
}

.proto-bar a {
  color: #f7f3ec;
}

.proto-bar button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  background: transparent;
  color: #f7f3ec;
  border-color: #6b655c;
}

.proto-bar button:hover {
  background: #2e2c27;
}

@media (max-width: 880px) {
  .proto-bar,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 18px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.consent p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 52ch;
}
