/* ===========================================================================
   ORI KOPITZ — PORTFOLIO STYLESHEET
   Palette : --c-bg (ultra-dark off-black) / --c-cream (#fcfaf2)
   Type    : Bricolage Grotesque (display) / Archivo (body) / IBM Plex Mono (utility)
   =========================================================================== */

/* ---------------------------------------------------------------------------
   0. TOKENS
   --------------------------------------------------------------------------- */
:root{
  /* colour */
  --c-bg:        #111110;                 /* ultra-dark warm off-black */
  --c-bg-soft:   #1a1a18;                 /* panel / placeholder tone  */
  --c-bg-soft-2: #232320;
  --c-cream:     #fcfaf2;                 /* primary light colour      */
  --c-cream-85:  rgba(252,250,242,.85);
  --c-cream-65:  rgba(252,250,242,.62);
  --c-cream-40:  rgba(252,250,242,.4);
  --c-line:      rgba(252,250,242,.16);
  --c-line-soft: rgba(252,250,242,.08);
  --c-ink:       #111110;                 /* text printed ON cream     */
  --c-axis-gray: #8c8a80;                 /* fine center line + ticks  */

  /* type */
  --f-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-mono:    'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* layout */
  --header-h:    155px;
  --gutter:      clamp(1.5rem, 4vw, 3.5rem);
  --max-w:       1480px;
  --axis-w:      88px;
  --radius-s:    2px;
  --radius-m:    4px;

  /* motion */
  --ease-out:    cubic-bezier(.16,.84,.32,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --dur-s: .35s;
  --dur-m: .6s;
  --dur-l: .9s;
}

@media (max-width: 860px){
  :root{ --header-h: 155px; }
}

/* ---------------------------------------------------------------------------
   1. RESET / BASE
   --------------------------------------------------------------------------- */
*,*::before,*::after{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

html{
  background: var(--c-bg);
  scroll-behavior: auto; /* GSAP ScrollToPlugin drives smooth scroll, not native CSS */
}

body{
  background: var(--c-bg);
  color: var(--c-cream);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.lock-scroll{ overflow: hidden; height: 100vh; }

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; background: none; border: none; color: inherit; cursor: pointer; }
ul{ margin: 0; padding: 0; }
h1,h2,h3,h4,p{ margin: 0; }

::selection{ background: var(--c-cream); color: var(--c-bg); }

/* visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible{
  outline: 1.5px solid var(--c-cream);
  outline-offset: 4px;
  border-radius: var(--radius-s);
}

::-webkit-scrollbar{ width: 9px; }
::-webkit-scrollbar-track{ background: var(--c-bg); }
::-webkit-scrollbar-thumb{ background: var(--c-bg-soft-2); border-radius: 6px; }

/* ---------------------------------------------------------------------------
   2. LOADER
   --------------------------------------------------------------------------- */
.loader{
  position: fixed; inset: 0;
  background: var(--c-bg);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.loader-mark{
  font-family: var(--f-mono);
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--c-cream-40);
  opacity: 0;
}

/* ---------------------------------------------------------------------------
   3. HEADER  (fixed — transparent glass strip that lets the pinned hero
      video peek through behind it for the entire scroll of the page)
   --------------------------------------------------------------------------- */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 60;
  background: none;
}
.header-inner{
  width: 100%;
  height: 100%;
  padding: 87px clamp(20px, 6vw, 96px) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.brand{
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin-left: clamp(30px, 5.5vw, 88px);
}
.brand-logo{ height: 66px; width: auto; }
.brand-name{
  font-family: var(--f-display);
  font-size: 2.03rem;
  letter-spacing: .01em;
  font-weight: 600;
}
.main-nav{
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 3.4vw, 3rem);
  margin-right: clamp(10px, 2vw, 26px);
}
.nav-link{
  position: relative;
  font-size: 1.5rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 4px;
}
.nav-link::after{
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--c-cream);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-s) var(--ease-out);
}
.nav-link:hover::after{ transform: scaleX(1); }
.nav-link--btn{ font-family: inherit; }

/* ---------------------------------------------------------------------------
   4. HERO  — the showreel background is fixed/pinned and stays mounted
      behind the whole document; Features then rises over it and sticks
      just under the header, leaving a permanent peek-strip.
   --------------------------------------------------------------------------- */
.hero{
  position: relative;
  height: 100vh;
  width: 100%;
  z-index: 0;
  overflow: hidden;
}
.hero-video-wrap{
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  overflow: hidden;
  background: var(--c-bg);
}
.hero-video{
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw;     /* 16:9 cover-fit */
  min-height: 100vh; min-width: 177.78vh;
  transform: translate(-50%,-50%);
  pointer-events: none;
}
.hero-scrim{
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(17,17,16,.15) 0%, rgba(17,17,16,.05) 40%, rgba(17,17,16,.55) 100%);
}
.scroll-cue{
  position: absolute;
  left: 50%; bottom: clamp(2.6rem, 8vh, 5rem);
  transform: translateX(-50%);
  z-index: 1;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-cream);
  opacity: 0;
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out);
}
.scroll-cue:hover{ background: var(--c-cream); color: var(--c-bg); border-color: var(--c-cream); }
.scroll-cue svg{ animation: cueBob 2.4s ease-in-out infinite; }
@keyframes cueBob{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(4px); } }

/* ---------------------------------------------------------------------------
   5. FEATURES — sticks just beneath the header and rises over the hero
   --------------------------------------------------------------------------- */
.features{
  position: sticky;
  top: var(--header-h);
  z-index: 2;
  background: var(--c-bg);
  border-top: 1px solid var(--c-line-soft);
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(8rem, 16vh, 11rem);
  min-height: 100vh;
}
.features-title{
  text-align: center;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: .01em;
  margin-bottom: clamp(0.75rem, 1.5vh, 1rem);
}

.features-grid{
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  gap: clamp(4.5rem, 11vh, 8rem);
}

.axis-column{
  position: absolute;
  top: 8px; bottom: 0; left: 50%;
  width: var(--axis-w);
  transform: translateX(-50%);
  background: var(--c-cream);
  pointer-events: none;
  z-index: 0;
}
.axis-fill{
  position: absolute;
  top: 8px; bottom: 0;
  left: calc(50% - .5px);
  width: 1px;
  background: var(--c-axis-gray);
}
.axis-ticks{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.axis-tick{
  position: absolute;
  height: 1px;
  background: var(--c-axis-gray);
  transform: translateY(-50%);
}

/* ---------------------------------------------------------------------------
   6. PROJECT CARDS — alternate sides of the axis, zig-zag down the page
   --------------------------------------------------------------------------- */
.project-card{
  position: relative;
  width: min(46%, 560px);
  opacity: 0;
  transform: translateY(50px);
  cursor: pointer;
}
.project-card:nth-child(odd){  align-self: flex-end; }   /* right of the axis */
.project-card:nth-child(even){ align-self: flex-start; } /* left of the axis  */

.project-video{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--c-bg-soft);
  overflow: hidden;
}
.project-video::after{
  content: '';
  position: absolute; inset: 0;
  border: 1px solid var(--c-line-soft);
  pointer-events: none;
  transition: border-color var(--dur-s) var(--ease-out);
}
.project-card:hover .project-video::after{ border-color: var(--c-line); }
.project-video iframe{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  pointer-events: none; /* clicks pass through to .project-card so the whole tile opens the overlay */
}

.project-title-bar{
  margin-top: 14px;
  background: var(--c-cream);
  color: var(--c-ink);
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .85rem 1.1rem;
}
.project-num{
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  opacity: .55;
  flex-shrink: 0;
}
.project-name{
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .005em;
}
.project-card:nth-child(even) .project-title-bar{ justify-content: flex-start; }
.project-card:nth-child(odd)  .project-title-bar{ justify-content: flex-start; }

/* ---------------------------------------------------------------------------
   7. PAGE-WIPE TRANSITION LAYER
   --------------------------------------------------------------------------- */
.view-wipe{
  position: fixed; inset: 0;
  background: var(--c-bg);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   8. PROJECT VIEW
   --------------------------------------------------------------------------- */
.project-view{
  position: fixed; inset: 0;
  z-index: 120;
  background: var(--c-bg);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
}
.project-view.is-open{ visibility: visible; }

.project-view-inner{
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100%;
  padding: calc(var(--header-h) + 2.5rem) var(--gutter) 6rem;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.project-view-side{
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.work-back-btn{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
  width: fit-content;
}
.work-back-btn svg{ transition: transform var(--dur-s) var(--ease-out); }
.work-back-btn:hover svg{ transform: translateX(-4px); }
.project-view-index{
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--c-cream-40);
  letter-spacing: .04em;
}
.project-view-title{
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin-bottom: 1.6rem;
}
.project-view-video-wrap{
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-bg-soft);
}
.project-view-video{ width: 100%; height: 100%; }
.project-view-video iframe{ width: 100%; height: 100%; border: 0; }

.project-view-desc{
  margin-top: 2.2rem;
  max-width: 720px;
  color: var(--c-cream-85);
}
.project-view-desc p{ font-size: .98rem; line-height: 1.7; margin-bottom: 1.1rem; }
.project-view-desc h4{
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-cream-40);
  margin: 1.8rem 0 1rem;
}
.project-view-desc ul{ display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.4rem; }
.project-view-desc li{ font-size: .94rem; line-height: 1.65; color: var(--c-cream-65); padding-left: 1.1rem; position: relative; }
.project-view-desc li::before{
  content: ''; position: absolute; left: 0; top: .55em;
  width: 5px; height: 1px; background: var(--c-cream-40);
}
.project-view-desc li strong{ color: var(--c-cream); font-weight: 600; }
.project-view-desc .credit-line{ font-size: .85rem; font-style: italic; color: var(--c-cream-40); }
.project-view-desc .software-line{ font-size: .85rem; color: var(--c-cream-65); border-top: 1px solid var(--c-line-soft); padding-top: 1rem; }
.project-view-desc .software-line strong{ color: var(--c-cream); }

.showreel-details .project-view-desc p{ font-size: 1.2rem; line-height: 1.65; }
.showreel-details .project-view-desc h4{ font-size: .9rem; }
.showreel-details .project-view-desc li{ font-size: 1.08rem; line-height: 1.6; }
.showreel-details .project-view-desc .software-line{ font-size: 1.05rem; }

/* ---------------------------------------------------------------------------
   9. SHOWREEL VIEW
   --------------------------------------------------------------------------- */
.showreel-view{
  position: fixed; inset: 0;
  z-index: 130;
  background: var(--c-bg);
  box-shadow: 0 0 0 120px var(--c-bg);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.showreel-view.is-open{ visibility: visible; }

.showreel-screen{
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.showreel-bg{ position: absolute; inset: 0; overflow: hidden; }
.showreel-bg iframe{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.showreel-scrim{ position: absolute; inset: 0; background: rgba(17,17,16,.45); }

.showreel-play{
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 118px; height: 118px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem;
  border: 1px solid var(--c-cream);
  background: rgba(17,17,16,.25);
  backdrop-filter: blur(4px);
  color: var(--c-cream);
  z-index: 2;
  transition: background var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out);
}
.showreel-play span{
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.showreel-play:hover{ background: var(--c-cream); color: var(--c-bg); }

.showreel-scroll-cue{
  position: absolute;
  left: 50%; bottom: clamp(2rem, 6vh, 3.5rem);
  transform: translateX(-50%);
  z-index: 2;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-cream);
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out);
}
.showreel-scroll-cue:hover{ background: var(--c-cream); color: var(--c-bg); border-color: var(--c-cream); }
.showreel-scroll-cue svg{ animation: cueBob 2.4s ease-in-out infinite; }

.showreel-details{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--c-bg);
  padding: clamp(3.5rem, 8vh, 5.5rem) var(--gutter) 6rem;
}
.showreel-details .project-view-desc{ max-width: 720px; margin: 0 auto; }

.showreel-footer{
  position: relative;
  z-index: 1;
  background: var(--c-bg);
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--gutter) 4rem;
}
.showreel-back-to-top{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: none;
  color: var(--c-cream);
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out);
}
.showreel-back-to-top:hover{ background: var(--c-cream); color: var(--c-bg); border-color: var(--c-cream); }

.showreel-lightbox{
  position: fixed; inset: 0;
  z-index: 135;
  background: rgba(17,17,16,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  padding: var(--gutter);
}
.showreel-lightbox.is-open{ visibility: visible; }
.showreel-lightbox-video{
  width: min(92vw, 1280px);
  aspect-ratio: 16/9;
  background: var(--c-bg);
}
.showreel-lightbox-video iframe{ width: 100%; height: 100%; border: 0; }
.overlay-close--lightbox{ top: calc(var(--header-h) * .35); }

/* generic close button used by showreel / info overlays — fixed so it stays
   put even while the showreel panel scrolls internally */
.overlay-close{
  position: fixed;
  top: calc(var(--header-h) * .35);
  right: var(--gutter);
  z-index: 136;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-cream);
  transition: border-color var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}
.overlay-close:hover{ border-color: var(--c-cream); transform: rotate(90deg); }

/* ---------------------------------------------------------------------------
   10. INFO OVERLAY
   --------------------------------------------------------------------------- */
.info-overlay{
  position: fixed; inset: 0;
  z-index: 140;
  background: var(--c-bg);
  opacity: 0;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
}
.info-overlay.is-open{ visibility: visible; }
.info-inner{
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) var(--gutter) 4rem;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-content: center;
}
.info-col--bio{ display: flex; flex-direction: column; gap: 1.4rem; }
.info-col--bio p{
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.1vw, 1.65rem);
  line-height: 1.45;
  color: var(--c-cream-85);
}
.info-col--contact{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  border-left: 1px solid var(--c-line-soft);
  padding-left: clamp(1.5rem, 3vw, 3rem);
}
.info-contact-label{
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-cream-40);
}
.info-socials{ display: flex; align-items: center; gap: 1.1rem; }
.social-link{
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  transition: background var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out), border-color var(--dur-s) var(--ease-out);
}
.social-link:hover{ background: var(--c-cream); color: var(--c-bg); border-color: var(--c-cream); }
.info-phone{
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--f-mono);
  font-size: .92rem;
  letter-spacing: .02em;
  width: fit-content;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--c-line);
  transition: border-color var(--dur-s) var(--ease-out), opacity var(--dur-s) var(--ease-out);
}
.info-phone:hover{ border-color: var(--c-cream); opacity: .8; }

.info-reveal{ opacity: 0; transform: translateY(22px); }

/* ---------------------------------------------------------------------------
   11. BACK TO TOP
   --------------------------------------------------------------------------- */
.back-to-top{
  position: fixed;
  right: clamp(1.2rem, 3vw, 2.4rem);
  bottom: clamp(1.2rem, 3vw, 2.4rem);
  z-index: 70;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-cream);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out);
}
.back-to-top.is-visible{ opacity: 1; visibility: visible; }
.back-to-top:hover{ background: var(--c-cream); color: var(--c-bg); border-color: var(--c-cream); }

/* ---------------------------------------------------------------------------
   12. RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 900px){
  :root{ --axis-w: 46px; }
  .project-card{ width: min(46%, 420px); }
  .info-inner{ grid-template-columns: 1fr; align-content: start; gap: 2.4rem; }
  .info-col--contact{ border-left: none; padding-left: 0; border-top: 1px solid var(--c-line-soft); padding-top: 1.8rem; }
  .project-view-inner{ grid-template-columns: 1fr; }
  .project-view-side{ flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 600px){
  :root{ --header-h: 130px; }
  .header-inner{ padding-top: 60px; }
  .main-nav{ gap: 1.1rem; }
  .nav-link{ font-size: 1.06rem; }
  .brand-name{ font-size: 1.3rem; }
  .brand-logo{ height: 44px; }
  .brand{ gap: .9rem; margin-left: 8px; }
  .main-nav{ margin-right: 8px; }
  .axis-column, .axis-ticks{ display: none; }
  .features-grid{ padding: 0 1.1rem; gap: 3.2rem; }
  .project-card{ width: calc(100% - 32px); }
  .project-card:nth-child(odd),
  .project-card:nth-child(even){ align-self: flex-end; margin-right: 0; }
  .showreel-play{ width: 92px; height: 92px; }
  .overlay-close{ width: 38px; height: 38px; }
}

/* ---------------------------------------------------------------------------
   13. REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  .scroll-cue svg,
  .showreel-scroll-cue svg{ animation: none; }
  .project-card,
  .scroll-cue,
  .info-reveal{ transition: none !important; }
}
