/* Cast from Clay brand layer, shared by every page.
   Palette, type and component shapes are taken from castfromclay.co.uk:
   near-black ink on white, Lexend for display, IBM Plex Serif for text,
   square outlined uppercase buttons, and rounded panels with one sharp corner. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Lexend:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #0F0801;
  --paper: #ffffff;
  --paper-2: #F7F4EF;          /* warm off-white for quiet surfaces */
  --paper-3: #EFEAE2;
  --line: rgba(15, 8, 1, 0.14);
  --line-strong: #0F0801;
  --muted: rgba(15, 8, 1, 0.62);
  --purple: #4F3BD4;
  --purple-soft: rgba(79, 59, 212, 0.08);
  --amber: #F4B840;
  --coral: #E56572;
  --coral-ink: #C23B4A;         /* coral dark enough to read as text on white */
  --green: #1E9E5D;
  --warn-ink: #A86F00;

  --font-display: "Lexend", system-ui, sans-serif;
  --font-text: "IBM Plex Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 20px;
  --shadow: 0 1px 0 rgba(15, 8, 1, 0.04), 0 12px 32px -18px rgba(15, 8, 1, 0.25);

  /* Legacy names the page styles still reference. */
  --bg: var(--paper);
  --panel: var(--paper);
  --border: var(--line);
  --text: var(--ink);
  --accent: var(--purple);
  --card: var(--paper);
  --danger: var(--coral-ink);
  --ok: var(--green);
  --warn: var(--warn-ink);
}

* { box-sizing: border-box; }

html { scrollbar-width: thin; scrollbar-color: var(--ink) var(--paper-3); }

body {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 400;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--amber); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }

a { color: var(--purple); }

/* ---------- Top bar ---------- */
.brand-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 48px; height: 48px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple);
}
.brand-text h1 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.session-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
/* The site's button: uppercase serif, wide tracking, 1px ink border, square. */
.icon-btn, a.icon-btn, button.icon-btn,
.primary, a.primary, button.primary, span.primary,
button.danger, .sync-btn {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 0;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}

.icon-btn, a.icon-btn, button.icon-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.icon-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.primary, a.primary, button.primary, span.primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.primary:hover:not(:disabled) { background: var(--purple); border-color: var(--purple); }
.primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* The long thin arrow that trails the site's buttons. */
.arrow {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 9px;
  flex: none;
  transition: width .2s ease;
}
.arrow::before {
  content: "";
  position: absolute;
  left: 0; right: 1px; top: 50%;
  height: 1px;
  background: currentColor;
}
.arrow::after {
  content: "";
  position: absolute;
  right: 1px; top: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
*:hover > .arrow { width: 38px; }

button.danger {
  background: transparent;
  border: 1px solid var(--coral);
  color: var(--coral-ink);
  padding: 6px 12px;
}
button.danger:hover { background: var(--coral); border-color: var(--coral); color: var(--paper); }

/* ---------- Form fields ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  font-family: var(--font-text);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 9px 12px;
}
input::placeholder { color: rgba(15, 8, 1, 0.45); font-style: italic; }
input:focus, select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft), inset 0 0 0 1px var(--purple);
}
select {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  font-size: 14px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- Tags ---------- */
/* Like the site's "#STRATEGY" chips: square, outlined, spaced caps. */
.badge {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 2px 7px;
  white-space: nowrap;
}
.badge.admin { color: var(--purple); border-color: var(--purple); }

code, pre { font-family: var(--font-mono); }

@media (max-width: 640px) {
  .brand-header { padding: 12px 16px; }
  .brand img { width: 40px; height: 40px; }
  .brand-text h1 { font-size: 17px; }
}
