/* =====================================================================
   Justin Moriarty for Wahkiakum County Assessor
   Design system — "Precision, not politics."
   Civic Americana: navy ink · flag red · brass · aged parchment
   Display: Fraunces  |  Body: Public Sans (US gov typeface)  |  Data: IBM Plex Mono
   ===================================================================== */

:root {
  /* palette */
  --ink:    #0B2545;   /* deep navy — authority */
  --ink-2:  #17335c;   /* lifted navy */
  --red:    #B01E2E;   /* deepened flag red */
  --red-d:  #8f1826;
  --brass:  #B4884D;   /* warm gold — gravitas, precision */
  --brass-d:#96703b;
  --cream:  #F7F1E3;   /* parchment background */
  --paper:  #FCFAF4;   /* card / raised surfaces */
  --slate:  #233047;   /* body text on cream */
  --muted:  #5b6b83;   /* secondary text */
  --line:   #e2d8c2;   /* hairline on cream */
  --sky:    #dfe7ee;   /* seal medallion sky */
  --river:  #9fb4c4;   /* seal river */
  --pine:   #2c4a3a;   /* seal near-hill green */

  /* type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1140px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --shadow: 0 1px 2px rgba(11,37,69,.06), 0 12px 30px -18px rgba(11,37,69,.35);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--slate);
  background: var(--cream);
  line-height: 1.6;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--red-d); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img, svg { max-width: 100%; }
ul, ol, dl { margin: 0; padding: 0; }
li { list-style: none; }
strong { font-weight: 700; color: var(--ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* offset anchored sections beneath the sticky masthead */
.hero, .office, .justin, .stand, .path, .involved, #dates { scroll-margin-top: 84px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* focus visibility (quality floor) */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- shared: eyebrow ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .55em;
}
.eyebrow--red  { color: var(--red-d); }
.eyebrow--cream{ color: var(--brass); }
.eyebrow__star { color: var(--red); font-size: .85em; }

/* ---------- shared: buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  padding: .8em 1.5em;
  border-radius: 2px;
  border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(11,37,69,.6); }
.btn:active { transform: translateY(0); }
.btn--red    { --btn-bg: var(--red); --btn-fg: #fff; border-color: var(--red); }
.btn--red:hover { background: var(--red-d); border-color: var(--red-d); }
.btn--ghost  { --btn-bg: transparent; --btn-fg: var(--ink); border-color: rgba(11,37,69,.35); }
.btn--ghost:hover { background: rgba(11,37,69,.06); }
.btn--outline{ --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--brass); }
.btn--outline:hover { background: rgba(180,136,77,.12); }
.btn--sm { padding: .5em .95em; font-size: .82rem; }

/* ---------- shared: survey-tick rule (signature motif) ---------- */
.tickrule {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--brass) 0 1px, transparent 1px 13px) bottom/100% 8px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom/100% 1.5px no-repeat;
  opacity: .55;
}

/* =====================================================================
   MASTHEAD
   ===================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,241,227,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 38px; height: 38px; color: var(--ink); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--display); font-weight: 900; font-size: 1.35rem; letter-spacing: -.01em; }
.brand__role { font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brass-d); margin-top: 3px; }

.nav__toggle { display: none; }
.nav__menu { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 1.9rem); }
.nav__menu a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; }
.nav__menu a:not(.btn):hover { color: var(--red-d); }
.nav__menu .btn { color: #fff; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 5rem); background:
    radial-gradient(120% 80% at 85% -10%, rgba(180,136,77,.10), transparent 60%),
    var(--cream); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.hero__name {
  font-size: clamp(2.9rem, 8vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: .1em 0 0;
}
.hero__role {
  font-family: var(--display);
  font-weight: 500; font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  color: var(--ink-2);
  margin: .15em 0 0;
}
.hero__tagline {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: clamp(.85rem, 1.6vw, 1rem);
  color: var(--red);
  margin: 1.3rem 0 0;
  padding-top: 1.1rem;
  border-top: 2px solid var(--brass);
  display: inline-block;
}
.hero__lede {
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--slate);
  margin-top: 1rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* hero portrait */
.hero__portrait { display: flex; justify-content: center; }
.hero__portrait .portrait { width: 100%; max-width: 384px; }

/* seal — now the bio emblem */
.justin__seal { display: flex; flex-direction: column; align-items: center; position: sticky; top: 96px; }
.seal { width: min(100%, 340px); height: auto; filter: drop-shadow(0 16px 28px rgba(11,37,69,.24)); }
.seal__text { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 1.6px; fill: var(--ink); }
.seal__star { font-size: 14px; fill: var(--red); }
.seal__cap { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-d); margin: .9rem 0 0; }

/* =====================================================================
   THE OFFICE / STAKES
   ===================================================================== */
.office { background: var(--ink); color: var(--cream); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.office__h { color: #fff; font-size: clamp(1.9rem, 4.5vw, 3rem); max-width: 18ch; }
.office__lede { color: rgba(247,241,227,.82); max-width: 58ch; font-size: clamp(1.05rem, 1.5vw, 1.2rem); margin-top: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.chip {
  font-family: var(--display); font-style: italic; font-size: 1.15rem;
  color: #fff; padding: .7rem 1.3rem; border: 1px solid rgba(180,136,77,.55);
  border-radius: 2px; background: rgba(255,255,255,.03);
}
.chip__k { font-family: var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--brass); display: block; margin-bottom: .2rem; }

/* =====================================================================
   MEET JUSTIN
   ===================================================================== */
.justin { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.justin__grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.justin__h { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: 1rem; }

/* portrait placeholder */
.portrait { margin: 0; }
.portrait__frame {
  position: relative; aspect-ratio: 4/5; border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, rgba(11,37,69,.04) 0 10px, transparent 10px 20px),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 0 8px var(--paper), 0 0 0 9px var(--brass);
  display: grid; place-items: center; color: var(--ink); overflow: hidden;
}
.portrait__silhouette { width: 55%; opacity: .16; }
.portrait__note {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.portrait__cap { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; color: var(--muted); text-align: center; margin: 1rem 0 0; }
/* When a real photo is added: give <figure class="portrait has-photo"> and set --photo */
.portrait.has-photo .portrait__frame {
  background-image: var(--photo);
  background-size: cover;
  background-position: center 15%; /* favor the face, trim lower chest */
  background-repeat: no-repeat;
}
.portrait.has-photo .portrait__silhouette,
.portrait.has-photo .portrait__note { display: none; }

.justin__body p { max-width: 60ch; }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 2rem; background: var(--line); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.stat { background: var(--paper); padding: 1.15rem 1rem; }
.stat__num { font-family: var(--display); font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.05rem); color: var(--ink); line-height: 1; }
.stat__num span { color: var(--red); }
.stat__lab { font-family: var(--mono); font-size: .64rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: .5rem; }

/* =====================================================================
   WHERE HE STANDS
   ===================================================================== */
.stand { background: var(--paper); border-block: 1px solid var(--line); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.stand__h { font-size: clamp(1.8rem, 4vw, 2.7rem); max-width: 20ch; margin-bottom: 2.4rem; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.card {
  position: relative; background: var(--cream); border: 1px solid var(--line);
  border-radius: 3px; padding: 1.8rem 1.7rem 1.7rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__tick {
  display: block; width: 44px; height: 8px; margin-bottom: 1.1rem;
  background: repeating-linear-gradient(90deg, var(--brass) 0 1px, transparent 1px 7px) bottom/100% 6px no-repeat,
              linear-gradient(var(--brass), var(--brass)) bottom/100% 1.5px no-repeat;
}
.card__h { font-size: 1.3rem; margin-bottom: .5rem; }
.card p { margin: 0; color: var(--muted); }

/* =====================================================================
   PATH / TIMELINE  (a real sequence — numbering earns its place)
   ===================================================================== */
.path { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.path__h { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 2.4rem; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before {
  content: ""; position: absolute; left: 7.2rem; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(var(--brass) 0 4px, transparent 4px 9px);
  opacity: .6;
}
.tl { display: grid; grid-template-columns: 6.4rem 1.6rem 1fr; align-items: baseline; padding: .85rem 0; }
.tl__yr { font-family: var(--mono); font-weight: 500; font-size: .95rem; color: var(--brass-d); text-align: right; }
.tl__dot { position: relative; justify-self: center; align-self: center; width: 13px; height: 13px; border-radius: 50%; background: var(--cream); border: 2px solid var(--brass); }
.tl__txt { margin: 0; font-size: 1.08rem; color: var(--slate); }
.tl--now .tl__dot { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 4px rgba(176,30,46,.15); }
.tl--now .tl__txt { font-weight: 700; color: var(--ink); }
.tl--now .tl__yr { color: var(--red); }

/* =====================================================================
   GET INVOLVED
   ===================================================================== */
.involved { background: var(--ink); color: var(--cream); padding: clamp(3.5rem, 7vw, 6rem) 0; position: relative; }
.involved__grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.involved__h { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); }
.involved__lede { color: rgba(247,241,227,.82); max-width: 46ch; margin-top: 1rem; font-size: 1.1rem; }
.involved__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.7rem; }
.involved .btn--outline { --btn-fg: var(--cream); }
.involved .btn--outline:hover { background: rgba(180,136,77,.18); }
.involved__reg { margin-top: 1.5rem; font-size: .92rem; color: rgba(247,241,227,.7); }
.involved__reg a { color: var(--brass); }

/* key dates card */
.dates { background: var(--cream); color: var(--slate); border-radius: 4px; padding: 1.8rem; box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); border-top: 4px solid var(--red); }
.dates__h { font-size: 1.35rem; margin-bottom: 1.1rem; }
.dates__list { display: grid; gap: .2rem; }
.dline { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.dline:last-child { border-bottom: 0; }
.dline__date { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: .95rem; white-space: nowrap; }
.dline__what { color: var(--muted); font-size: .95rem; text-align: right; }
.dline--big { margin-top: .2rem; }
.dline--big .dline__date { color: var(--red); font-size: 1.15rem; font-weight: 500; }
.dline--big .dline__what { color: var(--ink); font-weight: 600; }
.dates__note { font-size: .82rem; color: var(--muted); margin: 1rem 0 0; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.foot { background: #081a33; color: rgba(247,241,227,.75); padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; align-items: start; }
.foot__brand { display: flex; align-items: center; gap: .9rem; }
.foot__mark { width: 46px; height: 46px; color: var(--brass); flex: none; }
.foot__name { font-family: var(--display); color: #fff; font-size: 1.15rem; font-weight: 600; margin: 0; line-height: 1.2; }
.foot__name span { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); font-weight: 400; }
.foot__k { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 .6rem; }
.foot__col p { margin: 0; font-size: .95rem; line-height: 1.8; }
.foot a { color: rgba(247,241,227,.85); }
.foot a:hover { color: #fff; }

.foot__legal { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid rgba(180,136,77,.25); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.disclaimer { margin: 0; font-size: .8rem; color: rgba(247,241,227,.6); }
.disclaimer strong { color: var(--brass); font-weight: 600; }
.copyright { margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: rgba(247,241,227,.5); }
.foot__credit { text-align: center; font-size: .8rem; color: rgba(247,241,227,.5); margin: 1.4rem auto 0; }
.foot__credit a { color: var(--brass); text-decoration: underline; text-underline-offset: 2px; }
.foot__credit a:hover { color: #fff; }

/* =====================================================================
   SCROLL REVEAL
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { margin-top: .5rem; }
  .hero__portrait .portrait { max-width: 300px; }
  .justin__grid { grid-template-columns: 1fr; }
  .justin__seal { position: static; order: 2; margin-top: 1.5rem; }
  .seal { width: min(64%, 260px); }
  .involved__grid { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}

/* collapse nav earlier so tablet widths don't crowd the links */
@media (max-width: 820px) {
  /* mobile nav */
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: transparent; border: 1px solid var(--line);
    border-radius: 3px; cursor: pointer;
  }
  .nav__bars, .nav__bars::before, .nav__bars::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--ink);
    transition: transform .25s var(--ease), opacity .2s var(--ease);
  }
  .nav__bars { position: relative; }
  .nav__bars::before { position: absolute; top: -6px; }
  .nav__bars::after  { position: absolute; top: 6px; }
  .nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(6px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__bars::after  { transform: translateY(-6px) rotate(-45deg); }

  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1.2rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu li { padding: .1rem 0; }
  .nav__menu a:not(.btn) { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .nav__menu .btn { margin-top: .8rem; }
}

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chips { gap: .6rem; }
  .foot__grid { grid-template-columns: 1fr; }
  .foot__legal { flex-direction: column; }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover { transform: none; }
}
