/* ==========================================================================
   Doggie — Our Favorite Weirdo
   Palette: earthy sage, warm terracotta, honey, cream — nature-inspired & warm
   ========================================================================== */

:root {
  /* Earthy, natural palette */
  --sage:            #7D8B69;
  --sage-light:      #A3B18A;
  --sage-dark:       #5F6B4E;
  --terracotta:      #C2785C;
  --terracotta-light:#D4997F;
  --honey:           #D4A373;
  --cream:           #FAF6F0;
  --warm-white:      #FDFCF9;
  --sand:            #F0E8DE;
  --soft-sage:       #EEF2E9;
  --bark:            #3D3B37;
  --bark-light:      #5C5853;
  --stone:           #918B82;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --section-pad: 5rem 2rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--bark);
  background: var(--warm-white);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

/* ==========================================================================
   Navigation
   ========================================================================== */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(253, 252, 249, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  transition: box-shadow 0.3s ease;
}

#nav.scrolled {
  box-shadow: 0 2px 24px rgba(61, 59, 55, 0.06);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sage-dark);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--bark-light);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--sage);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--bark);
  cursor: pointer;
}

/* ==========================================================================
   Hero
   ========================================================================== */

#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(
    160deg,
    var(--soft-sage) 0%,
    var(--cream) 40%,
    var(--sand) 80%,
    var(--warm-white) 100%
  );
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 25% 40%, rgba(125, 139, 105, 0.07) 0%, transparent 70%),
              radial-gradient(ellipse at 75% 60%, rgba(212, 163, 115, 0.06) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: var(--sage-dark);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--bark-light);
  margin-bottom: 3rem;
}

/* Countdown */
.countdown {
  margin-top: 1rem;
}

.countdown-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.countdown-timer {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-unit span {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--sage);
  line-height: 1;
}

.countdown-unit small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  margin-top: 0.3rem;
  font-weight: 500;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bob 2s ease-in-out infinite;
}

.scroll-hint span {
  font-size: 1.5rem;
  color: var(--sage-light);
}

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

/* ==========================================================================
   Sections (shared)
   ========================================================================== */

.section {
  padding: var(--section-pad);
}

.section-alt {
  background: var(--cream);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--sage-dark);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--stone);
  margin-bottom: 3rem;
}

/* ==========================================================================
   About / Her Story
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}

.about-photo {
  position: relative;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1rem;
  background: var(--soft-sage);
  border: 2px dashed var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.photo-placeholder:hover {
  border-color: var(--sage);
  background: var(--sand);
}

.photo-placeholder span {
  color: var(--sage-light);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
  font-weight: 500;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

.photo-placeholder.has-photo {
  border: none;
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--bark);
  margin-bottom: 1.2rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--bark-light);
}

/* ==========================================================================
   Quirks / Doggie-isms
   ========================================================================== */

.quirks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.quirk-card {
  background: var(--warm-white);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--sand);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quirk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(125, 139, 105, 0.1);
}

.quirk-icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  color: var(--terracotta);
}

.quirk-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sage-dark);
  margin-bottom: 0.5rem;
}

.quirk-card p {
  font-size: 0.95rem;
  color: var(--bark-light);
  line-height: 1.7;
}

.quirk-card .quirk-author {
  font-size: 0.8rem;
  color: var(--stone);
  font-style: italic;
  margin-top: 0.8rem;
}

/* ==========================================================================
   Bonds
   ========================================================================== */

.bonds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.bond-card {
  background: var(--cream);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--sand);
  position: relative;
}

.bond-featured {
  background: linear-gradient(135deg, var(--soft-sage), var(--cream));
  border: 2px solid var(--sage-light);
  grid-column: 1 / -1;
}

.bond-badge {
  display: inline-block;
  background: var(--terracotta);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

.bond-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sage-dark);
  margin-bottom: 0.8rem;
}

.bond-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bark-light);
}

.bond-author {
  font-size: 0.85rem;
  color: var(--stone);
  font-style: italic;
  margin-top: 1rem;
}

/* ==========================================================================
   Memory Wall
   ========================================================================== */

.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.memory-card {
  background: var(--warm-white);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--sand);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.memory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(125, 139, 105, 0.1);
}

.memory-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.memory-card-body {
  padding: 1.5rem;
}

.memory-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sage-dark);
  margin-bottom: 0.5rem;
}

.memory-card p {
  font-size: 0.93rem;
  color: var(--bark-light);
  line-height: 1.7;
}

.memory-card .memory-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--stone);
  font-style: italic;
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  position: relative;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--sage-light), var(--sand));
}

.timeline-item {
  position: relative;
  padding-left: 55px;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 12px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage);
  border: 3px solid var(--warm-white);
  box-shadow: 0 0 0 2px var(--sage-light);
}

.timeline-content {
  background: var(--cream);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--sand);
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sage-dark);
  margin-bottom: 0.3rem;
}

.timeline-content .timeline-date {
  font-size: 0.8rem;
  color: var(--stone);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  font-size: 0.95rem;
  color: var(--bark-light);
  line-height: 1.7;
}

.timeline-content .timeline-author {
  font-size: 0.8rem;
  color: var(--stone);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Photo Gallery
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(61, 59, 55, 0.7));
  color: white;
  padding: 1.5rem 0.8rem 0.8rem;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(61, 59, 55, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.lightbox-close:hover {
  opacity: 1;
}

#lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
  color: white;
  font-size: 0.95rem;
  margin-top: 1rem;
  opacity: 0.8;
}

/* ==========================================================================
   Forms & Buttons
   ========================================================================== */

.add-section {
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-add {
  background: transparent;
  border: 2px dashed var(--sage-light);
  color: var(--sage);
  padding: 0.8rem 2rem;
}

.btn-add:hover {
  border-color: var(--sage);
  color: var(--sage-dark);
  background: var(--soft-sage);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.btn-save {
  background: var(--sage);
  color: white;
  font-weight: 500;
}

.btn-save:hover {
  background: var(--sage-dark);
}

.btn-cancel {
  background: transparent;
  color: var(--stone);
}

.btn-cancel:hover {
  color: var(--bark);
}

.add-form {
  max-width: 500px;
  margin: 1.5rem auto 0;
  text-align: left;
}

.add-form input[type="text"],
.add-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--sand);
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--bark);
  background: var(--warm-white);
  margin-bottom: 0.8rem;
  transition: border-color 0.3s ease;
  outline: none;
}

.add-form input[type="text"]:focus,
.add-form textarea:focus {
  border-color: var(--sage);
}

.add-form textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-actions input[type="text"] {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.file-label {
  display: block;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--sage-light);
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  color: var(--sage);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
  transition: all 0.3s ease;
}

.file-label:hover {
  border-color: var(--sage);
  background: var(--soft-sage);
}

.file-label input {
  display: none;
}

.file-label-large {
  padding: 2rem;
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--soft-sage);
  border-top: 1px solid var(--sand);
}

.footer p {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--sage-dark);
}

.footer-sub {
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  font-style: normal !important;
  color: var(--stone) !important;
  margin-top: 0.5rem;
}

/* Family Code Modal */
.family-code-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(61, 59, 55, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.family-code-modal {
  background: var(--warm-white);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(61, 59, 55, 0.2);
}

.family-code-modal h3 {
  font-family: var(--font-display);
  color: var(--sage-dark);
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.family-code-modal > p {
  font-size: 0.9rem;
  color: var(--stone);
  margin-bottom: 1.2rem;
}

.family-code-modal input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--sand);
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  text-align: center;
  color: var(--bark);
  background: white;
  outline: none;
  transition: border-color 0.3s ease;
  letter-spacing: 0.1em;
}

.family-code-modal input[type="text"]:focus {
  border-color: var(--sage);
}

.family-code-error {
  color: var(--terracotta);
  font-size: 0.85rem;
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.family-code-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.2rem;
}

/* Locked banner */
.locked-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--sage);
  color: white;
  text-align: center;
  padding: 1rem 2rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --section-pad: 3.5rem 1.2rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--warm-white);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--sand);
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    max-width: 300px;
    margin: 0 auto;
  }

  .bonds-grid {
    grid-template-columns: 1fr;
  }

  .bond-featured {
    grid-column: auto;
  }

  .memories-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .countdown-timer {
    gap: 1rem;
  }

  .countdown-unit span {
    font-size: 2rem;
  }

  .hero-name {
    font-size: clamp(3rem, 12vw, 5rem);
  }
}

@media (max-width: 480px) {
  .form-actions {
    flex-direction: column;
  }

  .form-actions input[type="text"] {
    width: 100%;
  }

  .quirks-grid {
    grid-template-columns: 1fr;
  }
}
