/* ==========================================================================
   Blackstarts — blackstarts.com
   One stylesheet. Tokens first, then base, layout, sections, motion.
   ========================================================================== */

/* ---- Fonts (self-hosted, latin subset, variable) ----------------------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 300 700;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #050506;
  --bg-raised: #0b0b0d;
  --bg-tile: #0c0c0e;
  --fg: #ededea;
  --fg-strong: #ffffff;
  --grey: #8c8c87;
  --grey-2: #a3a39e;
  --line: #1a1a1d;
  --line-2: #2a2a2e;
  /* Input border: lifted from the reference's #3A3A3F to meet 3:1 non-text contrast. */
  --field-line: #6a6a6f;
  --accent: #e5484d;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1320px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 120px);

  --fs-h1: clamp(40px, 6.2vw, 88px);
  --fs-h2: clamp(32px, 3.8vw, 54px);
  --fs-cta: clamp(40px, 5vw, 72px);
  --fs-stat: clamp(44px, 4.2vw, 56px);
  --fs-label: 12px;
  --fs-label-sm: 11px;

  --track-label: 0.2em;
  --track-meta: 0.14em;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--fg);
}
a:hover {
  color: var(--fg-strong);
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

::selection {
  background: var(--accent);
  color: var(--fg-strong);
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: var(--fs-label);
  letter-spacing: var(--track-meta);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  color: var(--bg);
}

/* ---- Layout primitives ------------------------------------------------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

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

/* ---- Type ---------------------------------------------------------------- */
.label {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--grey);
}
.label--sm {
  font-size: var(--fs-label-sm);
}

.h1,
.h2,
.h3 {
  font-family: var(--font-display);
  font-weight: 400;
}
.h1 {
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.h2 {
  font-size: var(--fs-h2);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.h3 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--grey-2);
  max-width: 560px;
}
.body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--grey-2);
}

/* ---- Nav ----------------------------------------------------------------- */
/* The header overlays the hero so the hero (and its H1) can live inside <main>. */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
:root {
  --nav-h: 100px; /* 28px + 44px button + 28px */
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.wordmark {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: var(--track-label);
  white-space: nowrap;
  text-decoration: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}
.btn-outline:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__copy {
  position: relative;
  gap: 24px;
  padding-top: calc(var(--nav-h) + 56px);
}
.hero__media {
  position: relative;
  padding-top: 48px;
}
.hero__figure {
  position: relative;
  margin: 0;
}
.hero__img {
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 1049;
  object-fit: cover;
}

.corner {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.corner--tl { top: 20px; left: 24px; }
.corner--tr { top: 20px; right: 24px; }
.corner--bl { bottom: 20px; left: 24px; }
.corner--br { bottom: 20px; right: 24px; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgb(229 72 77 / 0.5);
}

/* ---- Scenarios ----------------------------------------------------------- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.scenarios {
  gap: 40px;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tile {
  display: flex;
  flex-direction: column;
}
.tile__art {
  width: 100%;
  height: clamp(260px, 36vw, 480px);
}
.tile__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.tile__name {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--track-meta);
  text-transform: uppercase;
}
.tile__num {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 12px;
  color: var(--grey);
}

/* ---- System -------------------------------------------------------------- */
.system {
  position: relative;
  overflow: hidden;
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.system__head {
  gap: 16px;
  padding-top: var(--section-y);
}
.system__head .lede {
  font-size: 18px;
}
.system__body {
  gap: 48px;
  padding-top: 56px;
  padding-bottom: var(--section-y);
}
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card__media {
  position: relative;
  margin: 0;
}
.card__img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.card__num {
  position: absolute;
  top: 16px;
  left: 18px;
}
.card__tag {
  position: absolute;
  bottom: 16px;
  left: 18px;
  color: var(--fg);
}
.card__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vdi {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
}

/* ---- Stats --------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 24px;
  margin: 0;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 0;
  border-top: 1px solid var(--line-2);
}
.stat__value {
  order: -1;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.stat__label {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 12px;
  letter-spacing: var(--track-meta);
  text-transform: uppercase;
  color: var(--grey);
}

/* ---- Contact ------------------------------------------------------------- */
.contact {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
}
.contact__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.contact__inner {
  position: relative;
  gap: 40px;
  padding-top: clamp(80px, 12vw, 144px);
  padding-bottom: clamp(80px, 12vw, 144px);
}
.contact__title {
  font-size: var(--fs-cta);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.form {
  max-width: 620px;
}
.form__row {
  display: flex;
  flex-wrap: wrap;
}
.form__input {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--field-line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.form__input::placeholder {
  color: var(--grey);
  opacity: 1;
}
.form__input:hover {
  border-color: var(--grey);
}
.form__input:focus-visible {
  outline-offset: -2px;
  border-color: var(--fg);
}
.form__input[aria-invalid="true"] {
  border-color: var(--accent);
}

.btn-solid {
  flex: 1 1 180px;
  min-height: 58px;
  padding: 0 30px;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.btn-solid:hover {
  background: var(--fg-strong);
}
.btn-solid:disabled {
  cursor: progress;
  opacity: 0.6;
}

.form__status {
  min-height: 1.6em;
  margin-top: 12px;
  font-size: 14px;
  color: var(--grey-2);
}
.form__status[data-state="success"] {
  color: var(--fg);
}
.form__status[data-state="error"] {
  color: var(--accent);
}

/* Honeypot: off-screen, never visible or focusable. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Footer -------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 12px;
  letter-spacing: var(--track-meta);
  /* Reference used #6E6E69 (3.9:1); --grey keeps 12px text above 4.5:1. */
  color: var(--grey);
}

/* ---- 404 ----------------------------------------------------------------- */
.notfound {
  min-height: 70vh;
  justify-content: center;
  gap: 24px;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 479px) {
  .corner--tl,
  .corner--tr { top: 12px; }
  .corner--bl,
  .corner--br { bottom: 12px; }
  .corner--tl,
  .corner--bl { left: 12px; }
  .corner--tr,
  .corner--br { right: 12px; }
  .corner { font-size: 10px; letter-spacing: 0.16em; }
  .lede { font-size: 17px; }
}

@media (min-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: system cards read as rows, image beside text. */
@media (min-width: 640px) and (max-width: 959px) {
  .card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 24px;
  }
}

@media (min-width: 720px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
  .vdi {
    grid-template-columns: 1fr 2fr;
  }
}

@media (min-width: 960px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- Motion -------------------------------------------------------------- */
@keyframes bs-pulse {
  0%   { box-shadow: 0 0 0 0 rgb(229 72 77 / 0.55); opacity: 1; }
  70%  { box-shadow: 0 0 0 7px rgb(229 72 77 / 0); opacity: 0.75; }
  100% { box-shadow: 0 0 0 0 rgb(229 72 77 / 0); opacity: 1; }
}
.status-dot {
  animation: bs-pulse 2.6s ease-out infinite;
}

/* Reveal only engages once main.js marks the document, so no-JS stays visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---- Scenario one-liners --------------------------------------------- */
.tile__desc {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--grey-2);
  max-width: 34ch;
}

/* ---- FAQ ------------------------------------------------------------- */
.faq {
  border-top: 1px solid var(--line);
}
.faq__inner {
  gap: 48px;
}
.faq__head {
  gap: 16px;
}
.faq__list {
  margin: 0;
  border-bottom: 1px solid var(--line-2);
}
.faq__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line-2);
}
.faq__q {
  font-size: 22px;
}
.faq__a {
  margin: 0;
  max-width: 68ch;
}
@media (min-width: 900px) {
  .faq__item {
    grid-template-columns: 5fr 7fr;
  }
}
