/* ==========================================================================
   BYOStack — byostack.ai
   Brand system per BYOStack Brand Guidelines V1.0 (July 2026)
   Palette and usage rules are locked. Flat color only — no gradients,
   glows, shadows, or 3D. Gold marks the brand; vermilion marks interaction.
   Never both on one element. Vermilion never enters a figure.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Spectral-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Spectral-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Spectral-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Spectral-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

/* ---------- Tokens (locked) ---------- */

:root {
  --field: #F6F4EF;        /* primary cream background */
  --card: #FBFAF6;         /* panel / card surfaces */
  --hairline: #D7D3CA;     /* borders, rules, dividers */
  --secondary: #B7A287;    /* muted tan accents */
  --gold: #A07A54;         /* brand accent — never an interaction cue */
  --vermilion: #C8451B;    /* interaction only — the sole saturated color */
  --ink: #1C1A17;          /* body type, wordmark, dark ground */
  --ink-muted: rgba(28, 26, 23, 0.75);
  --ink-caption: rgba(28, 26, 23, 0.5);
  --cream-on-dark: #F6F4EF;
  --cream-on-dark-muted: rgba(246, 244, 239, 0.72);

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 42rem;        /* ~672px reading measure */
  --gutter: 1.5rem;
}

/* ---------- Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1875rem;      /* 19px */
  line-height: 1.68;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Interaction (vermilion only) ---------- */

a {
  color: var(--vermilion);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

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

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

/* ---------- Type scale ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.35rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }
strong { font-weight: 600; }

ul {
  margin: 0 0 1.35rem;
  padding-left: 1.25rem;
}
li { margin-bottom: 0.65rem; }
li:last-child { margin-bottom: 0; }
li::marker { color: var(--gold); }

/* The single sanctioned accent word — vermilion, italic (type specimen register) */
.accent-word {
  color: var(--vermilion);
  font-style: italic;
}

/* ---------- Mono utility register (tracked caps, always) ---------- */

.mono-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Section eyebrows — gold brand accent, per guidelines section labels */
.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 1.1rem;
}

/* ---------- Buttons (vermilion = interaction; mono tracked caps) ---------- */

.btn {
  display: inline-block;
  background: var(--vermilion);
  color: var(--field);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  padding: 1.05rem 1.7rem;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.btn:hover { background: #B03D17; text-decoration: none; }
.btn:focus-visible { outline-color: var(--ink); }

.btn-annot {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-caption);
  margin-left: 1.1rem;
  white-space: nowrap;
}

.mono-link {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--vermilion);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* ---------- Layout ---------- */

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

.wrap-wide {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--field);
}
.site-header .bar {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .lockup img { height: 40px; width: auto; }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.site-header nav a.nav-link {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
}
.site-header nav a.nav-link:hover { color: var(--ink); }
.site-header nav .btn {
  padding: 0.7rem 1.15rem;
  font-size: 0.7rem;
}

@media (max-width: 640px) {
  .site-header .lockup img { height: 32px; }
  .site-header nav { gap: 1rem; }
  .site-header nav .nav-link-secondary { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 5.5rem 0 4.5rem;
}
.hero .hero-sub {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 0 0 1.9rem;
  text-wrap: balance;
}
.hero .lede p {
  font-size: 1.25rem;
  color: var(--ink-muted);
}
.hero .cta-row {
  margin-top: 2.6rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 1rem;
}

@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem; }
}

/* ---------- Sections ---------- */

.section {
  padding: 4.25rem 0;
  border-top: 1px solid var(--hairline);
}

.section-note {
  font-style: italic;
  color: var(--ink-muted);
  border-left: 2px solid var(--gold);
  padding-left: 1.35rem;
  margin-top: 2.4rem;
}

/* ---------- Cards (is / is NOT panels) ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 2rem 2.1rem;
}
.card + .card { margin-top: 1.4rem; }
.card .mono-label { color: var(--gold); display: block; margin-bottom: 1rem; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 2.2rem;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}
.two-col .card + .card { margin-top: 0; }

/* ---------- Accessibility skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--field);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.7rem 1.1rem;
  z-index: 10;
}
.skip-link:focus-visible {
  left: 0;
  outline-offset: -2px;
}

/* ---------- Card headings (Fit section) ---------- */

.card h2.card-head {
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
}

/* ---------- Component list (How it works) ---------- */

.component-list {
  list-style: none;
  padding: 0;
  margin: 2.2rem 0;
  border-top: 1px solid var(--hairline);
}
.component-list li {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--hairline);
  margin: 0;
}
.component-list .component-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------- Figure register (technical-book treatment) ----------
   Figures stay cream, gold, and charcoal. The interaction color
   never enters a figure. */

.figure {
  border: 1px solid var(--hairline);
  background: var(--card);
  margin: 2.6rem 0 0;
  padding: 0;
}
.figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
}
.figure figcaption .fig-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.figure .fig-body { padding: 1.5rem; }
.figure img { margin: 0 auto; }

/* ---------- Price block ---------- */

.price-line {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 1.1rem;
}

/* ---------- About ---------- */

.about-links {
  margin-top: 1.6rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ---------- Forms (/scale) ---------- */

.form-page { padding: 4.5rem 0 5rem; }

.field {
  margin-bottom: 1.9rem;
}
.field label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  margin-bottom: 0.6rem;
}
.field .helper {
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-muted);
  margin: 0.55rem 0 0;
}
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0.85rem 1rem;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231C1A17' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.6rem;
}
.field textarea { min-height: 10.5rem; resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 0;
  border-color: var(--vermilion);
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Placeholder pages ---------- */

.placeholder-page { padding: 5.5rem 0 6rem; }

/* ---------- Footer (dark ground — cream lockup, gold links,
   vermilion interaction, per guidelines In Context) ---------- */

.site-footer {
  background: var(--ink);
  color: var(--cream-on-dark);
  margin-top: 5rem;
  padding: 3.6rem 0;
}
.site-footer .inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-footer .top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-footer .lockup img { height: 44px; width: auto; }
.site-footer .footer-links {
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.site-footer .footer-links a {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.site-footer .footer-links a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.site-footer .base-row {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(246, 244, 239, 0.18);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer .base-row .mono-label { color: var(--cream-on-dark-muted); }

/* ---------- Small print ---------- */

.caption {
  font-size: 0.95rem;
  color: var(--ink-caption);
}

/* ---------- Utility spacing (replaces inline styles for strict CSP) ---------- */

.u-return { margin-top: 2.6rem; }
.cta-row-tight { margin-top: 2.2rem; }
.form-start { margin-top: 3rem; }

/* ---------- Inline figure SVG (inherits the page's self-hosted fonts) ---------- */

.figure .fig-body svg { width: 100%; height: auto; display: block; }
.figure .fig-body { padding: 0.75rem; }
