/* ==========================================================================
   Particle 64 / Amplify shared stylesheet
   Base tokens and components match the Amplify app (amplifyvote.com):
   navy #193155 primary, red #ad1d2e warn, gold #e0b274 accent, Roboto.
   ========================================================================== */

:root {
  --navy: #193155;
  --navy-dark: #132542;
  --navy-deep: #0d1a2f;
  --red: #ad1d2e;
  --red-dark: #9a0000;
  --gold: #e0b274;
  --green: #3db15a;
  --p64-orange: #c9481c;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #eeeeee;
  --border: #e0e0e0;
  --text: #1f2937;
  --text-muted: #5b6575;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #c5cede;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-1: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
  --shadow-2: 0 3px 3px -2px rgba(0,0,0,.2), 0 3px 4px 0 rgba(0,0,0,.14), 0 1px 8px 0 rgba(0,0,0,.12);
  --shadow-4: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);

  --max: 1120px;
  --gutter: 16px;
  --header-h: 64px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--red); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); font-weight: 500; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.material-icons { vertical-align: middle; line-height: 1; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--surface); color: var(--navy); padding: 8px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 72px 0; }
.section-alt { background: var(--surface); }
.section-dark { background: var(--navy); color: var(--text-on-dark); }
.section-dark h2, .section-dark h3 { color: var(--text-on-dark); }
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; }
.section-dark .section-head p { color: var(--text-on-dark-muted); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red); margin-bottom: 8px;
}
.section-dark .eyebrow, .hero .eyebrow { color: var(--gold); }

/* ---------- Header (mirrors the app's navy mat-toolbar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: var(--text-on-dark);
  box-shadow: var(--shadow-2);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-on-dark); text-decoration: none; font-size: 1.25rem; font-weight: 500; }
.brand:hover { color: var(--text-on-dark); }
.brand { flex: none; }
/* flex: none + aspect-ratio stop iOS Safari from squeezing logos inside flex rows */
.brand img { flex: none; width: 36px; height: 36px; object-fit: contain; }
.brand img.brand-logo-wide { width: auto; height: 30px; aspect-ratio: 600 / 113; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--text-on-dark); text-decoration: none; padding: 8px 12px; border-radius: var(--radius);
  font-size: .95rem; font-weight: 500;
}
.site-nav a:hover { background: rgba(255,255,255,.1); color: var(--text-on-dark); }
.site-nav .btn { margin-left: 8px; }
.nav-toggle {
  display: none; background: none; border: 0; color: var(--text-on-dark); cursor: pointer;
  padding: 8px; border-radius: var(--radius);
}
.nav-toggle .material-icons { font-size: 28px; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: var(--navy-dark);
    padding: 8px var(--gutter) 16px; box-shadow: var(--shadow-2);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .site-nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons (mat-raised-button look) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; font-size: .95rem; letter-spacing: .02em;
  padding: 10px 22px; min-height: 44px; border-radius: var(--radius); border: 0;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-1);
  transition: box-shadow .2s, background-color .2s, transform .1s;
}
.btn:hover { box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-outline { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(224,178,116,.18), transparent 60%),
              linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 60%, var(--navy-deep) 100%);
  color: var(--text-on-dark);
  padding: 96px 0 104px;
}
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-on-dark-muted); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  padding: 28px; transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-4); transform: translateY(-2px); }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--text-muted); }
.icon-badge {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(25,49,85,.08); color: var(--navy); margin-bottom: 16px;
}
.icon-badge .material-icons { font-size: 28px; }
.icon-badge.red { background: rgba(173,29,46,.1); color: var(--red); }
.icon-badge.gold { background: rgba(224,178,116,.25); color: #8a5a17; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.check-list li::before {
  content: 'check_circle'; font-family: 'Material Icons'; position: absolute; left: 0; top: 1px;
  color: var(--green); font-size: 22px; line-height: 1;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 24px; text-align: center; }
.stat-num { font-size: 2.4rem; font-weight: 700; color: var(--gold); line-height: 1.1; }
.stat-label { color: var(--text-on-dark-muted); font-size: .95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 16px;
  background: var(--surface-alt); color: var(--navy); font-size: .9rem; font-weight: 500;
}
.section-dark .chip { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Contact form (mat-form-field outline look) ---------- */
.contact-wrap { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.contact-info .contact-line { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.contact-info .contact-line .material-icons { color: var(--gold); }
.form-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 28px; color: var(--text); }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #b9b9b9; border-radius: var(--radius); padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--text); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field-error { color: var(--red); font-size: .8rem; margin-top: 4px; min-height: 1em; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 4px 0 18px; min-height: 65px; }
.form-status { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius); display: none; }
.form-status.show { display: block; }
.form-status.success { background: #e6f4ea; color: #1e5c2e; border-left: 4px solid var(--green); }
.form-status.error { background: #fdecee; color: #7d1420; border-left: 4px solid var(--red); }
.form-note { font-size: .8rem; color: var(--text-muted); margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--text-on-dark-muted); padding: 40px 0; font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--text-on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer img { flex: none; object-fit: contain; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn { transition: none; }
}

/* ==========================================================================
   p64.io specific
   ========================================================================== */
.p64-hero-grid { display: grid; gap: 48px; grid-template-columns: 1.3fr 1fr; align-items: center; }
.p64-hero-grid > * { min-width: 0; }
.hero-visual { position: relative; padding: 0 0 128px 0; }
.hero-visual .code-window { margin-right: 120px; }
.code-window {
  background: #0b1424; border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); overflow: hidden;
}
.code-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); }
.code-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4558; }
.code-bar i:nth-child(1) { background: var(--red); }
.code-bar i:nth-child(2) { background: var(--gold); }
.code-bar i:nth-child(3) { background: var(--green); }
.code-bar span { margin-left: 10px; font-size: .8rem; color: var(--text-on-dark-muted); font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-body {
  margin: 0; padding: 20px 22px 28px; color: #d6deeb; font-size: .86rem; line-height: 1.7;
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: hidden;
}
.code-body .c { color: #6b7a93; }
.code-body .k { color: #e0b274; }
.code-body .f { color: #7fb3ff; }
.code-body .s { color: #8fd19e; }
.cursor { display: inline-block; width: 8px; height: 1.1em; background: var(--gold); vertical-align: text-bottom; margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.status-card {
  position: absolute; right: -20px; bottom: 0; width: 230px;
  background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-4);
  padding: 14px 16px; font-size: .85rem;
}
.status-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.status-row .material-icons { font-size: 18px; color: var(--navy); }
.status-row .ok, .status-row .muted { margin-left: auto; }
.status-row .ok { color: #1e7a3a; font-weight: 500; }
.status-row .muted { color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(61,177,90,.2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(61,177,90,.05); } }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 36px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.bars i { flex: 1; background: linear-gradient(var(--navy), #3d5a88); border-radius: 2px 2px 0 0; }
@media (prefers-reduced-motion: reduce) { .cursor, .dot { animation: none; } }
@media (max-width: 1180px) { .status-card { right: 0; } .hero-visual .code-window { margin-right: 60px; } }
@media (max-width: 760px) {
  .p64-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .code-body { font-size: .74rem; padding: 16px; }
  .hero-visual .code-window { margin-right: 0; }
  .status-card { position: relative; right: auto; width: auto; margin: 12px 0 0; }
  .hero-visual { padding-bottom: 0; }
  .hero { padding: 56px 0 64px; }
}

.process { counter-reset: step; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.process-step { position: relative; padding: 24px; border-radius: var(--radius-lg); background: var(--bg); border-top: 4px solid var(--navy); }
.process-step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: block; font-size: 1.8rem; font-weight: 700; color: var(--red); margin-bottom: 8px;
}
.process-step p { color: var(--text-muted); margin: 0; }

.showcase {
  display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: center;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 40px; color: var(--text);
}
.section-dark .showcase h3, .showcase h3 { font-size: 1.5rem; color: var(--navy); }
.showcase p { color: var(--text-muted); }
.showcase-logo { background: #fff; border-radius: var(--radius-lg); padding: 32px; display: grid; place-items: center; border: 1px solid var(--border); }
@media (max-width: 760px) { .showcase { grid-template-columns: 1fr; padding: 24px; gap: 24px; } }

.partner-card { display: flex; gap: 20px; align-items: flex-start; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 1.4rem; font-weight: 700;
}
.partner-card .role { color: var(--red); font-weight: 500; font-size: .9rem; margin-bottom: 8px; }

/* ==========================================================================
   Legal pages (privacy policy, terms of use)
   ========================================================================== */
.page-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; padding: 56px 0 48px; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 8px; }
.page-hero p { color: var(--text-on-dark-muted); margin: 0; }
.breadcrumb { font-size: .9rem; margin-bottom: 12px; }
.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: var(--gold); }

.prose {
  max-width: 820px; margin: -24px auto 72px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2); padding: clamp(24px, 5vw, 56px); position: relative; overflow-wrap: anywhere;
}
.prose h2 { font-size: 1.35rem; margin: 2em 0 .6em; padding-top: .8em; border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.08rem; margin: 1.6em 0 .5em; }
.prose p, .prose li { color: #374151; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--red); }
.prose .toc-list { list-style: none; background: var(--bg); border-radius: var(--radius); padding: 16px 20px; }
.prose .toc-list a { text-decoration: none; }
.prose .toc-list a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--navy); color: #fff; font-weight: 500; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: var(--bg); }
.prose td.yn { font-weight: 700; white-space: nowrap; }
.back-top { display: inline-flex; align-items: center; gap: 4px; margin-top: 24px; font-size: .9rem; }
@media (max-width: 600px) {
  .table-wrap { border: 0; overflow: visible; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
  .prose tbody tr:nth-child(even) td { background: transparent; }
  .prose td { border-bottom: 1px solid var(--border); padding: 8px 12px; }
  .prose td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
  .prose td:first-child { background: var(--navy) !important; color: #fff; font-weight: 500; }
  .prose td:first-child::before { color: var(--gold); }
}
