/**
 * Oakland Parents Together (OPT) — Landing page styles
 * Brand tokens extracted from OPT logo (shield, figures, rainbow gradient)
 */

:root {
  /* Brand — from OPT logo */
  --color-primary: #e91e8c;
  --color-secondary: #00a8e8;
  --color-accent: #8bc34a;
  --color-star: #ffd600;
  --color-orange: #ff8a00;
  --color-figure-brown: #8d5524;
  --color-figure-magenta: #e91e8c;

  --color-text: #1a1a1a;
  --color-muted: #5c5c5c;
  --color-bg: #ffffff;
  --color-bg-alt: #f4f7f9;
  --color-surface: #ffffff;
  --color-border: #d8e0e6;
  --color-error: #c62828;
  --color-success: #2e7d32;
  --color-focus: #00a8e8;

  --gradient-brand: linear-gradient(
    105deg,
    #00a8e8 0%,
    #26c6a8 22%,
    #8bc34a 42%,
    #ffd600 58%,
    #ff8a00 78%,
    #e53935 100%
  );

  --font-heading: "Nunito", system-ui, -apple-system, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-unit: 8px;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --header-h: 72px;
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-secondary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: absolute;
  left: var(--space-unit);
  top: -100px;
  z-index: 1000;
  padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-unit);
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--space-unit) * 2);
  min-height: var(--header-h);
  padding-block: calc(var(--space-unit) * 1.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(var(--space-unit) * 1.5);
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: auto;
  flex-shrink: 0;
}

.brand picture {
  flex-shrink: 0;
  line-height: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-abbr {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text);
  border-radius: 1px;
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  gap: calc(var(--space-unit) * 2);
  padding: calc(var(--space-unit) * 2);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.site-nav.is-open {
  display: flex;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-unit) * 0.5);
}

.nav-list a {
  display: block;
  padding: calc(var(--space-unit) * 1.5);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.btn-nav {
  text-align: center;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-unit);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: #b0156a;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #d0157a;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.btn-block {
  width: 100%;
}

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

/* —— Hero —— */
.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: calc(var(--space-unit) * 6) 0 calc(var(--space-unit) * 8);
  overflow: hidden;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      165deg,
      rgba(8, 24, 40, 0.88) 0%,
      rgba(18, 28, 48, 0.82) 40%,
      rgba(90, 20, 70, 0.78) 100%
    ),
    var(--gradient-brand);
  background-size: cover;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 214, 0, 0.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 168, 232, 0.2), transparent 45%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}

.hero-logo {
  width: 110px;
  height: auto;
  margin: 0 auto calc(var(--space-unit) * 2.5);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
  animation: hero-rise 0.8s ease both;
}

.hero-content > picture {
  display: block;
  width: fit-content;
  margin: 0 auto calc(var(--space-unit) * 2.5);
  line-height: 0;
  animation: hero-rise 0.8s ease both;
}

.hero-content > picture .hero-logo {
  margin: 0;
}

.hero-eyebrow {
  margin: 0 0 var(--space-unit);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-star);
  animation: hero-rise 0.8s ease 0.08s both;
}

.hero h1 {
  margin: 0 0 calc(var(--space-unit) * 1.5);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  animation: hero-rise 0.8s ease 0.12s both;
}

.hero-tagline {
  margin: 0 0 calc(var(--space-unit) * 2);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  animation: hero-rise 0.8s ease 0.18s both;
}

.hero-mission {
  margin: 0 auto calc(var(--space-unit) * 4);
  max-width: 38rem;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.92);
  animation: hero-rise 0.8s ease 0.24s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space-unit) * 1.5);
  justify-content: center;
  animation: hero-rise 0.8s ease 0.3s both;
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
}

.hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: #fff;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Sections —— */
.section {
  padding: calc(var(--space-unit) * 8) 0;
}

.section-header {
  max-width: 40rem;
  margin-bottom: calc(var(--space-unit) * 5);
}

.section-label {
  margin: 0 0 calc(var(--space-unit) * 1);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.section-header h2 {
  margin: 0 0 calc(var(--space-unit) * 2);
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-muted);
}

.section-lead strong {
  color: var(--color-text);
}

/* —— About —— */
.about {
  background: var(--color-bg);
}

.about-grid {
  display: grid;
  gap: calc(var(--space-unit) * 4);
}

.about-copy p {
  margin: 0 0 calc(var(--space-unit) * 2.5);
  color: var(--color-muted);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-aside {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: calc(var(--space-unit) * 3);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.about-aside::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
}

.fact-list {
  margin: 0;
  display: grid;
  gap: calc(var(--space-unit) * 2.5);
}

.fact-list div {
  margin: 0;
}

.fact-list dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.fact-list dd {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

/* —— Programs —— */
.programs {
  background: var(--color-bg-alt);
}

.program-grid {
  display: grid;
  gap: calc(var(--space-unit) * 3);
  grid-template-columns: 1fr;
}

.program-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: calc(var(--space-unit) * 3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.program-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.program-icon {
  width: 48px;
  height: 48px;
  margin-bottom: calc(var(--space-unit) * 2);
  color: var(--color-primary);
}

.program-card:nth-child(2) .program-icon {
  color: var(--color-secondary);
}

.program-card:nth-child(3) .program-icon {
  color: var(--color-orange);
}

.program-card h3 {
  margin: 0 0 calc(var(--space-unit) * 1.5);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

.program-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

/* —— Impact —— */
.impact {
  background: var(--color-text);
  color: #fff;
  padding: calc(var(--space-unit) * 8) 0;
}

.impact-quote {
  margin: 0 0 calc(var(--space-unit) * 5);
  max-width: 42rem;
}

.impact-quote p {
  margin: 0 0 calc(var(--space-unit) * 2);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.45;
}

.impact-quote footer {
  color: var(--color-star);
  font-weight: 600;
  font-size: 0.95rem;
}

.impact-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: calc(var(--space-unit) * 3);
}

.impact-stats li {
  padding-top: calc(var(--space-unit) * 2);
  border-top: 2px solid rgba(255, 255, 255, 0.15);
}

.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.stat-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

/* —— Contact —— */
.contact {
  background: var(--color-bg);
}

.contact-grid {
  display: grid;
  gap: calc(var(--space-unit) * 5);
}

.contact-list {
  list-style: none;
  margin: 0 0 calc(var(--space-unit) * 3);
  padding: 0;
  display: grid;
  gap: calc(var(--space-unit) * 2.5);
}

.contact-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.contact-list a {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.contact-list address {
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
}

.privacy-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  max-width: 28rem;
}

.contact-form-wrap {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: calc(var(--space-unit) * 3);
}

.form-field {
  margin-bottom: calc(var(--space-unit) * 2.5);
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--color-text);
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.2);
  outline: none;
}

.form-field input.is-invalid,
.form-field textarea.is-invalid {
  border-color: var(--color-error);
}

.field-error {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--color-error);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.form-status {
  margin: calc(var(--space-unit) * 2) 0 0;
  padding: calc(var(--space-unit) * 1.5);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.form-status.is-success {
  background: #e8f5e9;
  color: var(--color-success);
}

.form-status.is-error {
  background: #ffebee;
  color: var(--color-error);
}

.form-fallback {
  margin: calc(var(--space-unit) * 2) 0 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* —— Footer —— */
.site-footer {
  background: #0f1720;
  color: rgba(255, 255, 255, 0.85);
  padding: calc(var(--space-unit) * 6) 0 calc(var(--space-unit) * 4);
  border-top: 4px solid transparent;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
}

.footer-inner {
  display: grid;
  gap: calc(var(--space-unit) * 4);
}

.footer-brand {
  display: flex;
  gap: calc(var(--space-unit) * 2);
  align-items: flex-start;
}

.footer-logo {
  width: 48px;
  height: auto;
  flex-shrink: 0;
}

.footer-brand picture {
  flex-shrink: 0;
  line-height: 0;
}

.footer-legal-name {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.footer-status {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.footer-meta {
  display: grid;
  gap: calc(var(--space-unit) * 2);
  font-size: 0.95rem;
}

.footer-meta p {
  margin: 0;
}

.footer-meta a {
  color: #fff;
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--color-star);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: calc(var(--space-unit) * 3);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.copyright {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-note {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* —— Reveal (subtle) —— */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* —— Breakpoints —— */
@media (min-width: 640px) {
  .brand-name {
    font-size: 1.05rem;
  }

  .hero-logo {
    width: 130px;
  }

  .impact-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .impact-stats li {
    border-top: none;
    padding-top: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    padding-left: calc(var(--space-unit) * 2.5);
  }

  .impact-stats li:first-child {
    border-left: none;
    padding-left: 0;
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: calc(var(--space-unit) * 2.5);
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .nav-list {
    flex-direction: row;
    gap: 0;
  }

  .nav-list a {
    padding: calc(var(--space-unit) * 1) calc(var(--space-unit) * 1.5);
  }

  .about-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }

  .program-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr 1.1fr;
    align-items: start;
  }

  .footer-inner {
    grid-template-columns: 1.4fr 1fr;
  }

  .footer-bottom {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .program-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section {
    padding: calc(var(--space-unit) * 10) 0;
  }

  .hero {
    padding: calc(var(--space-unit) * 8) 0 calc(var(--space-unit) * 10);
  }
}
