/* ============================================================
   Precinct IQ — precinct-level campaign intelligence
   Brand system: Warm Ivory canvas, Deep Navy ink, Amber Gold accent
   Type: Marcellus (display) · Archivo (body) · IBM Plex Mono (data)
   ============================================================ */

:root {
  /* --- Brand palette --- */
  --navy:       #1F2A44;   /* Deep Navy */
  --charcoal:   #2F3137;   /* Carbon Charcoal */
  --ivory:      #F4F0E8;   /* Warm Ivory */
  --amber:      #B8882D;   /* Amber Gold */
  --amber-deep: #9c7223;   /* darkened gold (hover) */
  --slate:      #6E809B;   /* Dusty Slate Blue */
  --sage:       #A7B2A6;   /* Soft Sage Gray */

  /* --- Light theme: warm cream surfaces --- */
  --ink:        #F4F0E8;   /* page background (Warm Ivory) */
  --ink-2:      #FBFAF5;   /* raised card / input surface */
  --panel:      #F0EADD;   /* sunken / framed panel */
  --line:       rgba(31, 42, 68, 0.14);   /* hairline on cream */

  /* --- Dark surfaces (nav bar, footer accents, popup) --- */
  --dark:       #1F2A44;   /* Deep Navy bar */
  --dark-2:     #172038;   /* deeper navy */
  --on-dark:    #F4F0E8;   /* ivory text on navy */
  --on-dark-dim:#b7bfce;   /* dim text on navy */
  --line-dark:  rgba(244, 240, 232, 0.14);

  /* --- Text on cream --- */
  --bone:       #20293f;   /* primary text (deep navy) */
  --bone-dim:   #515a6c;   /* secondary text */
  --muted:      #7c8494;   /* muted labels */

  /* functional (non-brand) warning color for form errors */
  --danger:     #b23c22;

  --maxw:       1180px;

  --serif: "Marcellus", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Atmospheric background: layered radial washes + faint precinct grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(184,136,45,0.10), transparent 60%),
    radial-gradient(800px 700px at -5% 20%, rgba(110,128,155,0.08), transparent 55%),
    linear-gradient(180deg, var(--ink), var(--panel));
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 30%, transparent 80%);
  opacity: 0.35;
}

/* film grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--amber); color: var(--dark); }

a { color: inherit; text-decoration: none; }

/* ---------- Shared typography ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.2rem;
}

.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--bone);
}

.ink { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  background: var(--amber);
  color: var(--dark);
  border: 1px solid var(--amber);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(184,136,45,0.6); background: #c99633; }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn--ghost:hover { background: rgba(31,42,68,0.05); box-shadow: none; border-color: var(--bone-dim); }
.btn--sm { padding: 0.6rem 1.05rem; font-size: 0.85rem; }
.btn--full { width: 100%; padding: 1rem; margin-top: 0.4rem; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem clamp(1.2rem, 5vw, 3rem);
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
  background: rgba(248,245,238,0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav.scrolled {
  background: rgba(248,245,238,0.95);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -26px rgba(31,42,68,0.5);
  padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--bone); }
.brand__mark { display: inline-flex; }
.brand__type {
  font-family: var(--serif); font-weight: 400; font-size: 1.3rem;
  letter-spacing: 0; color: var(--bone);
}

.nav__links { display: flex; gap: 1.9rem; margin-left: auto; }
.nav__links a {
  font-size: 0.92rem; color: var(--bone-dim); position: relative; padding: 0.2rem 0;
  transition: color 0.2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--amber); transition: width 0.25s ease;
}
.nav__links a:hover { color: var(--bone); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: 0.4rem; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0;
  cursor: pointer; margin-left: auto; padding: 8px;
}
.nav__toggle span { width: 24px; height: 2px; background: var(--bone); transition: transform 0.25s, opacity 0.25s; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: rgba(248,245,238,0.98); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.4rem; padding: 1.2rem clamp(1.2rem,5vw,3rem) 1.6rem;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a { padding: 0.7rem 0; color: var(--bone-dim); border-bottom: 1px solid var(--line); }
.mobile-menu a.btn { border: 1px solid var(--amber); margin-top: 0.6rem; color: var(--dark); }
/* The mobile menu belongs to the hamburger only; never show it on wider screens */
@media (min-width: 621px) { .mobile-menu { display: none !important; } }

/* ---------- HERO ---------- */
.hero { padding: clamp(8rem, 16vh, 12rem) clamp(1.2rem, 5vw, 3rem) 4rem; max-width: var(--maxw); margin: 0 auto; }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.9rem, 7.5vw, 5.4rem); line-height: 0.98; letter-spacing: -0.03em;
  margin-bottom: 1.6rem;
}
.hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--bone-dim); max-width: 40ch; margin-bottom: 2rem; }
.hero__actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero__note { margin-top: 1.8rem; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--muted); }

/* hero photo panel */
.hero__panel { justify-self: end; width: 100%; }
.panel {
  background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  box-shadow: 0 34px 64px -34px rgba(31,42,68,0.4);
  transform: rotate(1.4deg);
  transition: transform 0.4s ease;
}
.panel:hover { transform: rotate(0deg); }
.panel__photo { display: block; width: 100%; height: auto; border-radius: 6px; }
.panel__cap { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0.25rem 0.2rem; }
.panel__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(184,136,45,0.18); }
.panel__label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--muted); }

/* ---------- MARQUEE ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 1rem 0; background: rgba(31,42,68,0.035); }
.marquee__track { display: flex; gap: 1.5rem; white-space: nowrap; width: max-content; animation: marquee 34s linear infinite; }
.marquee__track span { font-family: var(--serif); font-size: 1.5rem; color: var(--bone-dim); }
.marquee__track .sep { color: var(--slate); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 10vh, 7rem) clamp(1.2rem, 5vw, 3rem); }
.section__head { max-width: 62ch; margin-bottom: 3rem; }
.section__intro { color: var(--bone-dim); margin-top: 1.2rem; font-size: 1.05rem; }

/* ---------- OFFER GRID ---------- */
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  position: relative; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 1.8rem 1.6rem; overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  background: var(--amber); transform: scaleY(0); transform-origin: top; transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(184,136,45,0.5); background: var(--ink-2); box-shadow: 0 20px 44px -30px rgba(31,42,68,0.45); }
.card:hover::before { transform: scaleY(1); }
.card__no { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; margin: 0.5rem 0 0.7rem; letter-spacing: -0.01em; }
.card p { color: var(--bone-dim); font-size: 0.97rem; }
.card--wide { grid-column: span 2; }
.card--accent { background: linear-gradient(150deg, rgba(110,128,155,0.16), var(--ink-2)); border-color: rgba(110,128,155,0.34); }
.card--accent::before { background: var(--slate); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.1rem; }
.tags li { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(184,136,45,0.3); border-radius: 100px; padding: 0.25rem 0.7rem; }

/* ---------- STATS ---------- */
.section--stats { border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 3rem; }
.stat { border-left: 2px solid var(--amber); padding-left: 1.1rem; }
.stat__num { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; color: var(--bone); letter-spacing: -0.02em; }
.stat__cap { display: block; margin-top: 0.6rem; font-size: 0.88rem; color: var(--muted); max-width: 20ch; }
.quote {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.3rem, 2.8vw, 2rem); line-height: 1.35; color: var(--bone);
  border-top: 1px solid var(--line); padding-top: 2.2rem; max-width: 50ch;
}
.quote cite { display: block; margin-top: 1.2rem; font-family: var(--mono); font-style: normal; font-size: 0.8rem; letter-spacing: 0.06em; color: var(--amber); }

/* ---------- STEPS ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: none; }
.step { position: relative; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.step__no { font-family: var(--mono); font-size: 0.85rem; color: var(--amber); letter-spacing: 0.1em; }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0.7rem 0 0.6rem; }
.step p { color: var(--bone-dim); font-size: 0.95rem; }

/* ---------- ABOUT ---------- */
.section--about { border-top: 1px solid var(--line); }
.about { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about__copy p { color: var(--bone-dim); margin: 1rem 0; max-width: 54ch; }
.about__copy .btn { margin-top: 1rem; }
.about__facts { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact__k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fact__v { font-family: var(--serif); font-size: 1.02rem; color: var(--bone); text-align: right; }

/* ---------- CONTACT ---------- */
.section--contact { border-top: 1px solid var(--line); }
.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact__copy p { color: var(--bone-dim); margin-top: 1rem; max-width: 40ch; }
.contact__alt { font-size: 0.95rem; }
.contact__alt a { color: var(--amber); border-bottom: 1px solid rgba(184,136,45,0.4); }

.form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: 0 26px 54px -36px rgba(31,42,68,0.4);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; grid-column: 1 / -1; }
.field--half { grid-column: span 1; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-dim); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 0.98rem; color: var(--bone);
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 0.75rem 0.85rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; }
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(184,136,45,0.18);
}
.field select { appearance: none; cursor: pointer; }
.form .btn--full { grid-column: 1 / -1; }
.form__status { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.82rem; min-height: 1em; }
.form__status.ok { color: var(--amber); }
.form__status.err { color: var(--danger); }
.hp { position: absolute; left: -9999px; }

/* ---------- MAP FIGURE ---------- */
.mapfig {
  display: flex; align-items: center; gap: clamp(1.4rem, 3vw, 2.6rem);
  margin-bottom: 3rem; padding: clamp(1rem, 2.4vw, 1.5rem);
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 52px -38px rgba(31,42,68,0.4);
}
.mapfig__img {
  width: min(44%, 360px); height: auto; flex: none;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel);
}
.mapfig__body { flex: 1; }
.mapfig__kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); margin-bottom: 0.8rem; }
.mapfig__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; color: var(--bone); margin-bottom: 0.7rem; }
.mapfig__body p { color: var(--bone-dim); font-size: 1rem; max-width: 44ch; }

/* ---------- TIMED BRIEFING POPUP ---------- */
.briefing-pop {
  position: fixed; z-index: 200;
  right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  width: min(360px, calc(100vw - 2rem));
  background: var(--dark); color: var(--on-dark);
  border: 1px solid var(--line-dark); border-radius: 12px;
  padding: 1.5rem 1.4rem 1.5rem;
  box-shadow: 0 28px 64px -20px rgba(15,20,40,0.55);
  transform: translateY(26px); opacity: 0;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), opacity 0.5s ease;
}
.briefing-pop.in { transform: none; opacity: 1; }
.briefing-pop[hidden] { display: none; }
.briefing-pop .kicker { color: var(--amber); margin-bottom: 0.7rem; }
.briefing-pop__title { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.1; color: var(--on-dark); margin-bottom: 0.5rem; }
.briefing-pop__text { font-size: 0.92rem; color: var(--on-dark-dim); margin-bottom: 1.1rem; }
.briefing-pop__cta { width: 100%; }
.briefing-pop__close {
  position: absolute; top: 0.55rem; right: 0.55rem;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--on-dark-dim);
  border-radius: 6px; transition: background 0.2s, color 0.2s;
}
.briefing-pop__close:hover { background: rgba(244,240,232,0.08); color: var(--on-dark); }
.briefing-pop__close svg { width: 15px; height: 15px; }
@media (max-width: 620px) { .briefing-pop { left: 1rem; right: 1rem; width: auto; } }


/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); max-width: var(--maxw); margin: 0 auto; padding: 3rem clamp(1.2rem, 5vw, 3rem) 2.5rem; }
.footer__top { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.footer__links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer__links a { font-size: 0.9rem; color: var(--bone-dim); transition: color 0.2s; }
.footer__links a:hover { color: var(--amber); }
.footer__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }
.footer__bottom p { font-size: 0.82rem; color: var(--muted); }
.footer__fine { font-family: var(--mono); font-size: 0.72rem; }

/* ---------- REVEAL ANIMATION ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__panel { justify-self: stretch; max-width: 460px; }
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
  .card--wide { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about, .contact { grid-template-columns: 1fr; }
  .mapfig { flex-direction: column; align-items: flex-start; }
  .mapfig__img { width: 100%; max-width: 420px; align-self: center; }
}
@media (max-width: 620px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .offer-grid { grid-template-columns: 1fr; }
  .card--wide { grid-column: span 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .field--half { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
