/* Data for Socialism — homepage styles.
   Color-and-type only: no illustrations or icons live in this file. Palette
   is a DSA-inspired red / black / white; swap the values in :root to retune
   the whole site. */

:root {
  --red: #d71920;
  --red-dark: #b5121b;
  --black: #111111;
  --ink: #1a1a1a;
  --muted: #555555;
  --paper: #ffffff;
  --wash: #f4f4f4;
  --line: #dcdcdc;

  /* Party colours for values in reports: a Democratic figure (D+41.5, a Democratic
     share) is blue, a Republican one (R+4.0) red. The same blue / red the district map
     uses. Kept apart from the brand red above so a score or a link never reads as a party. */
  --dem: #2563eb;
  --rep: #dc2626;

  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --wrap: 1120px;
  --wrap-wide: 1240px;

  /* Tokens the app pages (hub, dossier, map) are written against, mapped onto
     the brand palette above. */
  --bg: var(--wash);
  --surface: var(--paper);
  --border: var(--line);
  --border-strong: var(--black);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--red);
  --accent-hover: var(--red-dark);
  --accent-soft: #fbe9e9;
  --danger: #8f1017;
  --danger-soft: #fdeeec;
  --radius: 0;
  --shadow: 4px 4px 0 rgba(17, 17, 17, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* keep anchored sections clear of the sticky bar */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* Author display rules (.btn, .tool, ...) would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

/* A value that belongs to a party: Democratic blue / Republican red. */
.is-dem {
  color: var(--dem);
}
.is-rep {
  color: var(--rep);
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--black);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}
.hero :focus-visible,
.cta :focus-visible,
.footer :focus-visible {
  outline-color: var(--paper);
}

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

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.btn--red {
  background: var(--red);
  color: var(--paper);
  border-color: var(--red);
}
.btn--red:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn--white {
  background: var(--paper);
  color: var(--red-dark);
  border-color: var(--paper);
}
.btn--white:hover {
  background: var(--black);
  color: var(--paper);
  border-color: var(--black);
}

.btn--outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}
.btn--outline:hover {
  background: var(--paper);
  color: var(--red-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
}
.btn--ghost:hover {
  background: var(--black);
  color: var(--paper);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 4px solid var(--red);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--red);
  line-height: 1.1;
}
.brand span {
  display: block;
  color: var(--black);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  border-bottom-color: var(--red);
}

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

.hero {
  background: var(--red);
  color: var(--paper);
  padding: 5rem 0 5.5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  max-width: 14ch;
}

.hero__lede {
  margin: 1.5rem 0 2.25rem;
  max-width: 40rem;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.45;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- section scaffolding ---------- */

.section {
  padding: 4.5rem 0;
}
.section--wash {
  background: var(--wash);
}

.section__head {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.section__eyebrow {
  margin: 0 0 0.6rem;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-dark);
}

.section h2 {
  margin: 0 0 1rem;
  font-weight: 900;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.section p {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

/* ---------- feature rows (text + screenshot) ---------- */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 880px) {
  .feature {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
  }
  .feature--flip {
    grid-template-columns: 7fr 5fr;
  }
  .feature--flip .feature__text {
    order: 2;
  }
}

.ticks {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.ticks li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.9rem;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}
.ticks li:last-child {
  border-bottom: 1px solid var(--line);
}
/* square red marker drawn with CSS, not an icon */
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--red);
}

.feature__cta {
  margin-top: 1.75rem;
}

/* ---------- screenshot frames ----------
   Drop real screenshots in dfs-frontend/img/ with the filenames used in
   index.html. Until then the frame shows a labelled placeholder (CSS only).
   Each figure sets --shot-ratio to its image's own width / height, so the frame fits the
   picture and nothing is cropped; 16 / 10 is the placeholder default. */

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: var(--shot-ratio, 16 / 10);
  border: 3px solid var(--black);
  background:
    repeating-linear-gradient(
      135deg,
      var(--wash) 0 14px,
      #ebebeb 14px 28px
    );
  box-shadow: 10px 10px 0 var(--red);
  overflow: hidden;
}

.shot::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: pre-line;
}

.shot img {
  position: relative; /* paint over the placeholder label when it loads */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  background: var(--paper);
}

.section--wash .shot {
  box-shadow: -10px 10px 0 var(--red);
}

/* ---------- closing call to action ---------- */

.cta {
  background: var(--black);
  color: var(--paper);
  padding: 4.5rem 0;
  text-align: center;
}
.cta h2 {
  margin: 0 0 1rem;
  font-weight: 900;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.05;
  text-transform: uppercase;
}
.cta p {
  margin: 0 auto 2rem;
  max-width: 36rem;
  font-size: 1.15rem;
  color: #dddddd;
}
.cta .cta__access {
  margin: 1.75rem auto 0;
  font-size: 1rem;
  color: #bbbbbb;
}
.cta .cta__email {
  color: var(--paper);
  font-weight: 700;
  white-space: nowrap; /* keep "justin [at] dataforsocialism.org" on one line */
}

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

.footer {
  background: var(--black);
  color: #bbbbbb;
  border-top: 1px solid #333333;
  padding: 1.75rem 0 2.25rem;
  font-size: 0.9rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.footer strong {
  color: var(--paper);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer a {
  color: var(--paper);
}
.footer__disclaimer {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #333333;
  max-width: 62rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #a8a8a8;
}
.footer__disclaimer strong {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .nav__links {
    display: none; /* in-page anchors only; the Sign in button stays */
  }
  .hero {
    padding: 3.5rem 0 4rem;
  }
  .section {
    padding: 3.25rem 0;
  }
  .shot {
    box-shadow: 6px 6px 0 var(--red);
  }
  .section--wash .shot {
    box-shadow: -6px 6px 0 var(--red);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn {
    transition: none;
  }
}
