/* ==========================================================================
   Siteplan — design system
   Inspired by Red Hat / OpenShift marketing language: flat surfaces, sharp
   corners, one strong red, hairline rules, oversized display type, generous
   whitespace, and diagrams that behave like technical drawings.
   ========================================================================== */

:root {
  --red: #ee0000;
  --red-strong: #be0000;
  --red-soft: #fdf2f2;
  --ink: #151515;
  --ink-soft: #3c3f42;
  --muted: #6a6e73;
  --line: #d2d2d2;
  --line-strong: #b8bbbe;
  --paper: #ffffff;
  --paper-2: #f4f4f4;
  --paper-3: #fafafa;
  --teal: #005f60;
  --teal-soft: #eef6f6;
  --gold: #c58c00;
  --display: "Red Hat Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: "Red Hat Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Red Hat Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --wrap: 1240px;
  --step: clamp(2.1rem, 4.6vw, 4.1rem);
}

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

html { scroll-behavior: smooth; }

section[id],
[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
a:hover { color: var(--red); text-decoration-color: var(--red); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 0.5em;
}

h1 { font-size: var(--step); }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.42rem); font-weight: 700; letter-spacing: -0.015em; }
h4 { font-size: 1.02rem; font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 0.08em 0.34em;
}

pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--ink);
  color: #f2f2f2;
  padding: 26px 26px 24px;
  overflow-x: auto;
  border-left: 4px solid var(--red);
  margin: 0;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 22%, var(--ink) 22% 100%);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px;
}

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.brand__mark { color: var(--ink); display: flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--display); font-size: 1.27rem; font-weight: 800; letter-spacing: -0.03em; }
.brand__sub { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.brand:hover .brand__name { color: var(--red); }

.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav__list { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-nav__link {
  position: relative; display: inline-block; padding: 8px 0;
  font-size: 0.94rem; font-weight: 500; text-decoration: none; color: var(--ink-soft);
}
.site-nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.18s ease;
}
.site-nav__link:hover { color: var(--ink); }
.site-nav__link:hover::after, .site-nav__link.is-active::after { transform: scaleX(1); }
.site-nav__link.is-active { color: var(--ink); font-weight: 700; }

.nav-toggle {
  display: none; align-items: center; gap: 10px; background: none; border: 0;
  padding: 8px; color: var(--ink); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.nav-toggle__bars { display: grid; gap: 4px; width: 22px; }
.nav-toggle__bars i { display: block; height: 2px; background: currentColor; }
.nav-toggle__label { font-family: var(--display); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 26px; border: 1px solid transparent;
  font-family: var(--display); font-size: 0.98rem; font-weight: 700; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn::after { content: "→"; font-family: var(--mono); font-weight: 400; transition: transform 0.16s ease; }
.btn:hover::after { transform: translateX(4px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-strong); color: #fff; }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: 10px 17px; font-size: 0.85rem; }
.btn--sm::after { display: none; }

/* ------------------------------------------------------------------ hero */

.hero { border-bottom: 1px solid var(--line); background: var(--paper); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 60px; align-items: center; padding-block: 78px 84px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--red);
  margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--red); }
.eyebrow--muted { color: var(--muted); }
.eyebrow--muted::before { background: var(--muted); }
.eyebrow--light { color: #ff8a8a; }
.eyebrow--light::before { background: var(--red); }

.hero h1 { max-width: 18ch; }
.hero__lede { font-size: clamp(1.06rem, 1.5vw, 1.22rem); color: var(--ink-soft); max-width: 52ch; margin-top: 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__note {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--muted); font-family: var(--mono); letter-spacing: 0.01em;
}

.hero--page .hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); padding-block: 66px 62px; align-items: end; }
.hero--page h1 { max-width: 22ch; }
.hero--page .hero__lede { max-width: 62ch; }

/* stat rail */
.rail { border-left: 1px solid var(--line); padding-left: 26px; display: grid; gap: 22px; }
.rail__item { }
.rail__num { font-family: var(--display); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rail__label { font-size: 0.78rem; color: var(--muted); margin-top: 5px; line-height: 1.4; }

/* --------------------------------------------------------------- diagram */

.diagram {
  border: 1px solid var(--line); background: var(--paper-3);
  box-shadow: 12px 12px 0 rgba(21, 21, 21, 0.055);
}
.diagram__bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.diagram__dot { width: 8px; height: 8px; background: var(--line-strong); }
.diagram__dot:first-child { background: var(--red); }
.diagram__title {
  margin-left: 6px; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.diagram__body { padding: 18px; }
.diagram__body svg { width: 100%; height: auto; }
.diagram__caption {
  border-top: 1px solid var(--line); padding: 11px 14px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; background: var(--paper);
}

/* --------------------------------------------------------------- sections */

.section { padding: 84px 0; }
.section--rule { border-top: 1px solid var(--line); }
.section--paper3 { background: var(--paper-3); }
.section--ink { background: var(--ink); color: #f0f0f0; }
.section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }
.section--ink a { color: #fff; text-decoration-color: rgba(255,255,255,0.4); }
.section--ink a:hover { color: #ff6b6b; text-decoration-color: #ff6b6b; }
.section--ink p { color: #cfcfcf; }
.section--ink .eyebrow { color: #ff8a8a; }

.section__head { max-width: 760px; margin-bottom: 46px; }
.section__head--wide { max-width: 920px; }
.section__head p { color: var(--muted); font-size: 1.06rem; margin-top: 16px; }
.section--ink .section__head p { color: #b8b8b8; }

.split {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px; align-items: start;
}
.split--end { align-items: end; }

/* ----------------------------------------------------------------- cards */

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--paper); padding: 30px 28px 32px;
  position: relative; transition: background 0.18s ease;
}
.card:hover { background: var(--paper-3); }
.card__index {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  color: var(--red); text-transform: uppercase; margin-bottom: 16px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card__rule { height: 3px; width: 34px; background: var(--red); margin: 0 0 20px; }

.card--link { display: block; text-decoration: none; color: inherit; }
.card--link::after {
  content: "Learn more →"; display: inline-block; margin-top: 18px;
  font-family: var(--display); font-size: 0.87rem; font-weight: 700; color: var(--red);
}
.card--link:hover { background: var(--red-soft); }

/* feature list with square bullets */
.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.marks li { position: relative; padding-left: 26px; color: var(--ink-soft); font-size: 0.97rem; }
.marks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 8px; background: var(--red);
}
.marks--teal li::before { background: var(--teal); }
.section--ink .marks li { color: #cfcfcf; }

/* principle rows */
.principles { border-top: 1px solid var(--line); }
.principle {
  display: grid; grid-template-columns: 64px minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 30px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.principle__num { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.1em; }
.principle h3 { margin: 0; }
.principle p { color: var(--muted); font-size: 0.94rem; margin: 0; }
.section--ink .principles, .section--ink .principle { border-color: rgba(255,255,255,0.16); }

/* quoted decision blocks */
.decision {
  border-left: 4px solid var(--red); background: var(--red-soft);
  padding: 24px 26px; font-size: 0.96rem; color: var(--ink-soft);
}
.decision strong { color: var(--ink); }
.decision--teal { border-color: var(--teal); background: var(--teal-soft); }

/* plain data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--paper); }
table.data th, table.data td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; background: var(--paper-2);
  border-bottom: 1px solid var(--line-strong);
}
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 600; white-space: nowrap; }
table.data code { font-size: 0.82em; }
.section--ink table.data { color: var(--ink); }
.section--ink table.data th { background: #232323; color: #b9b9b9; border-color: #3a3a3a; }
.section--ink table.data td { border-color: #ececec; }

/* step list */
.loop { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.loop__row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.15fr);
  background: var(--paper); align-items: start;
}
.loop__mark {
  padding: 24px 0 24px 22px; font-family: var(--display); font-weight: 800;
  font-size: 1.5rem; color: var(--red); line-height: 1;
}
.loop__title { padding: 22px 22px; font-family: var(--display); font-weight: 700; font-size: 1.02rem; }
.loop__body { padding: 22px 26px 24px 0; color: var(--muted); font-size: 0.93rem; }
.loop__body code { font-size: 0.82em; }

/* layered architecture illustration */
.layers { display: grid; gap: 10px; }
.layer {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px;
  border: 1px solid var(--line); background: var(--paper); padding: 16px 18px;
  align-items: center;
}
.layer__label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.layer__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 0.72rem; padding: 5px 10px;
  border: 1px solid var(--line-strong); color: var(--ink-soft); background: var(--paper-3);
}
.chip--red { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.chip--teal { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.layer--accent { border-left: 4px solid var(--red); }

/* pull quote */
.pull {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.3rem, 2.6vw, 1.95rem); line-height: 1.24;
  border-left: 5px solid var(--red); padding-left: 26px; margin: 0;
}
.pull cite { display: block; font-family: var(--mono); font-style: normal; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 18px; }

/* callout band */
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.band__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 36px; flex-wrap: wrap; }
.band h2 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); margin: 0; max-width: 30ch; }
.band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- footer */

.site-footer { background: var(--ink); color: #cfcfcf; padding: 60px 0 34px; }
.site-footer a { color: #fff; text-decoration-color: rgba(255,255,255,0.3); }
.site-footer a:hover { color: #ff8080; text-decoration-color: #ff8080; }
.footer__top { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.85fr)); gap: 48px; padding-bottom: 42px; border-bottom: 1px solid rgba(255,255,255,0.16); }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__sub { color: #8d8d8d; }
.footer__blurb { margin-top: 18px; font-size: 0.9rem; color: #a8a8a8; max-width: 40ch; }
.footer__label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8d8d8d; margin-bottom: 14px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 0.9rem; }
.footer__bottom { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; padding-top: 22px; font-size: 0.78rem; color: #8d8d8d; }
.footer__bottom .accent { color: var(--red); }

/* ----------------------------------------------------------------- misc */

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.mb0 { margin-bottom: 0; }
.stack > * + * { margin-top: 24px; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero__grid, .hero--page .hero__grid { grid-template-columns: 1fr; gap: 44px; padding-block: 56px 60px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .rail { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px 28px 22px; display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__link { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .site-nav__link::after { display: none; }
  .site-nav__cta { margin-top: 16px; justify-content: center; }
  .grid--3 { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 44px 1fr; gap: 16px; }
  .principle p { grid-column: 2; }
  .loop__row { grid-template-columns: 56px 1fr; }
  .loop__body { grid-column: 1 / -1; padding: 0 24px 22px 56px; }
  .layer { grid-template-columns: 1fr; gap: 10px; }
  .section { padding: 60px 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .grid--2, .grid--4 { grid-template-columns: 1fr; }
  .rail { grid-template-columns: 1fr; gap: 16px; }
  .hero__actions .btn, .band__actions .btn { width: 100%; justify-content: center; }
  .footer__top { grid-template-columns: 1fr; gap: 32px; }
  .brand__sub { display: none; }
  table.data { font-size: 0.84rem; }
  table.data th, table.data td { padding: 11px 12px; }
}

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