/*
 * Sourcerer — static landing page for GitHub Pages.
 * Mirrors the Flutter landing page (lib/widgets/herdr_style.dart tokens):
 * dark ground over a hairline grid, a bordered frame, square corners,
 * 1px rules, tightly tracked display type, mono labels, one blue "spot".
 */

:root {
  --bg: #353535;
  --panel: #2d2d2d;
  --mass: #424242;
  --ink: #ededed;
  --dim: #d2d2d2;
  --faint: #b8b8b8;
  --faint2: #a3a3a3;
  --line: #3f3f3f;
  --line2: #4f4f4f;
  --spot: #78d0e8;
  --spot-hover: #8fd8ec;
  --spot-ink: #2d2d2d;
  --grid: #3b3b3b;

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: 34px;
  --header-h: 56px;
  color-scheme: dark;
}

@media (max-width: 899px) {
  :root { --gutter: 20px; }
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  color: var(--dim);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--spot); outline-offset: 2px; }

.frame {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg);
  border-left: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
}

/* ---------- shared type ---------- */

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}

.accent { color: var(--spot); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--spot);
  margin: 0 0 24px;
}
.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--spot);
  flex: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.4;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--spot); border-color: var(--spot); color: var(--spot-ink); }

.btn--solid { background: var(--spot); border-color: var(--spot); color: var(--spot-ink); }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.btn--block { display: flex; width: 100%; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line2);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  transition: color .12s;
}
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand:hover { color: var(--spot); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav-link { color: var(--dim); padding: 8px 0; transition: color .12s; }
.nav-link:hover { color: var(--spot); }

@media (max-width: 899px) {
  :root { --header-h: 112px; }
  .site-header__inner {
    height: auto;
    padding-top: 16px;
    padding-bottom: 12px;
    flex-wrap: wrap;
    row-gap: 10px;
    gap: 8px 20px;
  }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 20px; }
}

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

.hero { position: relative; overflow: hidden; }
.hero__mark {
  position: absolute;
  top: 50%;
  right: calc(-14vw + 0px);
  width: clamp(280px, 62vw, 880px);
  height: auto;
  transform: translate(14%, -50%);
  pointer-events: none;
  color: var(--mass);
}
@media (min-width: 1440px) { .hero__mark { right: -200px; transform: translate(0, -50%); } }

.hero__body {
  position: relative;
  padding: 68px var(--gutter) 56px;
}
@media (max-width: 899px) { .hero__body { padding-top: 60px; padding-bottom: 52px; } }

.hero__title {
  font-size: clamp(38px, 6.6vw, 132px);
  max-width: 11em;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero__lede {
  max-width: 640px;
  margin: 32px 0 0;
  font-size: 16px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 38px;
}

.command {
  display: inline-flex;
  align-items: stretch;
  background: var(--spot);
  border: 1px solid var(--spot);
  color: var(--spot-ink);
  font-family: var(--font-mono);
  transition: background-color .12s;
}
.command:hover { background: var(--spot-hover); }
.command__prompt { padding: 14px 19px; font-size: 13.5px; line-height: 1.4; }
.command__prompt span { opacity: .6; margin-right: .6em; }
.command__cta {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-left: 1px solid rgba(45, 45, 45, .25);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.hero__platforms {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ---------- stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.stat { padding: 24px var(--gutter) 26px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}
.stat__label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: rgba(120, 208, 232, .85);
  flex: none;
}

/* ---------- feature tour ---------- */

.tour { border-bottom: 1px solid var(--line2); }
.tour__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 40px var(--gutter) 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--faint);
  margin: 0;
}
.tour__caption b { font-weight: 400; color: var(--spot); letter-spacing: 0.1em; margin-right: 1.4em; }
@media (max-width: 899px) { .tour__caption { padding-top: 26px; } }

.tour__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.feature {
  display: grid;
  grid-template-columns: 130px minmax(0, 4fr) minmax(0, 5fr);
  gap: 40px;
  align-items: center;
  padding: 26px var(--gutter);
  border-bottom: 1px solid var(--line);
  transition: background-color .12s;
}
.feature:last-child { border-bottom: 0; }
.feature:hover { background: rgba(120, 208, 232, .04); }

.feature__num { align-self: start; }
.feature__num strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--mass);
  transition: color .12s;
}
.feature:hover .feature__num strong { color: var(--line2); }
.feature__num span {
  display: block;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.feature__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 9px;
  transition: color .12s;
}
.feature__title::after {
  content: "→";
  display: inline-block;
  margin-left: 4px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  color: var(--faint);
  transition: margin .12s, color .12s;
}
.feature:hover .feature__title { color: var(--spot); }
.feature:hover .feature__title::after { margin-left: 8px; color: var(--spot); }

.feature__text { max-width: 560px; font-size: 14.5px; line-height: 1.7; }
.feature__text p { margin: 0 0 1em; }
.feature__text ul { margin: 0; padding: 0; list-style: none; }
.feature__text li { position: relative; padding-left: 1.1em; margin-bottom: .25em; }
.feature__text li::before { content: "•"; position: absolute; left: 0; color: var(--spot); }
.feature__text li b { color: var(--ink); font-weight: 600; }

.shot {
  justify-self: end;
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line2);
  text-align: left;
  cursor: zoom-in;
  transition: border-color .12s;
}
.feature:hover .shot { border-color: var(--spot); }
.shot__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.shot__bar span:first-child { color: var(--dim); letter-spacing: 0.16em; text-transform: uppercase; }
.shot__bar span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot img { width: 100%; height: auto; }

@media (max-width: 899px) {
  .feature {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 20px 18px;
    align-items: start;
  }
  .feature__num strong { font-size: 30px; }
  .shot { grid-column: 2; justify-self: stretch; }
}

/* ---------- lightbox ---------- */

.lightbox {
  border: 0;
  padding: 24px;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  background: transparent;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-out; }
.lightbox__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

/* ---------- download ---------- */

.download { position: relative; overflow: hidden; border-bottom: 1px solid var(--line2); }
.download__mark {
  position: absolute;
  right: -2%;
  bottom: 0;
  width: clamp(260px, 54vw, 560px);
  transform: translate(6%, 22%);
  color: var(--mass);
  pointer-events: none;
}
.download__body { position: relative; padding: 96px var(--gutter) 104px; }
@media (max-width: 899px) { .download__body { padding-top: 56px; padding-bottom: 64px; } }
.download__title {
  font-size: clamp(36px, 5.4vw, 70px);
  letter-spacing: -0.05em;
  line-height: 0.93;
}
.download__lede { max-width: 560px; margin: 20px 0 40px; font-size: 15px; line-height: 1.75; }

.platforms { display: flex; flex-wrap: wrap; gap: 22px 14px; }
.platform {
  position: relative;
  flex: 1 1 260px;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line2);
  transition: background-color .12s, border-color .12s;
}
@media (max-width: 899px) { .platform { max-width: none; flex-basis: 100%; } }
.platform:hover { background: #303637; border-color: var(--spot); }
.platform:hover .platform__name { color: var(--spot); }
.platform__bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.platform__bar span:first-child { color: var(--dim); letter-spacing: 0.16em; text-transform: uppercase; }
.platform__body { padding: 22px; }
.platform__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
  transition: color .12s;
}
.platform__desc { margin: 10px 0 24px; font-family: var(--font-mono); font-size: 12.5px; color: var(--dim); }

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

.site-footer { border-top: 1px solid var(--line2); }
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  padding: 64px var(--gutter);
}
.footer__brand .brand { font-size: 22px; }
.footer__brand .brand img { width: 32px; height: 32px; }
.footer__brand p { max-width: 340px; margin: 18px 0 0; font-size: 14px; color: var(--faint); }
.footer__heading {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--spot);
}
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 12px; font-size: 14px; line-height: 1.4; }
.footer__links a { color: var(--dim); transition: color .12s; }
.footer__links a:hover { color: var(--spot); }
.footer__bottom {
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint2);
}
@media (max-width: 899px) {
  .footer__grid { grid-template-columns: 1fr; gap: 28px; padding: 40px var(--gutter); }
  .footer__brand { margin-bottom: 8px; }
  .footer__bottom { text-align: center; }
}
