/* Vote for Jude — the whole stylesheet.
 *
 * Public-facing, so the priorities are clarity and a strong first impression
 * rather than density. Two complete themes, both driven off the two hues set
 * inline by the server from src/config.js — change the hue there and the site
 * re-skins without a line of CSS being touched.
 */

/* ---------------------------------------------------------------- tokens */

:root {
  /* --hue / --hue-accent are injected per-page by the server. */
  --bg:            hsl(var(--hue) 40% 99%);
  --bg-alt:        hsl(var(--hue) 34% 96.5%);
  --bg-raised:     hsl(0 0% 100%);
  --ink:           hsl(var(--hue) 30% 12%);
  --ink-soft:      hsl(var(--hue) 16% 38%);
  --ink-faint:     hsl(var(--hue) 12% 52%);
  --line:          hsl(var(--hue) 24% 89%);
  --line-strong:   hsl(var(--hue) 24% 80%);

  --brand:         hsl(var(--hue) 72% 48%);
  --brand-deep:    hsl(var(--hue) 76% 36%);
  --brand-tint:    hsl(var(--hue) 78% 96%);
  --brand-ink:     hsl(0 0% 100%);
  --accent:        hsl(var(--hue-accent) 88% 46%);
  --accent-tint:   hsl(var(--hue-accent) 92% 95%);
  --accent-ink:    hsl(var(--hue-accent) 90% 24%);

  --shadow-sm: 0 1px 2px hsl(var(--hue) 40% 20% / .06), 0 2px 8px hsl(var(--hue) 40% 20% / .05);
  --shadow-md: 0 2px 4px hsl(var(--hue) 40% 20% / .05), 0 12px 32px hsl(var(--hue) 40% 20% / .09);

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font);
}

/* Dark theme. Defined for the system preference, then again for the explicit
 * toggle, so a visitor who chose dark on a light OS still gets dark. Neither
 * block is the only definition of any token — the light values above always
 * load first. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          hsl(var(--hue) 26% 8%);
    --bg-alt:      hsl(var(--hue) 24% 11%);
    --bg-raised:   hsl(var(--hue) 22% 14%);
    --ink:         hsl(var(--hue) 22% 96%);
    --ink-soft:    hsl(var(--hue) 14% 74%);
    --ink-faint:   hsl(var(--hue) 12% 60%);
    --line:        hsl(var(--hue) 18% 22%);
    --line-strong: hsl(var(--hue) 16% 32%);
    --brand:       hsl(var(--hue) 78% 68%);
    --brand-deep:  hsl(var(--hue) 80% 78%);
    --brand-tint:  hsl(var(--hue) 40% 18%);
    --brand-ink:   hsl(var(--hue) 40% 10%);
    --accent:      hsl(var(--hue-accent) 88% 62%);
    --accent-tint: hsl(var(--hue-accent) 40% 18%);
    --accent-ink:  hsl(var(--hue-accent) 90% 82%);
    --shadow-sm: 0 1px 2px hsl(0 0% 0% / .4);
    --shadow-md: 0 12px 32px hsl(0 0% 0% / .45);
  }
}
:root[data-theme="dark"] {
  --bg:          hsl(var(--hue) 26% 8%);
  --bg-alt:      hsl(var(--hue) 24% 11%);
  --bg-raised:   hsl(var(--hue) 22% 14%);
  --ink:         hsl(var(--hue) 22% 96%);
  --ink-soft:    hsl(var(--hue) 14% 74%);
  --ink-faint:   hsl(var(--hue) 12% 60%);
  --line:        hsl(var(--hue) 18% 22%);
  --line-strong: hsl(var(--hue) 16% 32%);
  --brand:       hsl(var(--hue) 78% 68%);
  --brand-deep:  hsl(var(--hue) 80% 78%);
  --brand-tint:  hsl(var(--hue) 40% 18%);
  --brand-ink:   hsl(var(--hue) 40% 10%);
  --accent:      hsl(var(--hue-accent) 88% 62%);
  --accent-tint: hsl(var(--hue-accent) 40% 18%);
  --accent-ink:  hsl(var(--hue-accent) 90% 82%);
  --shadow-sm: 0 1px 2px hsl(0 0% 0% / .4);
  --shadow-md: 0 12px 32px hsl(0 0% 0% / .45);
}

/* ---------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.022em; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--brand-deep); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
       background: var(--bg-alt); padding: .1em .35em; border-radius: 5px; }

/* One visible focus style everywhere — never removed, only styled. */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--brand-ink);
  padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0; font-weight: 650;
}
.skip:focus { left: 0; }

.icon { width: 1.1em; height: 1.1em; flex: none; }

/* An unfilled config value should look obviously unfinished, in both themes,
 * so a placeholder can never be mistaken for real campaign copy. */
.todo {
  background: repeating-linear-gradient(45deg, var(--accent-tint) 0 8px, transparent 8px 16px);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
  border-radius: 5px; padding: 0 .3em; font-style: italic; font-weight: 500;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }

.wordmark { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700;
            color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.wordmark-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: var(--brand-ink); font-weight: 800; font-size: 1.05rem;
}
.topbar-links { display: flex; gap: 1.4rem; margin-left: auto; }
.topbar-links a { color: var(--ink-soft); text-decoration: none; font-weight: 550; font-size: .94rem; }
.topbar-links a:hover { color: var(--brand-deep); }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg-raised); color: var(--ink-soft); cursor: pointer;
  transition: color .18s, border-color .18s;
}
.theme-toggle:hover { color: var(--brand-deep); border-color: var(--brand); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-sun { display: none; }
.theme-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }

@media (max-width: 720px) {
  .topbar-links { display: none; }
  .theme-toggle { margin-left: auto; }
}

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

.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-glow {
  position: absolute; inset: -40% -10% auto -10%; height: 130%;
  background:
    radial-gradient(60% 55% at 22% 18%, hsl(var(--hue) 85% 60% / .22), transparent 70%),
    radial-gradient(45% 50% at 82% 8%, hsl(var(--hue-accent) 90% 58% / .16), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }

.eyebrow, .section-eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .76rem;
  font-weight: 700; color: var(--brand-deep); margin: 0 0 1rem;
}

.hero-name {
  font-size: clamp(2.9rem, 9vw, 5.4rem); font-weight: 820;
  margin: 0 0 .35em;
}
.hero-first {
  background: linear-gradient(115deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* A gradient that fails to clip must not render invisible text. */
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-first { color: var(--brand-deep); -webkit-text-fill-color: currentColor; }
}

.hero-slogan {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 620; color: var(--ink);
  max-width: 32ch; margin: 0 auto .8em; line-height: 1.3; text-wrap: balance;
}
.hero-pitch { color: var(--ink-soft); max-width: 56ch; margin: 0 auto 2rem; font-size: 1.08rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-bottom: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px; font-weight: 650; font-size: 1rem;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--brand-deep); color: var(--brand-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--bg-raised); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }

.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .42rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
  background: var(--bg-raised); color: var(--ink-soft); border: 1px solid var(--line);
}
.chip-accent { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; }
.chip-quiet { opacity: .8; }

/* ---------------------------------------------------------------- sections */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 760; margin: 0 0 2.2rem; }

/* ---------------------------------------------------------------- planks */

.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card {
  position: relative; background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.9rem 1.6rem 1.6rem;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-tint); color: var(--brand-deep); margin-bottom: 1rem;
}
.card-icon .icon { width: 22px; height: 22px; }
.card-num {
  position: absolute; top: 1.5rem; right: 1.5rem; margin: 0;
  font-size: .8rem; font-weight: 800; color: var(--ink-faint); letter-spacing: .08em;
}
.card-title { font-size: 1.28rem; font-weight: 700; margin: 0 0 .5rem; }
.card-summary { color: var(--brand-deep); font-weight: 600; margin: 0 0 .8rem; }
.card-body { color: var(--ink-soft); font-size: .97rem; }
.card-body :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ credentials */

.creds {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.5rem 2.5rem;
  grid-template-columns: 1fr;
}
.cred { display: flex; gap: 1rem; align-items: flex-start; }
@media (min-width: 700px) { .creds { grid-template-columns: repeat(2, 1fr); } }
.cred-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 11px; background: var(--bg-raised); color: var(--brand);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.cred-icon .icon { width: 20px; height: 20px; }
.cred-title { font-size: 1.05rem; font-weight: 700; margin: .25rem 0 .2rem; }
.cred-body { color: var(--ink-soft); margin: 0; font-size: .97rem; }

/* ---------------------------------------------------------------- about */

.about-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: minmax(240px, 320px) 1fr; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); display: grid; place-content: center;
  gap: .8rem; text-align: center; padding: 1.5rem;
  background: linear-gradient(150deg, var(--brand-tint), var(--accent-tint));
  border: 1px dashed var(--line-strong); color: var(--ink-soft);
}
.portrait-initials { font-size: clamp(3rem, 8vw, 4.5rem); font-weight: 800; color: var(--brand-deep); line-height: 1; }
.portrait-hint { font-size: .82rem; }

/* The real photo. Same footprint as the placeholder so swapping one for the
 * other does not move the rest of the column. */
.portrait-photo { margin: 0; padding: 0; border: 0; overflow: hidden; display: block;
                  box-shadow: var(--shadow-md); background: var(--bg-alt); }
.portrait-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.facts { margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.facts > div { display: grid; gap: .15rem; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-faint); }
.facts dd { margin: 0; font-weight: 600; }

.prose { max-width: 65ch; color: var(--ink-soft); font-size: 1.05rem; }
.prose h3 { color: var(--ink); margin: 1.8em 0 .5em; font-size: 1.2rem; }
.prose :last-child { margin-bottom: 0; }
.prose-center { margin-inline: auto; text-align: center; margin-top: 2.5rem; }

/* ---------------------------------------------------------------- quotes */

.quotes { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.quote {
  margin: 0; padding: 1.6rem; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.quote blockquote { margin: 0 0 1rem; font-size: 1.08rem; font-weight: 550; color: var(--ink); }
.quote blockquote::before { content: '“'; color: var(--brand); font-size: 2rem; line-height: 0; vertical-align: -.35em; margin-right: .1em; }
.quote figcaption { font-weight: 700; font-size: .95rem; }
.quote figcaption span { display: block; font-weight: 500; color: var(--ink-faint); font-size: .86rem; }

/* ---------------------------------------------------------------- vote */

.section-vote { background: var(--bg-alt); border-top: 1px solid var(--line); text-align: center; }
.details {
  display: grid; gap: 1.25rem; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.detail {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.3rem; text-align: center; box-shadow: var(--shadow-sm);
}
.detail-icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto .9rem;
  border-radius: 12px; background: var(--brand); color: var(--brand-ink);
}
.detail-icon .icon { width: 22px; height: 22px; }
.detail dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-faint); margin-bottom: .35rem; }
.detail dd { margin: 0; font-weight: 650; font-size: 1.05rem; color: var(--ink); }

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

.footer { padding: 3rem 0; border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { text-align: center; }
.footer-line { font-weight: 650; margin-bottom: .6rem; }
.footer-fine { color: var(--ink-faint); font-size: .86rem; margin-bottom: .4rem; }
