/* The Tracfox Blog — light editorial theme, brand tokens carried from the product design system */
:root {
  --wash: #f7f5f2;
  --paper: #ffffff;
  --ink: #23211d;
  --body: #4c4842;
  --muted: #8b857b;
  --hairline: #e8e4dd;
  --divider: #d9d4cb;
  --orange: #ff7700;
  --link: #c65102;
  --success: #008a06;
  /* dark island tokens: figures keep the product terminal look */
  --d-panel: #3b3b3b;
  --d-hairline: #4a4a4a;
  --d-divider: #666666;
  --d-text: #f5f5f5;
  --d-body: #cccccc;
  --d-muted: #aaaaaa;
  --d-orange: #ff9500;
  --d-success: #00ad07;
  --mono: 'Spline Sans Mono', monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wash);
  font-family: Archivo, system-ui, sans-serif;
  color: var(--ink);
}

::selection { background: var(--orange); color: #fff; }

a { color: var(--link); transition: color 0.2s ease-in-out; }
a:hover { color: var(--orange); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

img { max-width: 100%; }

.container {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

main.container { flex: 1; padding-bottom: clamp(48px, 7vw, 96px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--wash) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.masthead-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.masthead-link img { width: 34px; height: 34px; }

.masthead-word {
  font-weight: 800;
  font-stretch: 122%;
  font-size: clamp(17px, 2.2vw, 20px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 26px);
  flex-wrap: wrap;
}

.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-family: Archivo, system-ui, sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
.btn-primary:hover { background: #e56a00; color: #fff; }
.btn-primary--lg { font-size: 16px; padding: 14px 26px; }

/* ---------- Type helpers ---------- */

.kicker {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.p { font-size: clamp(15.5px, 1.6vw, 17px); line-height: 1.7; color: var(--body); margin: 0; }

/* ---------- Blog home ---------- */

.home-masthead {
  padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-title {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  font-size: clamp(34px, 6.5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.home-sub { max-width: 56ch; }

.featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.featured:hover { border-color: var(--divider); box-shadow: 0 10px 30px rgba(35, 33, 29, 0.07); color: var(--ink); }

.featured-art {
  background: var(--d-panel);
  display: flex;
  align-items: center;
  padding: clamp(20px, 3vw, 36px);
}
.featured-art svg { display: block; width: 100%; height: auto; }

.featured-body {
  padding: clamp(22px, 3.5vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--link);
  background: color-mix(in srgb, var(--orange) 9%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--orange) 28%, var(--paper));
  border-radius: 999px;
  padding: 5px 11px;
}

.featured-title {
  margin: 0;
  font-weight: 900;
  font-stretch: 120%;
  text-transform: uppercase;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.005em;
}

.featured-excerpt { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }

.byline {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding-top: 6px;
}

.byline img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.byline-name { font-size: 14px; font-weight: 600; line-height: 1.3; }

.byline-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.read-cue { font-weight: 700; font-size: 14.5px; color: var(--link); }
.featured:hover .read-cue { color: var(--orange); }

/* Secondary strip under the featured post */

.home-strip {
  margin-top: clamp(20px, 3vw, 32px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.strip-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: clamp(18px, 2.5vw, 26px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.strip-card h2, .strip-card-h {
  margin: 0;
  font-weight: 800;
  font-stretch: 118%;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.strip-card .p { font-size: 15px; }

/* ---------- Post page ---------- */

.post-main { width: min(760px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.post-head {
  padding-top: clamp(28px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-back {
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--muted);
}
.post-back:hover { color: var(--link); }

.post-title {
  margin: 0;
  font-weight: 900;
  font-stretch: 122%;
  text-transform: uppercase;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.005em;
}

.post-cover { margin-top: clamp(20px, 3.5vw, 36px); }
.post-cover svg { display: block; width: 100%; height: auto; border-radius: 12px; }

.post-body { padding-top: clamp(8px, 2vw, 16px); }

.post-body .p {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.75;
  margin: 0 0 1.25em;
}

.post-body strong { color: var(--ink); }

.post-h2 {
  margin: 1.7em 0 0.6em;
  font-weight: 800;
  font-stretch: 118%;
  text-transform: uppercase;
  font-size: clamp(19px, 2.2vw, 23px);
  letter-spacing: 0.01em;
}

/* ---------- Dark figure islands (ported from the product site) ---------- */

.loop-panel {
  background: var(--d-panel);
  border: 1px solid var(--d-divider);
  border-radius: 12px;
  padding: clamp(16px, 2.5vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 26px;
}

.posture-head {
  display: flex;
  justify-content: space-between;
  column-gap: 12px;
  row-gap: 3px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--d-muted);
  text-transform: uppercase;
}
.posture-head span { white-space: nowrap; }

.flow { display: flex; flex-direction: column; gap: 9px; padding: 8px 0 6px; }

.flow-track { position: relative; height: 12px; margin-top: 14px; }

.flow-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--d-divider);
}

.flow-node {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--d-orange);
  background: var(--d-panel);
  transform: translate(-50%, -50%);
}
.flow-node--start { left: 0; transform: translateY(-50%); }
.flow-node--50 { left: 50%; }
.flow-node--end { left: auto; right: 0; transform: translateY(-50%); }

.flow-pulse {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 119, 0, 0.9);
  animation: loopPG 7s ease-in-out infinite;
}

/* generator <-> evaluator: pulse ping-pongs on the right half of the track */
@keyframes loopPG {
  0% { left: 0%; }
  28% { left: calc(50% - 5px); }
  48% { left: calc(100% - 10px); }
  68% { left: calc(50% - 5px); }
  88%, 100% { left: calc(100% - 10px); }
}

.loop-biarrow {
  position: absolute;
  left: 75%;
  top: -16px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  color: var(--d-orange);
}

.flow-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--d-muted);
  text-transform: uppercase;
}
.flow-labels .accent { color: var(--d-orange); }

.loop-outcomes {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--d-hairline);
  padding-top: 11px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.5;
  color: var(--d-body);
}

.pv-o { color: var(--d-orange); }

.pv-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--d-text); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--d-success);
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .flow-pulse { animation: none; left: calc(100% - 10px); }
}

/* ---------- Team page ---------- */

.page-intro {
  padding: clamp(32px, 5.5vw, 64px) 0 clamp(22px, 3.5vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.page-title {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  font-size: clamp(30px, 5.5vw, 54px);
  line-height: 1;
  letter-spacing: -0.01em;
}

.page-title--sm { font-size: clamp(22px, 3.4vw, 34px); }

.section {
  margin-top: clamp(28px, 4.5vw, 52px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 20px);
}

.section > .p { max-width: 72ch; }

.lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(12px, 1.8vw, 18px);
}

.lead-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 16px;
}

.lead-card .photo {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
}

.lead-id { min-width: 0; }

.lead-name { margin: 0; font-size: 17px; font-weight: 800; font-stretch: 115%; }

.lead-role {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Demo page ---------- */

.demo-main { width: min(720px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.demo-form {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: clamp(20px, 3.5vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.demo-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px 18px;
}

.demo-field { display: flex; flex-direction: column; gap: 6px; }
.demo-field--wide { grid-column: 1 / -1; }

.demo-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-input {
  font-family: Archivo, system-ui, sans-serif;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--wash);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 11px 12px;
}
.demo-input:focus { border-color: var(--orange); }

.demo-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.demo-submit:disabled { opacity: 0.55; cursor: default; }

.demo-status { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.demo-status--ok { color: var(--success); }
.demo-status--err { color: var(--link); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--hairline); background: var(--paper); }

.footer-inner {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
}

.footer-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.footer-brand img { width: 26px; height: 26px; }
.footer-brand span { font-weight: 800; font-stretch: 122%; font-size: 15px; }

.footer-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
  flex-wrap: wrap;
}

.footer-link { font-size: 13.5px; color: var(--body); text-decoration: none; }
.footer-link:hover { color: var(--ink); }

.footer-copy { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
