/* =================================================================
   For Baba Onyango — Father's Day tribute
   Design system + all sections
   ================================================================= */

:root {
  --gold-light: #FDF3DC;
  --gold-mid: #F5C842;
  --gold-deep: #D4A017;
  --amber-warm: #B8860B;
  --cream: #FEF9EF;
  --brown-text: #3D2B1F;
  --brown-muted: #7A5C3A;
  --rose-accent: #C0705A;
  --white: #FFFFFF;

  --shadow-card: 0 2px 16px rgba(180, 130, 60, 0.10);
  --shadow-msg: 0 2px 12px rgba(180, 130, 60, 0.10);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--brown-muted);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%; /* stop iOS from inflating text */
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--brown-text);
  font-weight: 700;
  line-height: 1.15;
}

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

em { font-style: italic; }

/* A short gold bar used as a section accent / divider. */
.flag-bar {
  background: linear-gradient(
    to right,
    var(--gold-mid) 0%,
    var(--gold-deep) 100%
  ) !important;
}

/* ---------- Shared section heading + accent ---------- */
.section-heading {
  font-size: 36px;
  text-align: center;
}

.section-underline {
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 99px;
  margin: 10px auto 0;
  background: var(--gold-deep);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  border: none;
  border-radius: 32px;
  cursor: pointer;
  transition: transform 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.btn--primary {
  background: var(--gold-deep);
  color: var(--white);
  height: 48px;
  padding: 0 28px;
}

.btn--primary:hover {
  background: var(--amber-warm);
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.35);
}

.btn--block { width: 100%; }

.btn--pulse:hover { animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.10);
  color: var(--gold-mid);
  border: 1px solid rgba(245, 200, 66, 0.45);
  padding: 12px 24px;
  position: relative;
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.18); }

/* =================================================================
   SECTION 1 — HERO
   ================================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* avoids the mobile address-bar height jump */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--brown-text); /* fallback while the photo loads */
}

/* The photo of Baba fills the whole hero */
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%; /* favour the faces */
  z-index: 0;
}

/* Warm scrim so the text stays readable over the photo */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 38%, transparent 0%, rgba(38, 26, 18, 0.35) 70%, rgba(38, 26, 18, 0.7) 100%),
    linear-gradient(180deg, rgba(38, 26, 18, 0.55) 0%, rgba(38, 26, 18, 0.35) 40%, rgba(38, 26, 18, 0.82) 100%);
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.particle {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: var(--gold-mid);
  animation-name: float;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

.hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  width: 100%;
  max-width: 760px;
}

.hero__label {
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-mid);
  margin-bottom: 18px;
}

.hero__heading {
  font-size: 72px;
  color: var(--white);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.hero__name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 96px;
  color: var(--gold-mid);
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
  margin: 4px 0 16px;
}

.hero__subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  max-width: 560px;
}

.hero__swahili {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--gold-light);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  margin-top: 8px;
}

.hero__divider {
  display: block;
  width: 96px;
  height: 4px;
  border-radius: 99px;
  margin: 24px 0 0;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: var(--gold-light);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5));
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* =================================================================
   Reveal-on-scroll (IntersectionObserver)
   ================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

/* =================================================================
   SECTION 2 — DEDICATION
   ================================================================= */
.dedication {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* Photo + note side by side on desktop */
.dedication__body {
  display: flex;
  align-items: stretch;
  gap: 32px;
  margin-top: 40px;
}

.dedication__photo {
  flex: 0 0 40%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  /* gold frame edge */
  border-bottom: 5px solid var(--gold-deep);
}

.dedication__photo img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.quote-card {
  flex: 1;
  position: relative;
  background: var(--white);
  padding: 48px;
  border-left: 4px solid var(--gold-deep);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.quote-card__mark {
  position: absolute;
  top: -10px;
  left: 18px;
  font-family: 'Playfair Display', serif;
  font-size: 96px;
  line-height: 1;
  color: var(--gold-light);
  pointer-events: none;
}

.quote-card__text {
  position: relative;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1.9;
  color: var(--brown-text);
  white-space: pre-line;
}

.quote-card__author {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--brown-muted);
  text-align: right;
  margin-top: 24px;
}

/* =================================================================
   SECTION 3 — WATOTO WAKO (Your Children)
   ================================================================= */
.children {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 24px;
}

.children__subheading {
  text-align: center;
  font-size: 16px;
  color: var(--brown-muted);
  margin: 18px auto 40px;
  max-width: 560px;
}

.children__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.child-card {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 32px 20px;
  text-align: center;
  overflow: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

/* Tri-colour stripe down the left edge of each child card */
.child-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(
    to bottom,
    var(--gold-mid) 0%,
    var(--gold-deep) 100%
  );
}

.child-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(180, 130, 60, 0.22);
}

.child-card__baba {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-warm);
}

.child-card__name {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--brown-text);
  margin-top: 4px;
}

/* =================================================================
   SECTION 4 — MESSAGE BOARD
   ================================================================= */
.board {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

.board__subheading {
  text-align: center;
  font-size: 16px;
  color: var(--brown-muted);
  margin: 18px auto 40px;
  max-width: 600px;
}

/* ---------- Wall of handwritten notes ---------- */
.notes-wall {
  columns: 3;
  column-gap: 22px;
  margin: 0 auto 8px;
}

.note-card {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: center;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* The paper itself: a white mat with a soft shadow */
.note-card__paper {
  display: block;
  background: var(--white);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(120, 85, 40, 0.16);
  transition: transform 350ms ease, box-shadow 350ms ease;
}

.note-card__paper img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.note-card__name {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--brown-text);
  margin-top: 12px;
}

/* Pin them up at playful angles on larger screens; straighten on hover */
@media (min-width: 640px) {
  .note-card:nth-child(3n + 1) .note-card__paper { transform: rotate(-1.6deg); }
  .note-card:nth-child(3n + 2) .note-card__paper { transform: rotate(1.1deg); }
  .note-card:nth-child(3n + 3) .note-card__paper { transform: rotate(-0.6deg); }
}

@media (hover: hover) {
  .note-card:hover .note-card__paper {
    transform: rotate(0deg) translateY(-6px);
    box-shadow: 0 16px 36px rgba(120, 85, 40, 0.28);
  }
}

/* ---------- "Add your own" sub-area ---------- */
.board__add {
  margin-top: 72px;
  text-align: center;
}

.board__add-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--brown-text);
}

.board__add .section-underline { margin-bottom: 32px; }

.form-card {
  background: var(--white);
  padding: 32px;
  max-width: 600px;
  margin: 0 auto 48px;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.field { margin-bottom: 18px; }

.field input[type="text"],
.field textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* 16px keeps iOS from auto-zooming on focus */
  color: var(--brown-text);
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.field input::placeholder,
.field textarea::placeholder { color: #b9a587; }

.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

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

.field--shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.field__error {
  color: var(--rose-accent);
  font-size: 13px;
  margin-top: 6px;
}

/* ---------- Photo upload ---------- */
.photo-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--cream);
  border: 1.5px dashed var(--gold-deep);
  border-radius: 12px;
  cursor: pointer;
  color: var(--amber-warm);
  font-size: 14px;
  transition: background 300ms ease, border-color 300ms ease;
}

.photo-upload:hover {
  background: var(--gold-light);
  border-color: var(--amber-warm);
}

.photo-upload__icon { font-size: 20px; }

.photo-preview {
  position: relative;
  margin-top: 12px;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(14, 14, 14, 0.6);
  color: var(--white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-remove:hover { background: rgba(200, 16, 46, 0.85); }

.form-card__note {
  text-align: center;
  font-size: 12px;
  color: var(--brown-muted);
  margin-top: 12px;
}

.form-success {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--brown-text);
  padding: 24px 8px;
}

.fade-out { animation: fadeOut 400ms ease forwards; }
.fade-in { animation: fadeIn 400ms ease forwards; }

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

.board__offline {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--rose-accent);
  margin: 0 auto 40px;
}

/* ---------- Messages grid ---------- */
.board__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.msg-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-msg);
  padding: 24px;
  animation: cardIn 500ms ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Photo at the top of a message card */
.msg-card__photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 3px var(--gold-light), var(--shadow-msg);
}

.msg-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.msg-card__name {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--brown-text);
}

.msg-card__time {
  font-size: 12px;
  color: var(--brown-muted);
  white-space: nowrap;
}

.msg-card__divider {
  height: 1px;
  width: 100%;
  background: var(--gold-light);
  margin: 12px 0;
}

.msg-card__body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--brown-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-card__bottom { margin-top: 16px; }

.heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--rose-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;     /* comfortable touch target */
  padding: 6px 12px;
  border-radius: 99px;
  transition: background 300ms ease;
}

.heart-btn:hover { background: rgba(192, 112, 90, 0.08); }
.heart-btn.is-hearted { font-weight: 500; }
.heart-btn.pop { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Empty state ---------- */
.board__empty {
  text-align: center;
  padding: 40px 16px;
}

.board__empty-emoji {
  font-size: 64px;
  display: block;
  margin-bottom: 12px;
}

.board__empty-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--brown-muted);
}

/* ---------- Lightbox (read a note full-size) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 14, 9, 0.92);
}

.lightbox.is-open { display: flex; }

.lightbox__figure {
  margin: 0;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  background: var(--white);
  padding: 10px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox__caption {
  margin-top: 16px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--gold-light);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 300ms ease;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.26); }

.lightbox__close {
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 38px;
  line-height: 1;
}

.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }

/* =================================================================
   SECTION 5 — FOOTER
   ================================================================= */
.footer {
  position: relative;
  background: var(--brown-text);
  padding: 56px 24px 48px;
  text-align: center;
}

.footer__flag {
  display: block;
  width: 120px;
  height: 5px;
  border-radius: 99px;
  margin: 0 auto 24px;
}

.footer__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 24px;
  color: var(--gold-mid);
}

.footer__subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}

.footer__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-deep);
  color: var(--white);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.tooltip.is-visible { opacity: 1; }

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Tablet: 640px – 1023px */
@media (max-width: 1023px) {
  .children__grid { grid-template-columns: repeat(2, 1fr); }
  .notes-wall { columns: 2; }
}

/* Mobile: < 640px */
@media (max-width: 639px) {
  .hero__heading { font-size: 40px; }
  .hero__name { font-size: 56px; }
  .hero__subtitle { font-size: 16px; }

  .section-heading { font-size: 28px; }

  .dedication { padding: 60px 20px; }
  .dedication__body { flex-direction: column; gap: 24px; }
  .dedication__photo { flex: none; }
  .dedication__photo img { min-height: 240px; max-height: 360px; }
  .quote-card { padding: 36px 28px; }
  .quote-card__text { font-size: 18px; }

  .children { padding: 60px 20px; }
  .children__grid { grid-template-columns: 1fr; }

  .board { padding: 60px 20px; }
  .form-card { padding: 24px; }
  .board__grid { grid-template-columns: 1fr; }

  .notes-wall { columns: 1; column-gap: 0; }
  .board__add { margin-top: 56px; }
  .board__add-title { font-size: 22px; }

  .lightbox { padding: 12px; }
  .lightbox__img { max-height: 76vh; }
  .lightbox__caption { font-size: 17px; margin-top: 12px; }
  .lightbox__nav { width: 44px; height: 44px; font-size: 30px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 12px; right: 12px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
