/* =============================================
   YUNUEN PORTFOLIO — STYLESHEET v3
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@600&family=Nunito:wght@400;500;600&display=swap');

/* Self-hosted PP Neue Montreal */
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Thin.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../assets/fonts/NeueMontreal-Semibolditalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* ---- CSS VARIABLES ---- */
:root {
  --bg:            #f7f6f2;
  --ink:           #111110;
  --ink-dim:       #999997;
  --border:        #e2e0da;
  --gap:           6px;

  /* footer */
  --footer-bg:     #2b1d0b;
  --footer-text:   #e5ddd0;

  /* layout */
  --header-h:      64px;
  --pad-x:         68px;
  --max-w:         1180px;

  /* type */
  --f-brand:  'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  --f-ui:     'PP Neue Montreal', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --f-title:  'Figtree', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --f-body:   'Nunito', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* Images in the work grid stay square/covered */
img { display: block; width: 100%; height: 100%; object-fit: cover; }

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: var(--bg);
  z-index: 200;
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--border); }

.logo {
  font-family: var(--f-brand);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 44px;
}
.site-nav a {
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .005em;
  color: var(--ink);
  opacity: .55;
  transition: opacity .18s;
}
.site-nav a:hover,
.site-nav a.active { opacity: 1; }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  padding: 4px;
}
.hamburger span {
  display: block; width: 100%; height: 1px;
  background: var(--ink);
  transition: transform .28s, opacity .28s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  background: var(--bg);
  padding: 28px var(--pad-x) 32px;
  flex-direction: column;
  gap: 20px;
  z-index: 190;
  border-bottom: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--f-ui);
  font-size: 18px;
  color: var(--ink);
}

/* =============================================
   PAGE WRAPPER
   ============================================= */
.page {
  padding-top: var(--header-h);
  min-height: 100vh;
  animation: pageIn .3s ease both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   HOMEPAGE / WORK — grid stays square, untouched
   ============================================= */
.tabs-row {
  padding: 30px var(--pad-x) 26px;
  display: flex;
  gap: 26px;
}
.tab-btn {
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: .01em;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color .18s, border-color .18s;
}
.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.tab-btn:hover { color: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 4-col square grid — homepage only */
.work-grid {
  padding: 0 var(--pad-x) 100px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* Square thumbnail — homepage grid */
.thumb {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e4e1da;
  position: relative;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}
.thumb:hover img { transform: scale(1.04); }

/* hover label */
.thumb-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: rgba(17,17,16,0);
  transition: background .28s;
}
.thumb:hover .thumb-label { background: rgba(17,17,16,.15); }
.thumb-label span {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .28s, transform .28s;
}
.thumb:hover .thumb-label span { opacity: 1; transform: translateY(0); }

/* placeholder */
.thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui);
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-dim);
  background: #e4e1da;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  position: relative;
  overflow: hidden;
  padding: 52px var(--pad-x) 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
}
.site-footer::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 120% at 60% 100%, rgba(160,90,10,.35) 0%, transparent 65%),
    radial-gradient(ellipse 50% 80%  at 10% 110%, rgba(80,40,5,.4)   0%, transparent 60%);
  pointer-events: none;
}
.footer-contact-label {
  font-family: var(--f-title);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -.01em;
  opacity: .9;
  position: relative;
}
.footer-email {
  font-family: var(--f-ui);
  font-size: 13px;
  letter-spacing: .01em;
  opacity: .55;
  margin-top: 10px;
  position: relative;
}
.footer-social-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  margin-top: 24px;
}
.footer-social-row a {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  opacity: .65;
  transition: opacity .18s;
}
.footer-social-row a:hover { opacity: 1; }
.footer-social-row svg { width: 18px; height: 18px; fill: var(--footer-text); }

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px var(--pad-x) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

/* No frame, no crop — image adapts to its natural dimensions */
.about-img-frame {
  position: relative;
  /* No padding, no background, no border */
}
.about-img-frame img {
  display: block;
  width: 100%;
  height: auto;        /* natural height — no cropping */
  object-fit: unset;   /* override the global img rule */
  max-width: 100%;
}

.about-text { padding-top: 6px; }
.about-h1 {
  font-family: var(--f-title);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.1;
  margin-bottom: 26px;
}
.about-body p {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.85;
  color: #3d3d3b;
  text-align: justify;
  margin-bottom: 18px;
}

/* =============================================
   CONTACT PAGE
   ============================================= */
.contact-wrap {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  padding: 60px var(--pad-x);
}
.contact-inner {
  max-width: 480px;
  width: 100%;
}
.contact-h1 {
  font-family: var(--f-title);
  font-size: 54px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 44px;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--ink);
  transition: opacity .18s;
}
.contact-link:hover { opacity: .5; }
.contact-icon {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 15px; height: 15px; fill: var(--ink); }

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 13px 26px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--f-ui);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: opacity .18s;
}
.resume-btn:hover { opacity: .75; }
.resume-btn svg { width: 13px; height: 13px; fill: var(--bg); }

/* =============================================
   PROJECT DETAIL PAGE
   ============================================= */
.proj-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad-x) 20px;
}
.proj-back {
  font-family: var(--f-ui);
  font-size: 13px;
  letter-spacing: .005em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: .6;
  transition: opacity .18s;
}
.proj-back:hover { opacity: 1; }
.proj-back svg { width: 13px; height: 13px; }

.proj-prevnext {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--ink);
  opacity: .6;
  letter-spacing: .005em;
  display: flex;
  gap: 4px;
  align-items: center;
}
.proj-prevnext a {
  opacity: 1;
  transition: opacity .18s;
}
.proj-prevnext a:hover { opacity: .4; }

/* Media area — centered column */
.proj-media-area {
  padding: 0 var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*
  Main image: landscape-dominant, matches reference width.
  No aspect-ratio forced — height comes from the media itself (no cropping).
  max-width ~750px matches the reference image proportions.
*/
.proj-main-img {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;

  /* 15% larger, taller landscape, no cropping */
  height: clamp(360px, 58vw, 560px);

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
}

/* Media behaves like a contained object inside a frame */
.proj-main-img img,
.proj-main-img video {
  width: 100%;
  height: 100%;

  object-fit: contain; /* prevents cropping */
  object-position: center;

  background: transparent; /* remove black */

  display: block;
}

/* fade on swap */
.proj-main-img.fade { animation: mediaFade .3s ease; }
@keyframes mediaFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Thumbnail strip */
/* Carousel wrapper: arrow + strip + arrow in a row */
.proj-carousel-wrap {
  max-width: 860px;
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Arrow buttons */
.carousel-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  opacity: .5;
  transition: opacity .18s;
  font-size: 32px;
  line-height: 1;
  padding: 0;
  user-select: none;
  z-index: 2;
}
.carousel-arrow:hover {
  opacity: 1;
}

.proj-list {
  font-family: var(--f-body);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.95;
  color: #3d3d3b;
  margin-bottom: 22px;
  margin-left: 20px;
  padding-left: 0;
  list-style-position: outside;
}
.proj-list li {
  font-family: var(--f-body);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.95;
  color: #3d3d3b;
  margin-bottom: 6px;
}
.proj-list li {
  margin-bottom: 6px;
}

.proj-strip {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  display: flex;
  gap: 8px;
  overflow-x: hidden; /* hidden — arrows control scrolling */
  scrollbar-width: none;
  padding-bottom: 2px;
  scroll-behavior: smooth;
}
.proj-strip::-webkit-scrollbar { display: none; }
.proj-strip-thumb {
  flex-shrink: 0;
  width: 128px;
  height: 78px;
  overflow: hidden;
  background: #dddad4;
  cursor: pointer;
  opacity: .45;
  border: 1.5px solid transparent;
  transition: opacity .2s, border-color .2s;
  position: relative;
}
.proj-strip-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; /* thumbnails stay square — this is intentional */
}
.proj-strip-thumb.active {
  opacity: 1;
  border-color: var(--ink);
}
.proj-strip-thumb:hover { opacity: .8; }

/* Video play badge */
.proj-strip-thumb[data-type="video"]::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255,255,255,.85);
  pointer-events: none;
}

/* Project description */
.proj-info {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 44px var(--pad-x) 0;
  box-sizing: border-box;
}
.proj-title {
  font-family: var(--f-title);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 14px;
  text-align: center;  /* fully centred */
}
.proj-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  justify-content: center;
}
.proj-meta span {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.proj-desc {
  font-family: var(--f-body);
  font-size: 14.5px;
  line-height: 1.95;
  color: #3d3d3b;
  width: 100%;
  /* justified body, last line centred */
  text-align: justify;
  text-align-last: left;
}

/* Paragraph spacing inside description */
p.proj-desc {
  margin-bottom: 32px;
}
p.proj-desc:last-child {
  margin-bottom: 0;
}
.proj-desc b, .proj-desc strong {
  font-weight: 600;
  color: var(--ink);
}

/* Related work */
.proj-related {
  margin-top: 80px;
}
.proj-related-label {
  padding: 24px var(--pad-x) 18px;
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-top: 1px solid var(--border);
}
.related-grid {
  padding: 0 var(--pad-x) 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  :root { --pad-x: 40px; }
  .work-grid, .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  :root { --pad-x: 20px; --header-h: 56px; }
  .site-nav { display: none; }
  .hamburger { display: flex; }

  .work-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }

  .about-wrap {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 40px;
  }
  .about-h1 { font-size: 30px; }
  .footer-contact-label { font-size: 36px; }

  .proj-main-img { max-width: 100%; height: clamp(220px, 52vw, 420px); }
  .proj-carousel-wrap { max-width: 100%; }
  .proj-info { max-width: 100%; padding-left: var(--pad-x); padding-right: var(--pad-x); }
  .proj-title { font-size: 28px; }
  .contact-h1 { font-size: 38px; }
}

@media (max-width: 480px) {
  .work-grid, .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .proj-strip-thumb { width: 80px; height: 58px; }
}
