/*
  Custom styles for David Olim personal one‑page site
  The design uses a dark, premium palette with bright accent colors.
  Typography comes from Inter for body text and Playfair Display for headings.
*/

/* Root variables for easy theme changes */
:root {
  /* Apple‑inspired light theme palette */
  --bg: #f5f5f7;            /* overall page background, very light grey */
  --surface: #ffffff;       /* card and section background */
  --accent: #0070c9;        /* Apple Blue accent colour */
  --text-light: #1d1d1f;    /* primary dark text colour */
  --text-muted: #6e6e73;    /* secondary muted grey text */
  --radius: 0.75rem;        /* border radius */
  --duration: 0.5s;         /* transition duration */
}

/* Reset & base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000;
  backdrop-filter: blur(10px);
  /* Light translucent background for Apple feel */
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar .logo a {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--text-light);
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar a {
  color: var(--text-light);
  font-weight: 500;
  transition: color var(--duration);
}

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

/* Hide checkbox and hamburger by default */
#nav-toggle,
.hamburger {
  display: none;
}

/* Hero section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: url('assets/_PRZ6897.jpeg');
  background-size: cover;
  background-position: center;
  position: relative;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Light overlay for hero to achieve soft Apple‑style effect */
  /* Use a very light overlay to contrast the dark background image. */
  /* Light overlay; remove heavy blur to keep hero image crisp */
  background: rgba(245, 245, 247, 0.85);
  /* No blur: keep the portrait crisp under the light overlay */
  backdrop-filter: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 1rem;
}

.hero .headline {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero .subheadline {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .hero .headline {
    font-size: 4rem;
  }
  .hero .subheadline {
    font-size: 1.5rem;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background var(--duration), color var(--duration);
  border: 2px solid var(--accent);
  margin-right: 1rem;
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

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

/* Section wrapper */
.section {
  padding: 6rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* About */
.about {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.about .content {
  flex: 1 1 300px;
}

.about .intro {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.about-image {
  flex: 1 1 300px;
  text-align: center;
}

.about-image img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Highlights */
.highlights .highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.highlight-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform var(--duration), box-shadow var(--duration);
}

.highlight-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.highlight-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.highlight-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

/* Journey timeline */
.journey .timeline {
  border-left: 2px solid var(--accent);
  position: relative;
  padding-left: 2rem;
}

.journey .timeline-item {
  margin-bottom: 2rem;
  position: relative;
}

.journey .timeline-item::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: -7px;
  top: 0.3rem;
}

.journey .timeline-item .year {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.journey .timeline-item p {
  color: var(--text-muted);
}

/* Roles */
.roles .role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.roles .role-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.roles .role-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.roles .role-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.roles .role-content h3 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.roles .role-content p {
  color: var(--text-muted);
  margin-bottom: auto;
}

.roles .role-link {
  margin-top: 1rem;
  align-self: flex-start;
  font-weight: 500;
}

/* Awards */
.awards .awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.award-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.award-card h3 {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.award-card p {
  color: var(--text-muted);
}

/* Speaking */
.speaking .speaking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.speaking .speaking-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.speaking .speaking-text {
  text-align: center;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
}

/* News */
.news .news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.news-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.news-card .meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.news-card p {
  color: var(--text-muted);
  flex-grow: 1;
}

.news-card a {
  margin-top: 1rem;
  display: inline-block;
  color: var(--accent);
  font-weight: 500;
}

/* Gallery */
.gallery .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery .gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--duration), box-shadow var(--duration);
}

.gallery .gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Contact */
.contact .contact-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact .contact-links a {
  color: var(--accent);
  font-weight: 500;
}

.contact .footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/*
  Scroll reveal animations
  Elements marked with the [data-animate] attribute start off hidden and translate
  slightly downward. When scrolled into view, JavaScript will add an "in-view"
  class to trigger the fade in and slide up effect.
*/
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Back to top button */
.to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 1000;
}

/* Responsive navigation */
@media (max-width: 768px) {
  .about {
    flex-direction: column;
  }

  .navbar ul {
    position: fixed;
    top: 60px;
    right: 0;
    /* Light mobile menu overlay */
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    width: 200px;
    height: calc(100vh - 60px);
    transform: translateX(100%);
    transition: transform var(--duration);
    padding: 1rem;
    gap: 1rem;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
  }

  .navbar ul li a {
    display: block;
  }

  .navbar .hamburger {
    display: block;
    cursor: pointer;
    width: 30px;
    height: 30px;
    position: relative;
  }

  .navbar .hamburger span,
  .navbar .hamburger span::before,
  .navbar .hamburger span::after {
    display: block;
    background: var(--text-light);
    height: 3px;
    width: 100%;
    position: absolute;
    transition: transform var(--duration);
  }

  .navbar .hamburger span {
    top: 50%;
    transform: translateY(-50%);
  }

  .navbar .hamburger span::before {
    content: '';
    top: -10px;
  }

  .navbar .hamburger span::after {
    content: '';
    top: 10px;
  }

  /* Transform hamburger into X when toggled */
  #nav-toggle:checked + .hamburger span {
    background: transparent;
  }

  #nav-toggle:checked + .hamburger span::before {
    transform: translateY(10px) rotate(45deg);
  }

  #nav-toggle:checked + .hamburger span::after {
    transform: translateY(-10px) rotate(-45deg);
  }

  #nav-toggle:checked ~ .nav-links {
    transform: translateX(0);
  }
}