/* ─── Variables ─────────────────────────────────────── */
:root {
  --bg:        #f4efe6;
  --text:      #1c1c1c;
  --muted:     #7a7068;
  --accent:    #1a6b65;
  --max-width: 860px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
}

/* ─── Typography ─────────────────────────────────────── */
h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 1;
  color: var(--text);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--accent);
  font-style: italic;
  margin-bottom: 1.2rem;
}

p, li {
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

/* ─── Layout ─────────────────────────────────────────── */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid #ddd8d0;
}

/* ─── Hero ───────────────────────────────────────────── */
#hero {
  max-width: 100%;
  min-height: 95vh;
  padding: 0;
  position: relative;
  display: flex;
  align-items: flex-start;
  background-color: #111;
  background-image: url('assets/david-header-wider.jpg');
  background-size: cover;
  background-position: 80% top;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    var(--bg) 100%
  );
}

.hero-text {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 4rem 5rem;
  max-width: var(--max-width);
  margin: 0;
  width: 100%;
}

#hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
}

.hero-tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 300;
  font-style: italic;
  color: #1c1c1c;
  margin-top: 8rem;
  max-width: 16rem;
  line-height: 1.6;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #1a6b65;
  opacity: 0.8;
  animation: bounce 2s ease-in-out infinite;
  transition: opacity 0.4s ease;
  z-index: 2;
}

.scroll-indicator.hidden {
  opacity: 0;
}

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

.subtitle {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* ─── Work Section ───────────────────────────────────── */
#work {}

.section-intro {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  color: var(--muted);
  font-size: 1rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.spotify-embed {
  width: 100%;
}

.spotify-embed iframe {
  width: 100%;
  border-radius: 8px;
}

.embed-placeholder {
  color: var(--muted);
  font-style: italic;
  padding: 2rem;
  border: 1px dashed #ddd8d0;
  text-align: center;
  border-radius: 8px;
}

/* ─── Process Section ────────────────────────────────── */
#process {
  border-top: 1px solid #ddd8d0;
}

.process-list {
  list-style: none;
  counter-reset: process-counter;
  padding: 0;
  margin-bottom: 2rem;
}

.process-list li {
  counter-increment: process-counter;
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid #ddd8d0;
  font-size: 1.05rem;
}

.process-list li::before {
  content: counter(process-counter);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.8rem;
  color: var(--accent);
  min-width: 2rem;
  line-height: 1;
}

.process-cta {
  color: var(--muted);
  font-style: italic;
  margin-top: 2rem;
}

/* ─── My Music Section ───────────────────────────────── */
#music {
  border-top: 1px solid #ddd8d0;
}

/* ─── About Section ──────────────────────────────────── */
#about {
  border-top: 1px solid #ddd8d0;
}

.about-text {
  font-size: 1.05rem;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

footer a {
  color: var(--muted);
  letter-spacing: 0.02em;
}

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

.social-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  section {
    padding: 3.5rem 1.25rem;
  }

  footer {
    padding: 2rem 1.25rem 3rem;
  }

  .hero-text {
    padding: 2rem 1.25rem 3rem;
  }

  #hero h1 {
    color: #f0ebe3;
  }

  .subtitle {
    color: #f0ebe3;
  }

  .hero-tagline {
    display: none;
  }

  .scroll-indicator {
    bottom: 8rem;
  }

  .process-list li {
    gap: 1rem;
  }

  .process-list li::before {
    font-size: 1.4rem;
    min-width: 1.5rem;
  }
}

/* ─── Scroll Fade ────────────────────────────────────── */
section, footer {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

section.visible, footer.visible {
  opacity: 1;
  transform: none;
}

/* ─── Grain Texture ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  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");
  background-size: 256px 256px;
}
