/* ============================================
   NONTHAGORN PRECHAPAISHANJIT — PORTFOLIO
   Cinematic · Restrained · Editorial
   ============================================ */

:root {
  --bg: #0a0a0a;
  --fg: #e8e6e0;
  --muted: #7a7a7a;
  --line: rgba(232, 230, 224, 0.08);

  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --pad-x: 6vw;
  --pad-section: 14vh;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.link { transition: opacity 0.3s ease; }
.link:hover { opacity: 0.55; }

.muted { color: var(--muted); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

/* ====== HERO ====== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 1.5rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 1.6s var(--ease) forwards;
  animation-delay: 0.15s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__center {
  text-align: center;
  max-width: 1100px;
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 7rem);
  line-height: 1.0;
  letter-spacing: -0.015em;
}

.hero__meta {
  position: absolute;
  padding: 1.6rem var(--pad-x);
}

.hero__meta--tl { top: 0; left: 0; }
.hero__meta--tr { top: 0; right: 0; }
.hero__meta--bl { bottom: 0; left: 0; }
.hero__meta--br { bottom: 0; right: 0; }

/* ====== SECTION HEAD ====== */
.section-head {
  padding: var(--pad-section) var(--pad-x) 4rem;
  border-top: 1px solid var(--line);
}

/* ====== PROJECT ====== */
.project {
  padding: 0 var(--pad-x) var(--pad-section);
}

.project__media {
  overflow: hidden;
  cursor: zoom-in;
  background: #050505;
}

.project__media img {
  width: 100%;
  height: auto;
  transition: transform 1.1s var(--ease);
}

.project__media:hover img,
.diptych__cell:hover img {
  transform: scale(1.025);
}

.project--full .project__media {
  max-width: 100%;
  margin: 0 auto;
}

.project--full .project__media img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* video variant */
.project--video {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.project__media--video {
  cursor: default;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.project__media--video video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #050505;
}

/* info */
.project__info {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.project__head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.project__meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project__client {
  font-size: 0.88rem;
  color: var(--fg);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.project__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.2vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.project__role {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.project__caption {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.5;
}

.project__info--block {
  padding-top: 1rem;
  gap: 0.9rem;
}

/* diptych */
.diptych {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.diptych__cell {
  overflow: hidden;
  cursor: zoom-in;
  background: #050505;
}

.diptych__cell img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 1.1s var(--ease);
}

/* ====== ABOUT ====== */
.about {
  padding: var(--pad-section) var(--pad-x);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about__text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  line-height: 1.35;
  max-width: 24ch;
  letter-spacing: -0.005em;
}

/* ====== FOOTER ====== */
.footer {
  padding: var(--pad-section) var(--pad-x) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer__email {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 6.5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: opacity 0.3s ease;
  word-break: break-word;
  display: inline-block;
}

.footer__email:hover { opacity: 0.6; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ====== REVEAL ====== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== LIGHTBOX ====== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.97);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  font-weight: 200;
  font-family: var(--font-body);
  padding: 0.5rem 1rem;
  transition: opacity 0.3s ease;
}

.lightbox__close:hover { opacity: 0.55; }

/* ====== RESPONSIVE — Tablet 768+ ====== */
@media (min-width: 768px) {
  :root {
    --pad-x: 5vw;
    --pad-section: 18vh;
  }

  .diptych {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .project--video {
    grid-template-columns: auto 1fr;
    gap: 4rem;
  }

  .project__media--video {
    max-width: 380px;
    margin: 0;
  }

  .project--full .project__media {
    max-width: 950px;
    margin: 0 auto;
  }

  .project--full .project__media img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  .project--full .project__info {
    max-width: 950px;
    margin: 0 auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
  }

  .project--full .project__head { flex: 1; max-width: 55%; }
  .project--full .project__meta { text-align: right; align-items: flex-end; }
  .project--full .project__role,
  .project--full .project__client,
  .project--full .project__caption { text-align: right; }
  .project--full .project__caption { margin-left: auto; }

  .project--diptych .project__info {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
  }
  .project--diptych .project__role { text-align: right; }

  .project__info--block {
    padding-top: 0;
  }
}

/* ====== Desktop 1024+ ====== */
@media (min-width: 1024px) {
  :root { --pad-section: 20vh; }

  .about {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
    align-items: start;
  }

  .about__text { max-width: 30ch; }

  .hero__name {
    font-size: clamp(3rem, 8.5vw, 8rem);
  }

  .project__media--video {
    max-width: 420px;
  }
}

/* ====== Desktop 1400+ ====== */
@media (min-width: 1400px) {
  :root { --pad-x: 7vw; }
}

/* ====== Reduced motion ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
