/* ===================================================================
   Kevin Lee - Acting Portfolio
   A cinematic, editorial single-page theme.
   =================================================================== */

:root {
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Inter", system-ui, sans-serif;
  --maxw: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- THEME: DARK (default) ---------- */
:root {
  --bg:        #0d0d0f;
  --bg-2:      #141418;
  --ink:       #f4f1ea;
  --ink-soft:  #b8b3a8;
  --ink-mute:  #7d7970;
  --line:      #2a2a30;
  --accent:    #c9a26b;   /* warm brass */
  --accent-2:  #e6cfa5;
  --nav-bg:       rgba(13,13,15,0.82);
  --nav-panel-bg: rgba(15,15,18,0.97);
  --hero-media-bg:
    radial-gradient(120% 120% at 70% 20%, #23242c 0%, #0d0d0f 60%),
    linear-gradient(200deg, #1a1b22, #0a0a0c);
  --hero-overlay-bg:
    radial-gradient(60% 60% at 50% 45%, transparent 0%, rgba(13,13,15,0.55) 100%),
    linear-gradient(to bottom, rgba(13,13,15,0.2), rgba(13,13,15,0.85));
  --spotlight:    radial-gradient(closest-side, rgba(201,162,107,0.10), transparent 70%);
  --grain-opacity: 0.05;
  --grain-blend:   overlay;
  --btn-text:     #16130d;
  --frame-ring:   rgba(201,162,107,0.28);
  --vignette:     rgba(8,8,10,0.42);
  --ph-a:         #17171c;
  --ph-b:         #1c1c22;
}

/* ---------- THEME: LIGHT ---------- */
:root[data-theme="light"] {
  --bg:        #f6f2ea;
  --bg-2:      #ece4d6;
  --ink:       #211d17;
  --ink-soft:  #574f45;
  --ink-mute:  #9a917f;
  --line:      #ddd4c4;
  --accent:    #a8762e;
  --accent-2:  #855c22;
  --nav-bg:       rgba(246,242,234,0.85);
  --nav-panel-bg: rgba(246,242,234,0.97);
  --hero-media-bg:
    radial-gradient(120% 120% at 70% 20%, #ffffff 0%, #efe7d8 62%),
    linear-gradient(200deg, #f4eee2, #ece3d3);
  --hero-overlay-bg:
    radial-gradient(60% 60% at 50% 45%, transparent 0%, rgba(246,242,234,0.30) 100%),
    linear-gradient(to bottom, rgba(246,242,234,0), rgba(246,242,234,0.35));
  --spotlight:    radial-gradient(closest-side, rgba(168,118,46,0.10), transparent 70%);
  --grain-opacity: 0.04;
  --grain-blend:   multiply;
  --btn-text:     #fbf8f1;
  --frame-ring:   rgba(168,118,46,0.38);
  --vignette:     rgba(246,242,234,0.55);
  --ph-a:         #e9e1d3;
  --ph-b:         #efe8db;
}

/* Auto-select light when the visitor's OS prefers it (until they toggle) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg:        #f6f2ea;
    --bg-2:      #ece4d6;
    --ink:       #211d17;
    --ink-soft:  #574f45;
    --ink-mute:  #9a917f;
    --line:      #ddd4c4;
    --accent:    #a8762e;
    --accent-2:  #855c22;
    --nav-bg:       rgba(246,242,234,0.85);
    --nav-panel-bg: rgba(246,242,234,0.97);
    --hero-media-bg:
      radial-gradient(120% 120% at 70% 20%, #ffffff 0%, #efe7d8 62%),
      linear-gradient(200deg, #f4eee2, #ece3d3);
    --hero-overlay-bg:
      radial-gradient(60% 60% at 50% 45%, transparent 0%, rgba(246,242,234,0.30) 100%),
      linear-gradient(to bottom, rgba(246,242,234,0), rgba(246,242,234,0.35));
    --spotlight:    radial-gradient(closest-side, rgba(168,118,46,0.10), transparent 70%);
    --grain-opacity: 0.04;
    --grain-blend:   multiply;
    --btn-text:     #fbf8f1;
    --frame-ring:   rgba(168,118,46,0.38);
    --vignette:     rgba(246,242,234,0.55);
    --ph-a:         #e9e1d3;
    --ph-b:         #efe8db;
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

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

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 5vw, 4rem);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.nav__links {
  display: flex;
  gap: 2.2rem;
}
.nav__links a {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.3s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}
.nav__toggle span {
  width: 26px; height: 2px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the icon of the theme you'll switch TO: dark shows sun, light shows moon */
.theme-toggle .ic--moon { display: none; }
.theme-toggle .ic--sun  { display: block; }
:root[data-theme="light"] .theme-toggle .ic--sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ic--moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .ic--sun  { display: none; }
  :root:not([data-theme]) .theme-toggle .ic--moon { display: block; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0;
  background: var(--hero-media-bg);
  background-size: cover;
  transform: scale(1.05);
  animation: heroDrift 20s ease-in-out infinite;
}
/* moving spotlight for depth */
.hero__media::before {
  content: "";
  position: absolute; inset: -20%;
  background: var(--spotlight);
  animation: spotlight 16s ease-in-out infinite alternate;
}
/* film grain */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__overlay {
  position: absolute; inset: 0;
  background: var(--hero-overlay-bg);
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7rem clamp(1.2rem, 5vw, 2rem) 5rem;
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
.hero__portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  background: var(--bg-2);
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.15s forwards;
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero__portrait::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow:
    inset 0 0 0 1px var(--frame-ring),
    inset 0 0 38px 2px var(--vignette);
  pointer-events: none;
}
.hero__eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 1.6rem;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.2s forwards;
}
.hero__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 6.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.35s forwards;
}
.hero__cta {
  margin-top: 2.6rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.65s forwards;
}

.hero__meta {
  margin: 1.6rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.5s forwards;
}

.hero__scroll {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1px solid var(--ink-mute);
  border-radius: 14px;
  z-index: 2;
}
.hero__scroll span {
  position: absolute;
  top: 8px; left: 50%;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollDot 1.8s infinite;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.95rem 2rem;
  border: 1px solid var(--accent);
  transition: all 0.35s var(--ease);
  cursor: pointer;
}
.btn--solid { background: var(--accent); color: var(--btn-text); }
.btn--solid:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--btn-text); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: var(--accent); color: var(--btn-text); }

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.2rem, 5vw, 2rem);
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.4rem;
}
.section__num {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.02em;
}

/* ---------- ABOUT ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-2);
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__portrait::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow:
    inset 0 0 0 1px var(--frame-ring),
    inset 0 0 38px 2px var(--vignette);
  pointer-events: none;
}
.lead {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.about__body p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.about__facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1.5rem;
  margin: 2rem 0;
  border-top: 1px solid var(--line);
  padding-top: 1.8rem;
}
.about__facts li {
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.about__facts span {
  color: var(--ink-mute);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
.about__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ---------- REEL ---------- */
.reel__group {
  max-width: 940px;
  margin: 0 auto clamp(1.1rem, 2.5vw, 1.6rem);
}
.reel__group:last-of-type { margin-bottom: 0; }
.reel__group-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
  text-align: center;
}
.reel__grid {
  --reel-gap: clamp(1rem, 3vw, 1.8rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--reel-gap);
}
.reel__clip {
  margin: 0;
  flex: 0 1 calc((100% - 2 * var(--reel-gap)) / 3); /* up to 3 per row */
  min-width: 0;
}
.reel__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  overflow: hidden;
}
.reel__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.reel__cap {
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-soft);
  text-align: center;
}
.reel__note {
  text-align: center;
  color: var(--ink-mute);
  margin-top: 2.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
.reel__note a { color: var(--accent); }

/* ---------- RESUME ---------- */
.resume__block { margin-bottom: 3rem; }
.resume__cat {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}
.resume__table { width: 100%; border-collapse: collapse; }
.resume__table tr { border-bottom: 1px solid var(--line); }
.resume__table td { padding: 0.9rem 0; vertical-align: top; }
.t-role { width: 22%; color: var(--ink); font-weight: 500; }
.t-proj { width: 40%; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; }
.t-note { width: 38%; color: var(--ink-mute); font-size: 0.9rem; text-align: right; }
.resume__skills { color: var(--ink-soft); line-height: 2; }

/* ---------- GALLERY ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery__item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-2);
}
.gallery__item::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow:
    inset 0 0 0 1px var(--frame-ring),
    inset 0 0 34px 2px var(--vignette);
  pointer-events: none;
  z-index: 1;
}
.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.gallery__item:hover img { transform: scale(1.06); }

/* placeholder styling when an image is missing */
img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--ph-a), var(--ph-a) 12px, var(--ph-b) 12px, var(--ph-b) 24px);
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  min-height: 100%;
}
img.placeholder::after {
  content: attr(alt);
  padding: 0.5rem 1rem;
  text-align: center;
}

/* ---------- CONTACT ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}
.contact__col h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.contact__label {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.contact__col p { color: var(--ink-soft); line-height: 1.9; }
.contact__col a { color: var(--ink); border-bottom: 1px solid var(--line); transition: border-color 0.3s; }
.contact__col a:hover { border-color: var(--accent); }
.contact__social {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.contact__icons {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.contact__icons a {
  display: inline-flex;
  color: var(--ink-soft);
  border: none;
  transition: color 0.3s var(--ease);
}
.contact__icons a:hover { color: var(--accent); }
.contact__icons svg { width: 23px; height: 23px; display: block; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.3rem;
}
.contact__links a {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  border: none;
  transition: color 0.3s var(--ease);
}
.contact__links a:hover { color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1.2rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-mute);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.footer__top { color: var(--ink-soft); transition: color 0.3s; }
.footer__top:hover { color: var(--accent); }

/* ---------- REVEAL ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- KEYFRAMES ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroDrift {
  0%   { transform: scale(1.05) translate(0, 0); }
  50%  { transform: scale(1.09) translate(-1.5%, -1%); }
  100% { transform: scale(1.05) translate(0, 0); }
}
@keyframes spotlight {
  0%   { transform: translate(-8%, -6%); opacity: 0.7; }
  100% { transform: translate(10%, 6%); opacity: 1; }
}
@keyframes scrollDot {
  0%   { opacity: 0; transform: translate(-50%, 0); }
  40%  { opacity: 1; }
  80%  { opacity: 0; transform: translate(-50%, 14px); }
  100% { opacity: 0; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(74vw, 320px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 3rem;
    background: var(--nav-panel-bg);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1rem; }
  .nav__toggle { display: flex; }
  .nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.open span:nth-child(2) { opacity: 0; }
  .nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    padding-top: 6rem;
    text-align: center;
    justify-items: center;
  }
  .hero__portrait { max-width: 260px; }
  .hero__cta { justify-content: center; }
  .hero__meta { align-items: center; text-align: center; }

  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 380px; }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .reel__clip { flex-basis: calc((100% - var(--reel-gap)) / 2); } /* 2 per row */
  .contact__grid { grid-template-columns: 1fr; }
  .t-note { font-size: 0.82rem; }
}

@media (max-width: 520px) {
  .about__facts { grid-template-columns: 1fr; }
  .gallery__grid { grid-template-columns: 1fr; }
  .reel__clip { flex-basis: 100%; } /* 1 per row */
  .resume__table td { padding: 0.7rem 0; }
  .t-role, .t-proj, .t-note { display: block; width: 100%; text-align: left; }
  .t-note { margin-top: 0.2rem; }
  .footer { flex-direction: column; gap: 0.8rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
