/* ============================================================
   Melody R. Murray — cinematic portfolio
   One stylesheet. Edit colors in :root.
   ============================================================ */

:root {
  --bg:        #0a0a0c;
  --bg-soft:   #111114;
  --bg-card:   #16161a;
  --ink:       #f3efe7;   /* bone white */
  --ink-dim:   #a7a39b;
  --ink-faint: #6a6760;
  --accent:    #c79a5b;   /* warm cinematic gold */
  --accent-2:  #e7c188;
  --line:      rgba(243,239,231,0.10);
  --maxw:      1240px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #1a1206; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10,10,12,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: 'Fraunces', serif;
  font-weight: 500; font-size: 1.15rem; letter-spacing: .02em;
}
.nav__links { display: flex; gap: clamp(1rem, 2.4vw, 2.4rem); }
.nav__links a {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-dim); position: relative; padding: .2rem 0;
  transition: color .3s var(--ease);
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 22px; position: relative; }
.nav__toggle span { display: block; position: absolute; height: 2px; width: 100%; left: 0; background: var(--ink); transition: .3s var(--ease); }
.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 10px; }
.nav__toggle span:nth-child(3) { top: 20px; }
.nav.is-open .nav__toggle span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(199,154,91,0.10), transparent 55%),
    linear-gradient(180deg, rgba(10,10,12,0.30) 0%, rgba(10,10,12,0.55) 45%, var(--bg) 100%),
    url('../img/headshot.jpg') center 22% / cover no-repeat;
  filter: grayscale(0.25) contrast(1.05);
}
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(10,10,12,0.65) 38%, transparent 75%);
}
.hero__inner { position: relative; z-index: 2; max-width: 880px; }
.hero__eyebrow {
  font-size: .8rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.4rem;
}
.hero__title {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(3rem, 11vw, 8.5rem); line-height: 0.95;
  letter-spacing: -0.02em; margin-bottom: 1.2rem;
}
.hero__tagline {
  font-size: clamp(1rem, 2.2vw, 1.45rem); color: var(--ink);
  font-weight: 300; letter-spacing: .04em; margin-bottom: 2.4rem;
}
.hero__cta {
  display: inline-block; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .95rem 2.1rem; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 100px; transition: all .35s var(--ease);
}
.hero__cta:hover { background: var(--accent); color: #14100a; transform: translateY(-2px); }
.hero__scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; }
.hero__scroll span { display: block; width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent); animation: scrollpulse 2s var(--ease) infinite; }
@keyframes scrollpulse { 0% { transform: scaleY(.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4.5rem, 11vw, 9rem) clamp(1.2rem, 4vw, 3rem); }
.section__head { margin-bottom: clamp(2.2rem, 5vw, 3.6rem); max-width: 720px; }
.section__index { font-family: 'Fraunces', serif; font-size: .9rem; color: var(--accent); letter-spacing: .1em; display: block; margin-bottom: .8rem; }
.section__title { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.015em; margin-bottom: .9rem; }
.section__lede { color: var(--ink-dim); font-size: clamp(1rem, 1.4vw, 1.12rem); max-width: 56ch; }

/* ---------- GRID + TILES ---------- */
.grid { display: grid; gap: clamp(.9rem, 1.8vw, 1.6rem); grid-template-columns: repeat(3, 1fr); }
.grid--feature { grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.4vw, 2rem); }
.grid--compact { grid-template-columns: repeat(4, 1fr); gap: clamp(.7rem, 1.4vw, 1.1rem); }

.tile {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--bg-card); cursor: pointer; border: 1px solid var(--line);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 18px 46px rgba(0,0,0,0.55); border-color: rgba(199,154,91,0.4); }
.tile__img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .5s var(--ease); filter: grayscale(.15) brightness(.92); }
.tile:hover .tile__img { transform: scale(1.06); filter: grayscale(0) brightness(1); }
.tile__overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, transparent 35%, rgba(7,7,9,0.86) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1rem 1.1rem; transition: background .4s var(--ease);
}
.tile__title { font-family: 'Fraunces', serif; font-size: clamp(.95rem, 1.4vw, 1.18rem); line-height: 1.2; }
.tile__sub { font-size: .78rem; color: var(--ink-dim); margin-top: .25rem; }
.grid--compact .tile__title { font-size: .9rem; }
.tile__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.85);
  z-index: 3; width: 58px; height: 58px; border-radius: 50%;
  background: rgba(10,10,12,0.55); border: 1px solid rgba(243,239,231,0.5);
  display: grid; place-items: center; opacity: 0; transition: all .4s var(--ease);
  backdrop-filter: blur(4px);
}
.tile:hover .tile__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.tile__play::after { content: ''; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--ink); margin-left: 3px; }
.tile__badge { position: absolute; top: .7rem; left: .7rem; z-index: 3; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); background: rgba(10,10,12,0.6); padding: .25rem .55rem; border-radius: 4px; }

/* Title-card tiles (no source yet) */
.tile--card { cursor: default; background: linear-gradient(145deg, #1a1722, #100f14); display: grid; place-items: center; padding: 1.2rem; }
.tile--card:hover { transform: none; box-shadow: none; border-color: var(--line); }
.tile--card .tile__cardtitle { font-family: 'Fraunces', serif; font-size: 1.05rem; text-align: center; color: var(--ink); }
.tile--card .tile__cardnote { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: .6rem; }

/* ---------- CREDITS ---------- */
.credits { margin-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); padding-top: clamp(2rem, 4vw, 3rem); }
.credits__title { font-family: 'Fraunces', serif; font-weight: 400; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--accent); }
.credits__list { list-style: none; display: grid; gap: 1rem; max-width: 90ch; }
.credits__list li { color: var(--ink-dim); font-size: .98rem; padding-left: 1.4rem; position: relative; line-height: 1.65; }
.credits__list li::before { content: ''; position: absolute; left: 0; top: .65em; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.credits__list strong { color: var(--ink); font-weight: 600; }
.credits__list em { color: var(--ink); font-style: italic; }

/* ---------- ABOUT ---------- */
.section--about { background: var(--bg-soft); max-width: none; }
.about { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.about__photo img { width: 100%; border-radius: 12px; filter: grayscale(1) contrast(1.08); aspect-ratio: 3/4; object-fit: cover; }
.about__text p { color: var(--ink-dim); margin-bottom: 1.1rem; font-size: 1.02rem; }
.about__text p:first-of-type { color: var(--ink); font-size: 1.12rem; }

/* ---------- CONTACT ---------- */
.section--contact { text-align: center; }
.contact { max-width: 640px; margin: 0 auto; }
.contact__lede { color: var(--ink-dim); margin: .5rem 0 2rem; }
.contact__email { font-family: 'Fraunces', serif; font-size: clamp(1.6rem, 5vw, 3rem); color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: .25rem; transition: color .3s var(--ease); display: inline-block; }
.contact__email:hover { color: var(--accent); }
.contact__social { display: flex; gap: 1.6rem; justify-content: center; margin-top: 2.4rem; }
.contact__social a { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); transition: color .3s var(--ease); }
.contact__social a:hover { color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.4rem clamp(1.2rem, 4vw, 3rem); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; color: var(--ink-faint); font-size: .82rem; }
.footer__credit { letter-spacing: .1em; text-transform: uppercase; }

/* ---------- LIGHTBOX ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; flex-direction: column; padding: clamp(1rem, 4vw, 3rem); background: rgba(5,5,7,0.94); backdrop-filter: blur(10px); opacity: 0; transition: opacity .3s var(--ease); }
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox__stage { width: min(100%, 1100px); aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.lightbox__stage iframe, .lightbox__stage video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.lightbox__caption { color: var(--ink-dim); margin-top: 1.1rem; font-size: .9rem; letter-spacing: .02em; text-align: center; }
.lightbox__close { position: absolute; top: 1.2rem; right: 1.6rem; background: none; border: 0; color: var(--ink); font-size: 2.4rem; line-height: 1; cursor: pointer; opacity: .7; transition: opacity .3s, transform .3s; }
.lightbox__close:hover { opacity: 1; transform: rotate(90deg); }

/* ---------- REVEAL ANIMATION ----------
   Fail-open: content is visible by default. Only when JS is active
   (html.js) do we hide-then-reveal, so a JS/observer failure never
   leaves content invisible. */
.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .hero__scroll span { animation: none; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid--compact { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 340px; }
}
@media (max-width: 640px) {
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    background: rgba(13,13,16,0.97); backdrop-filter: blur(18px);
    flex-direction: column; justify-content: center; gap: 2rem; padding: 2rem;
    transform: translateX(100%); transition: transform .4s var(--ease); border-left: 1px solid var(--line);
  }
  .nav.is-open .nav__links { transform: translateX(0); }
  .nav__links a { font-size: 1rem; }
  .nav__toggle { display: block; z-index: 60; }
  .grid--feature { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .grid--compact { grid-template-columns: 1fr 1fr; }
}
