/* ==========================================================================
   Chng Yang Da Portfolio — static rebuild of elterasyd.wixsite.com/elteras
   Desktop layout mirrors the Wix absolute layout on a 980px stage
   (Wix ad bar removed, so every Wix y-offset is shifted up by 50px).
   Below 1000px the stage switches to a stacked, fluid layout.
   ========================================================================== */

:root {
  --Charcoal: #2f2e2e;
  --Ink: #0b0d12;
  --Black: #000000;
  --Mist: #adadac;
  --Snow: #f2f2f2;
  --White: #ffffff;
  --Paper: #fafafa;
  --Coral: #ff6161;
  --Cream: #f7f5e1;

  --FontHelvetica: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --FontAvenir: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --FontProxima: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --FontFutura: Futura, "Futura PT", "Century Gothic", "Helvetica Neue", sans-serif;

  --StageWidth: 980px;
  --HeaderHeight: 130px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--Black);
  color: var(--White);
  font-family: var(--FontHelvetica);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.PageInk { background: var(--Ink); }
body.PageWhite { background: var(--White); }

img { display: block; max-width: none; }
a { color: inherit; }

.VisuallyHidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header (scrolls with page; logo + menu button are pinned) ---------- */

.SiteHeader {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--HeaderHeight);
  background: var(--Charcoal) url("../Image/Compress/HeaderBackground.webp") center / cover no-repeat;
  z-index: 0;
}

.SiteLogo {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 50;
  padding: 4px 41px 4px 41px;
  font-family: var(--FontHelvetica);
  font-weight: 700;
  font-size: 28px;
  line-height: 39.2px;
  letter-spacing: -0.5px;
  color: var(--White);
  text-decoration: none;
  white-space: nowrap;
}

.MenuButton {
  position: fixed;
  top: 52px;
  right: 60px;
  z-index: 60;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--White);
  cursor: pointer;
}

.MenuButton svg { width: 35px; height: 35px; display: block; }
.MenuButton .IconClose { display: none; }
body.MenuOpen .MenuButton .IconOpen { display: none; }
body.MenuOpen .MenuButton .IconClose { display: block; }

/* ---------- Menu overlay ---------- */

.MenuOverlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(47, 46, 46, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.MenuOpen { overflow: hidden; }
body.MenuOpen .MenuOverlay { opacity: 1; visibility: visible; }

.MenuStage {
  position: absolute;
  top: calc(50% - 25px);
  left: 50%;
  width: var(--StageWidth);
  height: 160px;
  transform: translateX(-50%);
}

.MenuLink {
  position: absolute;
  top: var(--Top, 0);
  left: var(--Left, 0);
  width: 172px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  line-height: 39.2px;
  color: var(--White);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.MenuLink:hover { opacity: 0.7; }

/* ---------- Page canvas ---------- */

.Page {
  position: relative;
  min-height: var(--PageHeight, 100vh);
  overflow: hidden;
}

.Stage {
  position: relative;
  width: var(--StageWidth);
  height: var(--PageHeight, 100vh);
  margin: 0 auto;
  z-index: 2;
}

.Abs {
  position: absolute;
  top: var(--Top, 0);
  left: var(--Left, 0);
}

.FullBleed {
  position: absolute;
  top: var(--Top, 0);
  left: 0;
  width: 100%;
  height: var(--Height, auto);
  z-index: 1;
}

/* ---------- Typography ---------- */

.TitleText {
  margin: 0;
  font-family: var(--FontHelvetica);
  font-weight: 300;
  font-size: 28px;
  line-height: 1.25;
  color: var(--White);
  white-space: nowrap;
}

.BodyText {
  width: var(--Width, 350px);
  font-size: 15px;
  line-height: 21px;
  letter-spacing: 0.15px;
  color: var(--Mist);
}

.BodyText p { margin: 0; }
.BodyText p + p { margin-top: 23px; }

.AboutText {
  width: 524px;
  margin: 0;
  font-size: 28px;
  line-height: 34.5px;
  color: var(--White);
}

.FullscreenPage { min-height: 100vh; background: var(--White); }

/* ---------- Buttons and links ---------- */

.OutlineButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 186px;
  height: 40px;
  border: 1px solid var(--White);
  border-radius: 20px;
  background: rgba(242, 242, 242, 0);
  font-family: var(--FontAvenir);
  font-weight: 300;
  font-size: 14px;
  line-height: 19.6px;
  color: var(--White);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.OutlineButton:hover { background: var(--White); color: var(--Charcoal); }

.BackLink {
  font-family: var(--FontAvenir);
  font-weight: 300;
  font-size: 14px;
  line-height: 19.6px;
  color: var(--Charcoal);
  text-decoration: none;
  white-space: nowrap;
}

.BackLink:hover { text-decoration: underline; }

/* ---------- Home ---------- */

.HomeHero {
  background: var(--Coral) url("../Image/Compress/HomeHeroBackground.webp") center / cover no-repeat;
}

.HomeHero .TitleText {
  position: absolute;
  top: 311px;
  left: 0;
  width: 100%;
  text-align: center;
}

.ProjectStrip {
  background-color: var(--Paper);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.StripDesign { background: var(--Charcoal); }

.StripDesign .StripImage {
  position: absolute;
  top: 100px;
  left: 0;
  width: 100%;
  height: 1413px;
  object-fit: cover;
}

.AllProjectsTitle {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
  text-align: center;
}

.ProjectGrid {
  position: absolute;
  top: 49px;
  left: 50%;
  width: 1832px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 584px);
  grid-auto-rows: 329px;
  gap: 40px;
}

.GridItem {
  position: relative;
  display: block;
  overflow: hidden;
  color: var(--White);
  text-decoration: none;
}

.GridItem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.GridItem .GridCaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 13, 18, 0.55);
  font-size: 22px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.GridItem:hover img { transform: scale(1.03); }
.GridItem:hover .GridCaption,
.GridItem:focus-visible .GridCaption { opacity: 1; }

.AnchorDots {
  position: fixed;
  top: 313px;
  right: 59px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 18.3px;
}

.AnchorDots a {
  display: block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--White);
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.2s ease;
}

.AnchorDots a.IsActive,
.AnchorDots a:hover { background: var(--White); }

/* ---------- Project pages ---------- */

.ProjectHero {
  background: var(--Cream) url("../Image/Compress/ProjectHeroBackground.webp") center / cover no-repeat;
  background-attachment: fixed;
}

.ProjectHero.IsStatic { background-attachment: scroll; }

.VideoPlayer {
  width: 800px;
  height: 450px;
  overflow: hidden;
  background: var(--Black);
  cursor: pointer;
}

.VideoPlayer img,
.VideoPlayer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--Black);
}

.VideoPlayer .VideoShade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: background-color 0.3s ease;
}

.VideoPlayer:hover .VideoShade { background: rgba(0, 0, 0, 0.5); }

.VideoPlayer .VideoTitle {
  position: absolute;
  top: 168px;
  left: 106px;
  width: 588px;
  margin: 0;
  font-family: var(--FontProxima);
  font-weight: 400;
  font-size: 40px;
  line-height: 60px;
  text-align: center;
}

.VideoPlayer .VideoPlay {
  position: absolute;
  top: 248px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
}

.VideoPlayer .VideoPlay svg { width: 30px; height: 30px; }
.VideoPlayer .VideoPlay span { text-decoration: underline; text-underline-offset: 2px; }

.VideoPlayer.IsPlaying { cursor: default; }
.VideoPlayer.IsPlaying .VideoShade,
.VideoPlayer.IsPlaying .VideoTitle,
.VideoPlayer.IsPlaying .VideoPlay,
.VideoPlayer.IsPlaying > img { display: none; }

.FeatureImage {
  width: var(--Width);
  height: var(--Height);
  object-fit: cover;
}

.BleedImage {
  position: absolute;
  top: var(--Top);
  left: 50%;
  width: 1840px;
  height: 485px;
  transform: translateX(-50%);
  object-fit: cover;
  z-index: 1;
}

.DocLink {
  display: block;
  width: 85px;
  height: 128px;
  color: var(--Mist);
}

.DocLink svg { width: 100%; height: 100%; }
.DocLink:hover { color: var(--White); }

/* ---------- Slideshow gallery (Design / Art portfolio) ---------- */

.Slideshow {
  width: var(--Width);
}

.SlideViewport {
  position: relative;
  width: 100%;
  height: 721px;
  overflow: hidden;
  background: var(--Mist);
}

.SlideTrack {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
}

.Slide {
  flex: 0 0 100%;
  height: 100%;
  cursor: zoom-in;
}

.Slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.SlideArrow {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  border: 0;
  background: transparent;
  color: var(--White);
  cursor: pointer;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

.SlideArrow svg { width: 24px; height: 44px; }
.SlideArrow.Prev { left: 10px; }
.SlideArrow.Next { left: calc(min(100%, 100vw - var(--ViewportLeft, 0px)) - 54px); }

.ThumbStrip {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-left: 5px;
  transition: transform 0.4s ease;
}

.Thumb {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  padding: 0;
  border: 0;
  background: var(--White) center / cover no-repeat;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.Thumb.IsActive,
.Thumb:hover { opacity: 1; }

/* ---------- Footer ---------- */

.SiteFooter {
  position: relative;
  height: 333px;
  background: var(--Charcoal) url("../Image/Compress/FooterBackground.webp") center / cover no-repeat;
}

.FooterStage {
  position: relative;
  width: var(--StageWidth);
  height: 100%;
  margin: 0 auto;
}

.FooterContact {
  position: absolute;
  top: 46px;
  left: 680px;
  width: 300px;
  text-align: center;
  font-size: 28px;
  line-height: 35px;
  color: var(--Snow);
}

.FooterContact h2 {
  margin: 0;
  font-weight: 300;
  font-size: 28px;
  line-height: 35px;
  color: var(--White);
}

.FooterContact p { margin: 12px 0 0; }
.FooterContact h2 + p { margin-top: 20px; }
.FooterContact a { color: var(--Snow); text-decoration: underline; }
.FooterContact a:hover { color: var(--White); }

/* ---------- Narrow screens: stack the stage ---------- */

@media (max-width: 1000px) {
  :root { --HeaderHeight: 96px; }

  .SiteLogo { top: 18px; left: 0; padding: 4px 20px; font-size: 22px; line-height: 30px; }
  .MenuButton { top: 20px; right: 20px; width: 30px; height: 30px; }
  .MenuButton svg { width: 30px; height: 30px; }

  .MenuStage { position: static; width: auto; height: 100%; transform: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
  .MenuLink { position: static; }

  .Page { min-height: 0; padding-bottom: 60px; }
  .Stage { width: auto; height: auto; padding: 0 20px; }
  .Abs { position: static; margin-top: 24px; }
  .FullBleed { position: relative; top: 0; }

  .TitleText { white-space: normal; }
  .BodyText { width: auto; max-width: 520px; }

  .HomeHero { height: 70vh !important; min-height: 360px; }
  .HomeHero .TitleText { top: auto; bottom: 18%; }
  .ProjectStrip { height: 60vh !important; min-height: 320px; background-attachment: scroll; }
  .ProjectStrip .Abs { position: absolute; margin: 0; top: 24px !important; left: 20px !important; }
  .StripDesign { height: auto !important; padding: 24px 0 0; }
  .StripDesign .Abs { margin-top: 0; }
  .StripDesign .StripImage { position: static; height: auto; margin-top: 24px; aspect-ratio: 2000 / 1414; }
  .StripSpacer { display: none; }

  .AllProjects { height: auto !important; padding: 56px 20px 20px; }
  .AllProjectsTitle { position: static; margin-bottom: 20px; }
  .ProjectGrid { position: static; width: auto; transform: none; grid-template-columns: 1fr; grid-auto-rows: auto; gap: 20px; }
  .GridItem { aspect-ratio: 584 / 329; }
  .GridItem .GridCaption { opacity: 1; background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.6)); align-items: flex-end; padding: 14px; justify-content: flex-start; font-size: 18px; }
  .AnchorDots { display: none; }

  .ProjectHero { height: 50vh !important; min-height: 280px; background-attachment: scroll; }
  .Page > .Stage > .TitleText.Abs { margin-top: 40px; }

  .VideoPlayer { position: relative !important; top: 0; left: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .DocLabel { margin-top: 24px !important; }
  .VideoPlayer .VideoTitle { top: auto; bottom: 50%; left: 0; width: 100%; font-size: 22px; line-height: 28px; padding: 0 12px; }
  .VideoPlayer .VideoPlay { top: 58%; bottom: auto; font-size: 16px; }
  a.Abs { display: block; }

  .FeatureImage { width: 100%; height: auto; }
  .BleedImage { position: relative; top: 0; left: 0; width: 100%; height: auto; transform: none; margin-top: 24px; aspect-ratio: 1840 / 485; }

  .Slideshow { width: 100% !important; margin-left: 0 !important; }
  .SlideViewport { height: auto; aspect-ratio: 16 / 9; }
  .SlideArrow.Next { left: auto; right: 10px; }
  .ThumbStrip { overflow-x: auto; transform: none !important; padding-bottom: 6px; }
  .Thumb { flex-basis: 72px; width: 72px; height: 72px; }

  .BackLink { display: inline-block; margin-top: 40px; color: var(--Mist); }

  .SiteFooter { height: auto; padding: 40px 20px; }
  .FooterStage { width: auto; }
  .FooterContact { position: static; width: auto; font-size: 20px; line-height: 28px; }
  .FooterContact h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .SlideTrack, .ThumbStrip, .GridItem img { transition: none; }
}
