/* =========================================================
   Dr. Michael Merogun Campaign — Design System
   Editorial Statesman aesthetic
   ========================================================= */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ----- CSS Custom Properties ----- */
:root {
  /* Colours */
  --navy: #061A63;
  --navy-dark: #040F3D;
  --ndc-blue: #102D8C;
  --red: #EF2E32;
  --red-dark: #C82024;
  --constituency-blue: #20A7E8;
  --constituency-blue-light: #60C4F0;
  --off-white: #F8F7F4;
  --off-white-dark: #EDEBE6;
  --charcoal: #1A1A2E;
  --charcoal-light: #2D2D42;
  --white: #FFFFFF;
  --gray-100: #F0F0F0;
  --gray-200: #E0E0E0;
  --gray-300: #B0B0B0;
  --gray-400: #808080;
  --gray-500: #505050;

  /* Typography */
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Sizing */
  --max-width: 1200px;
  --content-width: 800px;
  --nav-height: 72px;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Focus */
  --focus-ring: 0 0 0 3px var(--red);

  /* Z-index */
  --z-nav: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-cookie: 500;
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--charcoal);
  background-color: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--constituency-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--red); }

/* Focus ring */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Lists */
ul, ol { list-style: none; }

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--charcoal);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

.text-small { font-size: 0.875rem; }
.text-large { font-size: 1.125rem; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.text-mono { font-variant-numeric: tabular-nums; }

/* Red slash accent divider */
.accent-slash {
  display: block;
  width: 60px;
  height: 4px;
  background: var(--red);
  margin: var(--space-md) 0 var(--space-lg);
  border-radius: 2px;
}
.accent-slash.center { margin-left: auto; margin-right: auto; }

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--content-width);
}

.container--full {
  max-width: 100%;
  padding: 0;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.2;
}

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

.btn--primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn--primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn--secondary:hover {
  background: var(--white);
  color: var(--navy);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn--small {
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-lg);
}

.btn--large {
  font-size: 1.125rem;
  padding: var(--space-lg) var(--space-2xl);
}

/* ----- Navigation ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: var(--nav-height);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  color: var(--white);
}

.nav__logo {
  height: 36px;
  width: auto;
  border-radius: var(--radius-sm);
}

.nav__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav__candidate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  white-space: nowrap;
}

.nav__office {
  font-size: 0.65rem;
  color: var(--constituency-blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: 10;
}

.nav__toggle svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav__link {
  color: rgba(255,255,255,0.8);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.nav__link--active {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* ----- Hero ----- */
.hero {
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.02) 50%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.02) 50%, transparent 52%);
  background-size: 60px 60px;
  opacity: 0.4;
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--constituency-blue);
  margin-bottom: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid rgba(32, 167, 232, 0.3);
  border-radius: 100px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--white);
  line-height: 1.08;
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-2xl);
  max-width: 540px;
  line-height: 1.6;
}

.hero__subtitle strong {
  color: var(--constituency-blue);
  font-weight: 600;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.hero__image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hero__image img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  object-fit: cover;
  aspect-ratio: 3/4;
}

.hero__image::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(32,167,232,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

/* ----- Sections ----- */
.section {
  padding: var(--space-4xl) 0;
}

.section--dark {
  background: var(--navy);
  color: var(--white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--white);
}

.section--dark .text-muted {
  color: rgba(255,255,255,0.6);
}

.section--gray {
  background: var(--gray-100);
}

.section__header {
  text-align: center;
  max-width: var(--content-width);
  margin: 0 auto var(--space-3xl);
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--red);
  margin-bottom: var(--space-sm);
}

/* ----- Cards ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--gray-200);
}

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

.card--dark {
  background: var(--ndc-blue);
  color: var(--white);
  border-color: transparent;
}

.card--dark h3,
.card--dark .card__text {
  color: var(--white);
}

.card--dark:hover {
  background: #1535A0;
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(6, 26, 99, 0.3);
}

.card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--red);
}

.card--dark .card__icon {
  color: var(--constituency-blue);
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.card__text {
  color: var(--gray-500);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ----- Tags ----- */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-xs) var(--space-md);
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--charcoal-light);
}

.tag--red {
  background: rgba(239, 46, 50, 0.1);
  color: var(--red);
}

.tag--blue {
  background: rgba(32, 167, 232, 0.1);
  color: var(--constituency-blue);
}

.tag--white {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* ----- Accordion (Timeline) ----- */
.accordion {
  border-top: 2px solid var(--gray-200);
}

.accordion__item {
  border-bottom: 1px solid var(--gray-200);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  text-align: left;
  transition: color var(--transition-fast);
}

.accordion__trigger:hover {
  color: var(--red);
}

.accordion__trigger[aria-expanded="true"] {
  color: var(--red);
}

.accordion__icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(180deg);
}

.accordion__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.accordion__panel[aria-hidden="false"] {
  max-height: 600px;
}

.accordion__content {
  padding: 0 0 var(--space-lg);
}

/* ----- Timeline ----- */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline__item {
  position: relative;
  padding-left: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.timeline__date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.timeline__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

.timeline__text {
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ----- Forms ----- */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form__label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--charcoal);
}

.form__label .required {
  color: var(--red);
}

.form__input,
.form__textarea,
.form__select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--charcoal);
  transition: border-color var(--transition-fast);
  width: 100%;
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  border-color: var(--constituency-blue);
  box-shadow: 0 0 0 3px rgba(32, 167, 232, 0.15);
}

.form__textarea {
  min-height: 120px;
  resize: vertical;
}

.form__error {
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
}

.form__input.error,
.form__textarea.error {
  border-color: var(--red);
}

.form__input.error ~ .form__error,
.form__textarea.error ~ .form__error {
  display: block;
}

.form__checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form__checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  cursor: pointer;
}

.form__success {
  display: none;
  padding: var(--space-lg);
  background: rgba(32, 167, 232, 0.1);
  border: 1px solid var(--constituency-blue);
  border-radius: var(--radius-md);
  color: var(--ndc-blue);
  font-weight: 500;
  text-align: center;
}

.form__success.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.form__note {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-style: italic;
}

/* ----- Cookie Banner ----- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-cookie);
  background: var(--charcoal);
  color: var(--white);
  padding: var(--space-lg) 0;
  transform: translateY(100%);
  transition: transform var(--transition-base);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  flex-wrap: wrap;
}

.cookie-banner__text {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  flex: 1;
  min-width: 260px;
}

.cookie-banner__text a {
  color: var(--constituency-blue);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* ----- Toast ----- */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-lg));
  right: var(--space-lg);
  z-index: var(--z-toast);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--constituency-blue);
  font-size: 0.9375rem;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform var(--transition-base);
  max-width: 360px;
}

.toast.show {
  transform: translateX(0);
}

.toast--error {
  border-left-color: var(--red);
}

.toast--success {
  border-left-color: var(--constituency-blue);
}

/* ----- Footer ----- */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__logo {
  height: 40px;
  width: auto;
  max-width: 120px;
  margin-bottom: var(--space-sm);
  object-fit: contain;
}
.footer__candidate {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}

.footer__office {
  font-size: 0.8rem;
  color: var(--constituency-blue);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer__text {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 360px;
}

.footer__heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-md);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--white);
}

.footer__bottom {
  max-width: var(--max-width);
  margin: var(--space-2xl) auto 0;
  padding: var(--space-lg) var(--space-lg) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8rem;
}

.footer__disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  max-width: 100%;
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: var(--space-md);
}

.footer__design {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
}

.footer__design a {
  color: var(--constituency-blue);
  text-decoration: underline;
}

/* ----- Page Header ----- */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: var(--space-4xl) 0 var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.015) 50%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.015) 50%, transparent 52%);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
}

.page-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

.page-header__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--constituency-blue);
  margin-bottom: var(--space-sm);
}

.page-header__title {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.page-header__text {
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  font-size: 1.125rem;
}

/* ----- Breadcrumb (simple) ----- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--constituency-blue);
}

.breadcrumb a:hover {
  color: var(--red);
}

.breadcrumb__sep {
  color: var(--gray-300);
}

/* ----- Source tags ----- */
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  padding: var(--space-xs) var(--space-sm);
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  color: var(--charcoal-light);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.source-link:hover {
  background: var(--gray-200);
  color: var(--navy);
}

.source-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ----- Alerts ----- */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.alert--info {
  background: rgba(32, 167, 232, 0.1);
  border: 1px solid var(--constituency-blue);
  color: var(--ndc-blue);
}

.alert--warning {
  background: rgba(239, 46, 50, 0.08);
  border: 1px solid var(--red);
  color: var(--red-dark);
}

/* ----- Animations ----- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in--1 { animation-delay: 0.1s; }
.fade-in--2 { animation-delay: 0.2s; }
.fade-in--3 { animation-delay: 0.3s; }
.fade-in--4 { animation-delay: 0.4s; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .fade-in { opacity: 1; }
  .card:hover { transform: none; }
  .toast { transform: translateX(0); }
}

/* ----- Small phones (max-width: 400px) ----- */
@media (max-width: 400px) {
  .nav__candidate { font-size: 0.85rem; white-space: normal; }
  .nav__office { font-size: 0.55rem; }
  .nav__logo { height: 28px; }

  .hero { min-height: auto; }
  .hero__inner { padding: var(--space-xl) var(--space-md); }

  .section { padding: var(--space-2xl) 0; }

  .container { padding: 0 var(--space-md); }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .card-grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .card { padding: var(--space-md); }

  .page-header { padding: var(--space-2xl) 0 var(--space-xl); }
}

/* ----- Mobile (max-width: 768px) ----- */
@media (max-width: 768px) {
  :root { --nav-height: 60px; }

  .nav__toggle { display: block; }

  .nav__links {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: var(--navy);
    flex-direction: column;
    padding: var(--space-lg);
    gap: 2px;
    overflow-y: auto;
    z-index: var(--z-overlay);
  }

  .nav__links.open { display: flex; }

  .nav__link {
    font-size: 1rem;
    padding: var(--space-md) var(--space-lg);
    width: 100%;
    border-radius: var(--radius-md);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Hero — show image as circular thumbnail above text */
  .hero { min-height: auto; padding-top: var(--space-xl); }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-lg) var(--space-2xl);
    text-align: center;
  }

  .hero__image {
    display: flex !important;
    justify-content: center;
    align-items: center;
    order: -1;
  }

  .hero__image img {
    max-width: 120px;
    width: 120px;
    height: 120px;
    border-radius: 50% !important;
    object-fit: cover;
    object-position: top center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    aspect-ratio: 1;
  }

  .hero__image::after { display: none; }

  .hero__tag { font-size: 0.65rem; }
  .hero__title { font-size: clamp(1.4rem, 5vw, 2rem); }
  .hero__subtitle { margin-left: auto; margin-right: auto; font-size: 0.9rem; max-width: 100%; }
  .hero__cta { justify-content: center; flex-direction: column; gap: var(--space-sm); }

  .hero__cta .btn { width: 100%; justify-content: center; }

  /* Section spacing */
  .section { padding: var(--space-2xl) 0; }
  .section__header { margin-bottom: var(--space-xl); }

  /* Card grids — single column on mobile */
  .card-grid { grid-template-columns: 1fr; gap: var(--space-md); }

  /* 2-column layouts — stack on mobile */
  [style*="grid-template-columns:"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-xl) !important;
  }

  /* Vision page — pillar rows */
  .pillar-content { order: 1; }

  /* About page */
  .about-grid { grid-template-columns: 1fr !important; gap: var(--space-xl) !important; }
  .about-image { max-width: 200px; margin: 0 auto; }

  /* Contact page */
  .contact-grid { grid-template-columns: 1fr !important; gap: var(--space-xl) !important; }

  /* Forms on mobile */
  .form { gap: var(--space-md); }
  .form__input, .form__textarea, .form__select { font-size: 16px; padding: var(--space-sm) var(--space-md); }

  /* Cookies banner */
  .cookie-banner__inner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-banner__actions { flex-direction: column; gap: var(--space-sm); }
  .cookie-banner__actions .btn { width: 100%; justify-content: center; }

  /* Page header */
  .page-header { padding: var(--space-2xl) 0 var(--space-xl); }
  .page-header__title { font-size: 1.5rem; }
  .page-header__text { font-size: 0.95rem; }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .footer__brand { align-items: center; }
  .footer__text { max-width: 100%; }
  .footer__bottom { flex-direction: column; text-align: center; }
  .footer__links { align-items: center; }
  .footer__link { min-height: 44px; display: flex; align-items: center; justify-content: center; }

  /* Buttons */
  .btn--large { width: 100%; justify-content: center; min-height: 48px; }
  .btn { min-height: 44px; }

  /* Accordion */
  .accordion__trigger { min-height: 48px; padding: var(--space-md) 0; font-size: 0.95rem; }

  /* Toast */
  .toast { left: var(--space-md); right: var(--space-md); max-width: none; }

  /* Tags */
  .tag { min-height: 32px; }
}

/* ----- Tablet adjustments (769-1024px) ----- */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero__inner {
    gap: var(--space-xl);
    padding: var(--space-3xl) var(--space-lg);
  }

  .hero__image img {
    max-width: 320px;
  }

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

  .section { padding: var(--space-3xl) 0; }
}

/* ----- Utility ----- */
.text-center { text-align: center; }
.text-muted { color: var(--gray-400); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mt-3 { margin-top: var(--space-2xl); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.mb-3 { margin-bottom: var(--space-2xl); }