/* ============================================================
   ZION Designs — Jerome Caras Portfolio
   CSS Architecture: Mobile-first, semantic, performance-aware
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
  /* Motion system — the only three easings allowed */
  --ease-signature: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-float: cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Color palette */
  --clr-bg: #050505;
  --clr-dark: #050505;
  --clr-text: #f0f0f0;
  --clr-subtle: rgba(255, 255, 255, 0.45);
  --clr-accent: #a8bbbb;

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing scale */
  --spacing-base: clamp(2rem, 5vw, 4rem);
  --spacing-loose: clamp(3rem, 8vw, 6rem);
  --spacing-extreme: clamp(5rem, 12vw, 10rem);
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Lenis needs these to take over scroll */
html.lenis,
html.lenis body {
  height: auto;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Lenis handles this */
}

body {
  font-family: var(--font-sans);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* a11y skip link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 1rem 2rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  background: var(--clr-accent);
  color: var(--clr-dark);
  z-index: 9999;
  border-radius: 4px;
  font-weight: 600;
}

/* --- TYPOGRAPHY --- */
.display-font {
  font-family: var(--font-display);
  font-weight: 700;
}

.section-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

/* --- LAYOUT --- */
.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.section {
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

/* --- LOADER --- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--clr-dark);
  z-index: 9999;
  pointer-events: none;
}

/* --- SCROLL ORB --- */
.orb-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 10;
}

.scroll-orb {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, 
    #ffffff 0%, 
    rgba(168, 187, 187, 1) 30%, 
    rgba(50, 70, 70, 1) 70%, 
    #000000 100%
  );
  box-shadow: 
    0 0 30px rgba(168, 187, 187, 0.6),
    0 0 60px rgba(168, 187, 187, 0.3),
    0 0 90px rgba(168, 187, 187, 0.1);
  pointer-events: none;
  z-index: 11;
  mix-blend-mode: screen;
}

/* --- HERO SECTION --- */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  justify-content: flex-end;
  padding-bottom: var(--spacing-base);
}

.hero__image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: var(--clr-dark);
}

/* The WebGL canvas fills the hero background */
#hero-rays-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Dark gradient overlay — ensures text stays readable */
.hero__image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 0.1) 0%,
    rgba(5, 5, 5, 0.4) 50%,
    rgba(5, 5, 5, 0.95) 100%
  );
  z-index: 1;
}

.hero__container {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 3rem;
}

@media (min-width: 768px) {
  .hero__container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
  }
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero__title {
  font-size: clamp(3.5rem, 12vw, 10rem);
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
  color: var(--clr-text); /* Explicitly white so it's always visible */
}

.hero__title-line {
  display: block;
  overflow: hidden; /* Clip for stagger reveal */
  padding-left: 0.1em;
  padding-right: 0.1em;
  margin-left: -0.1em;
  margin-right: -0.1em;
  padding-bottom: 2rem;
}

/* The inner span that actually translates up */
.hero__title-text {
  display: block;
  transform: translateY(130%); /* Hidden by default, GSAP reveals */
}

.hero__title-line:nth-child(2) {
  padding-left: 10%;
  color: var(--clr-accent);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-subtle);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  max-width: 400px;
  opacity: 0; /* GSAP will fade in */
}

.hero__role {
  color: var(--clr-text);
}

.hero__profile-badge {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-end; /* Right align on mobile */
  opacity: 0; /* GSAP will fade in */
}

@media (min-width: 768px) {
  .hero__profile-badge {
    align-self: auto;
  }
}

.hero__profile-blob {
  width: clamp(140px, 15vw, 180px); /* Responsive and bigger */
  height: clamp(140px, 15vw, 180px);
  aspect-ratio: 1/1;
  overflow: visible;
}

.hero__profile-blob #blobClip {
  transform-origin: center;
  transition: transform 0.4s var(--ease-float);
}

.hero__profile-blob:hover #blobClip {
  transform: scale(1.10);
}

.hero__profile-blob .blob-text-content {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  fill: var(--clr-subtle);
  transition: fill 0.5s var(--ease-float);
  user-select: none;
  pointer-events: none;
}

.hero__profile-blob:hover .blob-text-content {
  fill: var(--clr-text);
}

/* --- IDENTITY / ABOUT SECTION --- */
.identity {
  background-color: var(--clr-dark);
  color: var(--clr-text);
  padding: var(--spacing-extreme) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.identity__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-loose);
}

.identity__tagline {
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.identity__tagline-indent {
  padding-left: 15%;
  color: var(--clr-accent);
  display: block;
}

.identity__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-base);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--spacing-base);
}

@media (min-width: 768px) {
  .identity__grid {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-loose);
  }
}

.identity__bio-text {
  font-size: clamp(1.25rem, 3vw, 2.5rem);
  line-height: 1.4;
  font-weight: 300;
  max-width: 800px;
}

.text-highlight {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--clr-accent);
}

.identity__meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-subtle);
}

.meta-value {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.4;
}

/* --- WORK / PORTFOLIO SECTION --- */
.work {
  background-color: var(--clr-bg);
  padding: var(--spacing-extreme) 0;
}

.work__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-loose);
}

.work__header {
  max-width: 800px;
}

.work .section-title {
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.85;
}

.work__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--clr-subtle);
  margin-top: 2rem;
}

/* Masonry via CSS columns */
.work__gallery {
  column-count: 1;
  column-gap: 2rem;
  width: 100%;
}

@media (min-width: 768px) {
  .work__gallery {
    column-count: 2;
  }
}

@media (min-width: 1200px) {
  .work__gallery {
    column-count: 3;
  }
}

.work__card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 2rem;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  transition: transform 0.4s var(--ease-signature), box-shadow 0.4s var(--ease-signature);
}

.work__card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.work__card iframe {
  display: block;
  width: 100%;
}

/* Overlay blocks FB scroll hijack */
.work__card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background-color: rgba(5, 5, 5, 0);
  transition: background-color 0.3s var(--ease-smooth);
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.work__card:hover .work__card-overlay {
  background-color: rgba(5, 5, 5, 0.4);
  backdrop-filter: blur(2px);
}

.overlay-text {
  color: var(--clr-text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth),
    background-color 0.3s var(--ease-smooth);
}

.work__card:hover .overlay-text {
  opacity: 1;
  transform: translateY(0);
}

.overlay-text:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* --- CONTACT / CTA SECTION --- */
.contact {
  background-color: var(--clr-dark);
  color: var(--clr-text);
  padding: var(--spacing-extreme) 0 4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  min-height: auto;
}

.contact__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-base);
}

.contact__title {
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.85;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  margin-bottom: var(--spacing-base);
}

.contact__title-indent {
  padding-left: 10%;
  color: var(--clr-accent);
  display: block;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-bottom: var(--spacing-loose);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .contact__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact__links,
.contact__socials {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-style: normal; /* Reset address italic */
}

.contact-link {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--clr-text);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.3s var(--ease-float), padding-left 0.3s var(--ease-float);
}

.contact-link:hover {
  color: var(--clr-accent);
  padding-left: 1rem;
}

.social-link {
  font-size: 1.125rem;
  color: var(--clr-subtle);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s var(--ease-float);
  width: fit-content;
  /* Touch-friendly tap target */
  padding: 0.5rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.social-link:hover {
  color: var(--clr-text);
}

.contact__footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 2rem;
  color: var(--clr-subtle);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .contact__footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__title-text {
    transform: none !important;
  }

  .hero__meta,
  .hero__profile-badge {
    opacity: 1 !important;
  }
}