/*
 * Global Styles for the Chris Jeffery personal website
 *
 * This stylesheet defines a contemporary and responsive visual identity. It leverages
 * CSS custom properties to centralise colours, and uses modern layout techniques
 * (flexbox and grid) for a fluid, flexible design. Careful attention has been paid
 * to accessibility: high contrast text, large tap targets and responsive
 * breakpoints ensure the site is usable across devices and by users relying
 * on assistive technology.
 */

:root {
  /* Colour palette inspired by deep blues and warm oranges in the hero artwork */
  --color-primary: #0d1b2a;      /* dark navy for headers and footer */
  --color-secondary: #f4f9f9;    /* very light neutral for alternating sections */
  --color-accent: #e76f51;       /* warm coral for calls to action and highlights */
  --color-light: #ffffff;        /* pure white for text on dark backgrounds */
  --color-muted: #f7f9fc;        /* off‑white background */
  --body-text: #2b2b2b;          /* dark grey body text */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--body-text);
  background-color: var(--color-muted);
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Navigation bar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 999;
  transition: background-color 0.3s ease;
}

nav.scrolled {
  background-color: rgba(13, 27, 42, 0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav .logo {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-light);
  letter-spacing: 0.5px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: var(--color-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: color 0.2s ease;
}

nav ul li a:hover,
nav ul li a:focus {
  color: var(--color-accent);
}

/* Hamburger for mobile navigation */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  width: 24px;
  height: 20px;
  justify-content: space-between;
}

.hamburger .bar {
  width: 100%;
  height: 3px;
  background-color: var(--color-light);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.open .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  nav ul {
    position: fixed;
    left: -100%;
    top: 64px;
    flex-direction: column;
    width: 100%;
    background-color: rgba(13, 27, 42, 0.95);
    padding: 24px 0;
    gap: 0;
    transition: left 0.3s ease;
  }
  nav ul.open {
    left: 0;
  }
  nav ul li {
    margin: 12px 0;
    text-align: center;
  }
  .hamburger {
    display: flex;
  }
}

/* Hero section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: #000; /* fallback / behind video */
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;         /* default: cinematic fill */
  object-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1;
}

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

@media (max-width: 768px) {
  /* On phones: show the entire video, no cropping */
  .hero-video {
    object-fit: contain;
    background: #000; /* fills behind if letterboxing appears */
  }

  .hero {
    min-height: 80vh; /* less tall so text doesn’t feel lost */
  }

  .hero-content h1 { font-size: 2rem; }
  .hero-content p  { font-size: 1rem; }
}

.hero-content h1 {
  font-family: 'Lora', serif;
  font-size: 56px;
  margin: 0;
}

.hero-content p {
  font-size: 20px;
  margin: 12px 0 24px;
  letter-spacing: 0.5px;
}

.cta-button {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--color-accent);
  color: var(--color-light);
  border-radius: 4px;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.cta-button:hover,
.cta-button:focus {
  background-color: #c95f45;
}

/* Section styling */
.section {
  padding: 80px 0;
}

.section:nth-of-type(even) {
  background-color: var(--color-secondary);
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.section h2 {
  font-family: 'Lora', serif;
  font-size: 32px;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  color: var(--color-primary);
}

.subheading {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  font-family: 'Lora', serif;
}

/* Grid layout: text left, video right */

/* Center the section, keep breathing room on sides */
.about-container {
  max-width: 1200px;         /* adjust to taste (1000–1200 is common) */
  margin: 0 auto;            /* centers the block */
  padding: 0 clamp(20px, 5vw, 60px); /* ensures some left/right padding */
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;   /* text grows, video column only as wide as needed */
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
}

/* Optional: keep lines a comfortable width */
.about-text {
  max-width: 60ch;
}

/* Media block */
.about-media {
  display: flex;
  justify-content: center;
}

/* Video styling: fills its column, keeps shape, never overflows */
.about-video {
  display: block;
  height: auto;          /* keep natural ratio */
  width: auto;           /* don’t stretch to fill */
  max-height: 70vh;      /* don’t overflow the screen */
  max-width: 100%;       /* responsive safeguard */
  object-fit: contain;   /* no cropping */
  border-radius: 8px;    /* optional */
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}


/* Stack on small screens (text first, video below) */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-media {
    max-width: 520px;
    margin-inline: auto;
  }
}

/* Respect reduced-motion preferences: show the first frame instead of looping */
@media (prefers-reduced-motion: reduce) {
  .about-video {
    animation: none;
  }
  .about-video[autoplay] {
    /* most browsers still require JS to truly stop autoplay;
       this ensures no styling depends on motion */
  }
}


/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.card {
  background-color: var(--color-light);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  /* Top padding removed to allow thumbnail to span full width; bottom padding reserved for text */
  padding: 0 16px 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  overflow: hidden; /* ensure the image respects rounded corners */
}

.card:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

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

.card h3 {
  font-size: 20px;
  margin: 12px 0 16px;
  color: var(--color-primary);
}

/* Thumbnail images inside cards */
.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: var(--color-primary);
  color: var(--color-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.play-btn:hover,
.play-btn:focus {
  background-color: var(--color-accent);
}

/* Timeline layout */
.timeline {
  position: relative;
  margin-top: 20px;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-accent);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.timeline-item h4 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--color-accent);
  font-weight: 700;
}

.timeline-item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: var(--color-light);
  width: 100%;
  max-width: 800px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #666;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
  color: #000;
}

.modal iframe {
  width: 100%;
  height: 450px;
  border: none;
}

/* Container centered with side padding (matches About container) */
.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}

/* Two-column layout that collapses on mobile */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}

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

/* Composer section */
.composer-cta {
  text-align: center;
  margin: 3rem auto;
  padding: 2rem;
  max-width: 700px;
  background: linear-gradient(135deg, #1e1e1e, #2c2c2c);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.composer-cta p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #f5f5f5;
  margin: 0;
}

.composer-cta a {
  color: #ff5555;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.composer-cta a:hover {
  color: #ff7777;
  text-shadow: 0 0 6px rgba(255, 85, 85, 0.8);
}

/* Details column */
.contact-details h3 {
  margin: 0 0 8px;
  color: var(--color-primary, #0d1b2a);
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.contact-list li + li { margin-top: 8px; }

/* Footer */
footer {
  background-color: var(--color-primary);
  color: var(--color-light);
  text-align: center;
  padding: 40px 0;
  font-size: 14px;
}