/* ============================================
   One Frame — A Journey Photo Timeline
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Karla:wght@300;400;500;600&display=swap');

/* --- Custom Properties --- */
:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Karla', 'Segoe UI', sans-serif;

  --color-bg: #F5F0EB;
  --color-bg-warm: #EDE6DD;
  --color-card: #FFFFFF;
  --color-nav: #1C2118;
  --color-nav-text: #E8E4DF;
  --color-text: #2D2926;
  --color-text-secondary: #7A7268;
  --color-text-light: #A69E94;
  --color-accent: #4A6741;
  --color-accent-hover: #3A5433;
  --color-accent-light: #6B8C5E;
  --color-stone: #C4B8A8;
  --color-stone-light: #E2DAD0;
  --color-divider: #D9D0C5;

  --shadow-sm: 0 1px 3px rgba(44, 40, 36, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 40, 36, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 40, 36, 0.10);
  --shadow-photo: 0 6px 24px rgba(44, 40, 36, 0.12), 0 2px 8px rgba(44, 40, 36, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 1200px;
  --nav-height: 64px;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-nav);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-nav-text);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav__logo-icon {
  width: 32px;
  height: 24px;
  color: var(--color-accent-light);
  transition: color 0.2s;
}

.nav__logo:hover .nav__logo-icon {
  color: var(--color-nav-text);
}

.nav__logo:hover {
  opacity: 0.8;
  color: var(--color-nav-text);
}

.nav__logo span {
  color: var(--color-accent-light);
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-stone);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-accent-light);
  transition: width 0.3s ease;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--color-nav-text);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* --- Page Content --- */
.page-content {
  margin-top: var(--nav-height);
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem clamp(1.5rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}

/* Subtle topographic background pattern */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='600' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M300 50 Q350 100 300 150 Q250 200 300 250 Q350 300 300 350 Q250 400 300 450 Q350 500 300 550' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3Cpath d='M150 0 Q200 80 150 160 Q100 240 150 320 Q200 400 150 480 Q100 560 150 600' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3Cpath d='M450 0 Q500 80 450 160 Q400 240 450 320 Q500 400 450 480 Q400 560 450 600' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3Cpath d='M0 300 Q80 250 160 300 Q240 350 320 300 Q400 250 480 300 Q560 350 600 300' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3Cpath d='M0 150 Q80 100 160 150 Q240 200 320 150 Q400 100 480 150 Q560 200 600 150' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3Cpath d='M0 450 Q80 400 160 450 Q240 500 320 450 Q400 400 480 450 Q560 500 600 450' fill='none' stroke='%234A6741' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 600px 600px;
}

.hero__inner {
  max-width: 720px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero__photo-wrapper {
  width: 180px;
  height: 180px;
  margin: 0 auto 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-stone-light);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.hero__photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder when no profile photo */
.hero__photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__photo-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--color-stone);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 3rem;
}

.hero__divider {
  width: 48px;
  height: 1.5px;
  background: var(--color-accent);
  margin: 0 auto 2.5rem;
}

.hero__text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.75;
  color: var(--color-text);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero__text p {
  margin-bottom: 1.5rem;
}

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

.hero__text em {
  font-style: italic;
  color: var(--color-accent);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-card);
  background: var(--color-accent);
  padding: 0.9rem 2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
}

.hero__cta:hover {
  background: var(--color-accent-hover);
  color: var(--color-card);
  transform: translateY(-1px);
}

.hero__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.hero__cta:hover svg {
  transform: translateX(3px);
}

/* ============================================
   TIMELINE PAGE
   ============================================ */

.timeline-header {
  padding: 3rem clamp(1.5rem, 4vw, 3rem) 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-header__title {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.timeline-header__count {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  padding-bottom: 0.3rem;
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--color-bg-warm);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.view-toggle__btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.view-toggle__btn svg {
  width: 14px;
  height: 14px;
}

.view-toggle__btn.active {
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.view-toggle__btn:hover:not(.active) {
  color: var(--color-text);
}

/* Timeline Container */
.timeline {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem) 4rem;
  position: relative;
}

/* Year Divider */
.year-divider {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 2.5rem 0 2rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.year-divider.visible {
  opacity: 1;
  transform: translateY(0);
}

.year-divider:first-child {
  margin-top: 1rem;
}

.year-divider__label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.year-divider__line {
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

/* Journey Entry */
.journey-entry {
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.journey-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.journey-entry__photo-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
  background: var(--color-bg-warm);
  aspect-ratio: 16 / 9;
}

.journey-entry__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.journey-entry__photo-wrapper:hover .journey-entry__photo {
  transform: scale(1.015);
}

/* Loading shimmer */
.journey-entry__photo-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    var(--color-bg-warm) 0%,
    var(--color-stone-light) 40%,
    var(--color-bg-warm) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  z-index: 1;
  transition: opacity 0.3s;
}

.journey-entry__photo-wrapper.loaded::before {
  opacity: 0;
  pointer-events: none;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.journey-entry__meta {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0 0.15rem;
  flex-wrap: wrap;
}

.journey-entry__date {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
}

.journey-entry__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-stone);
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

.journey-entry__location {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
}

.journey-entry__caption {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-top: 0.3rem;
  padding: 0 0.15rem;
}

/* Year Scroll Indicator */
.year-nav {
  position: fixed;
  right: clamp(0.8rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.year-nav__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: all 0.25s;
}

.year-nav__label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-stone);
  opacity: 0;
  transform: translateX(5px);
  transition: all 0.25s;
}

.year-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-stone);
  transition: all 0.25s;
  flex-shrink: 0;
}

.year-nav__item:hover .year-nav__label,
.year-nav__item.active .year-nav__label {
  opacity: 1;
  transform: translateX(0);
}

.year-nav__item.active .year-nav__dot {
  background: var(--color-accent);
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.15);
}

.year-nav__item:hover .year-nav__dot {
  background: var(--color-accent-light);
}

/* ============================================
   MAP VIEW
   ============================================ */

.map-container {
  display: none;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem) 4rem;
}

.map-container.active {
  display: block;
}

.timeline.hidden {
  display: none;
}

#map {
  width: 100%;
  height: calc(100vh - var(--nav-height) - 140px);
  min-height: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 200px;
}

.map-popup {
  width: 240px;
}

.map-popup__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.map-popup__info {
  padding: 0.7rem 0.9rem;
}

.map-popup__location {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.map-popup__date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Custom map marker */
.map-marker {
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border: 2.5px solid var(--color-card);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}

.map-marker:hover {
  transform: scale(1.3);
}

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

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .nav__logo {
    font-size: 1.3rem;
  }

  .nav__links {
    gap: 1.2rem;
  }

  .nav__links a {
    font-size: 0.78rem;
  }

  .hero__photo-wrapper {
    width: 140px;
    height: 140px;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .journey-entry {
    margin-bottom: 2.5rem;
  }

  .journey-entry__photo-wrapper {
    border-radius: var(--radius-sm);
  }

  .year-nav {
    display: none;
  }

  #map {
    height: 60vh;
    min-height: 350px;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 1.2rem;
  }

  .hero__text {
    font-size: 1.05rem;
  }

  .timeline {
    padding: 0 1.2rem 3rem;
  }

  .journey-entry__meta {
    flex-direction: column;
    gap: 0.2rem;
  }

  .journey-entry__dot {
    display: none;
  }

  .view-toggle__btn {
    font-size: 0.72rem;
    padding: 0.45rem 0.9rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* Fade-in for page load */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.7s ease forwards;
}

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

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
