/* ============================================
   HOPE STORY MEDIA — Global Styles
   Dark cinematic theme, green accent
   ============================================ */

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-overlay: rgba(10, 10, 10, 0.75);
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #5a8a5c;
  --accent-light: #7ab87c;
  --accent-dark: #3d6b3f;
  --border: #222222;
  --border-light: #333333;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --nav-height: 72px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-primary); }

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

.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; }

h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }

p { color: var(--text-secondary); max-width: 680px; }
p + p { margin-top: 1em; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo img { height: 32px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  padding: 0.25em 0;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent-light);
  transition: width var(--transition);
}

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

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

.nav__socials {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav__socials a {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition);
}
.nav__socials a:hover { color: var(--accent-light); }

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.hero__logo {
  max-width: 360px;
  margin: 0 auto 2rem;
  opacity: 0;
  animation: fadeUp 1s 0.3s ease forwards;
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 1s 0.6s ease forwards;
}

/* --- Page Header (inner pages) --- */
.page-header {
  padding: calc(var(--nav-height) + 4rem) 0 3rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.page-header--tall {
  padding: calc(var(--nav-height) + 5rem) 0 4rem;
  position: relative;
  overflow: hidden;
}

.page-header h1 {
  opacity: 0;
  animation: fadeUp 0.8s 0.2s ease forwards;
}

.page-header p {
  margin-top: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s ease forwards;
}

/* --- Section Layout --- */
.section {
  padding: 5rem 0;
}

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

.section__header {
  margin-bottom: 3rem;
}

.section__header h2 {
  margin-bottom: 0.75rem;
}

.section__divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin-top: 1.5rem;
}

/* --- Project Grid (Home + Impact Stories) --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.project-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-card__img {
  transform: scale(1.05);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover .project-card__overlay { opacity: 1; }

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
}

.project-card__caption {
  padding: 1rem 1.25rem 1.25rem;
}

.project-card__caption h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.project-card__caption p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Impact Story Cards (larger, full-width) --- */
.impact-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 3rem;
  background: var(--bg-card);
  transition: transform var(--transition);
}

.impact-card:hover { transform: translateY(-3px); }

.impact-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.impact-card__body {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.impact-card__body h3 {
  font-size: 1.3rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.8rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent-light);
  border-radius: 3px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* --- Client Logos --- */
.client-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2.5rem 3rem;
  padding: 2rem 0;
}

.client-logos img {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  transition: opacity var(--transition);
}

.client-logos img:hover { opacity: 0.85; }

/* --- Who We Are Tagline Bar --- */
.tagline-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 3rem 0;
}

.tagline-bar span {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--accent-light);
  opacity: 0.8;
}

/* --- Image Gallery (Who We Are) --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.gallery img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 4px;
}

/* --- Film Detail Section --- */
.film-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.film-section:last-of-type { border-bottom: none; }

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

.film-section__video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
}

.film-section__video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.film-section__text h2 {
  margin-bottom: 1rem;
}

.film-section__text p {
  font-size: 0.95rem;
  line-height: 1.8;
}

/* --- Impact Story Detail (sub-pages) --- */
.story-detail {
  padding: calc(var(--nav-height) + 3rem) 0 4rem;
}

.story-detail__hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2.5rem;
}

.story-detail__video {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding-bottom: 45%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  margin: 2.5rem 0;
}

.story-detail__video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.story-detail h1 {
  margin-bottom: 1.5rem;
}

.story-detail p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 760px;
}

.story-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.story-detail__back:hover { color: var(--accent-light); }

/* --- Footer --- */
.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer__connect h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer__connect a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.footer__connect a:hover { color: var(--accent-light); }

.footer__socials {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.footer__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all var(--transition);
}
.footer__socials a:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(10,10,10,0.97);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  .hero { min-height: 80vh; }
  .hero__logo { max-width: 240px; }

  .film-section__content {
    grid-template-columns: 1fr;
  }

  .impact-card__body {
    flex-direction: column;
    align-items: flex-start;
  }

  .tagline-bar {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .footer__inner {
    flex-direction: column;
  }

  .section { padding: 3.5rem 0; }

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

  .story-detail__video {
    padding-bottom: 56.25%;
  }
}

@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .client-logos img { height: 36px; }
  .client-logos { gap: 1.5rem 2rem; }
}
