/*
 * EYS site design — ported from the Astro build (src/styles/global.css).
 * --accent-green / --bg-dark / --section-bg are re-declared inline in
 * wp_head (see functions.php eys_inline_theme_vars) from the Customizer,
 * overriding the defaults below by cascade order.
 */

:root {
  --bg-dark: #000000;
  --bg-card: #121212;
  --accent-green: #7ac142;
  --accent-green-light: #8ad34f;
  --title: #f5f5f7;
  --muted: #a1a1a6;
  --section-bg: #eeece6;
  --section-fg: #0a0a0a;
  --section-muted: rgba(10, 10, 10, 0.55);
  --nav-height: 70px;
  --rail-width: 96px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis-smooth {
  scroll-behavior: auto !important;
}

html.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--muted);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 900px) {
  .site-header {
    display: none;
  }
}

/* Rail — fixed left sidebar, desktop only */
.rail {
  display: none;
}

@media (min-width: 900px) {
  .rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-width);
    background: var(--rail-bg, transparent);
    padding: 24px 0 32px;
    z-index: 80;
  }

  .rail-logo img {
    width: 78px;
    height: auto;
  }

  .rail-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    color: var(--muted);
  }

  .rail-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s var(--ease);
  }

  .rail-social a:hover {
    color: var(--accent-green);
  }

  .content-shell {
    margin-left: var(--rail-width);
  }
}

/* Topbar — desktop nav overlay with mix-blend color inversion, like hki */
.eys-topbar {
  display: none;
}

@media (min-width: 900px) {
  .eys-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    position: fixed;
    top: 0;
    left: var(--rail-width);
    right: 0;
    z-index: 70;
    padding: 28px 40px 0;
    pointer-events: none;
  }

  .eys-topbar a,
  .eys-topbar button {
    pointer-events: auto;
  }

  .topbar-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .topbar-brand .brand-title,
  .topbar-nav a,
  .topbar-brand .brand-subtitle {
    color: #fff;
    mix-blend-mode: difference;
  }

  .topbar-brand .brand-title {
    font-size: 0.95rem;
  }

  .topbar-nav {
    display: flex;
    align-items: center;
    gap: 32px;
  }

  .topbar-nav a {
    position: relative;
    font-size: 0.85rem;
  }

  .topbar-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: #fff;
    mix-blend-mode: difference;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease);
  }

  .topbar-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  /* Contact button stays a normal (non-blended) element — a solid green
     button under mix-blend-mode:difference would render broken/illegible. */
  .topbar-actions {
    position: relative;
    mix-blend-mode: normal;
  }
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.5rem;
  height: var(--nav-height);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  transition: opacity 0.15s var(--ease);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
}

.nav-link {
  color: var(--title);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-green);
}

.btn-contact {
  background: var(--accent-green);
  color: #000;
  padding: 0.55rem 1.3rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-contact:hover {
  transform: scale(1.03);
  background-color: var(--accent-green-light);
}

.contact-popover {
  display: none;
  position: absolute;
  top: 55px;
  right: 0;
  width: 300px;
  background: var(--accent-green);
  color: #000;
  padding: 1.4rem;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.contact-popover.is-active {
  display: block;
  animation: popoverIn 0.3s ease-out;
}

.contact-popover h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding-bottom: 0.4rem;
}

.contact-popover label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 0.7rem;
  opacity: 0.8;
}

.contact-popover a {
  display: block;
  color: #000;
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.1rem;
}

.contact-popover a:hover {
  text-decoration: underline;
}

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

/* Mobile menu */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 26px;
  padding: 8px 0;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--title);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu a,
.mobile-menu button {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--title);
}

.mobile-menu .mobile-contact {
  margin-top: 12px;
  text-align: center;
  font-size: 1rem;
}

.mobile-menu .mobile-contact a {
  display: block;
  color: var(--accent-green);
  font-size: 1rem;
  font-weight: 500;
  margin-top: 6px;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

@media (max-width: 767px) {
  .nav-right .nav-link,
  .nav-right .btn-contact {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  height: 92vh;
  margin-top: var(--nav-height);
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

@media (min-width: 900px) {
  .hero {
    /* The rail/topbar are transparent overlays at desktop (like hki), so
       the hero bleeds full-bleed underneath instead of being pushed down. */
    height: 100vh;
    margin-top: 0;
  }
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide.is-active {
  opacity: 1;
  z-index: 1;
}

.slide-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
}

.slide.is-active .slide-media {
  animation: kenburns 8s linear forwards;
}

@keyframes kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.slide-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.slide-overlay::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
}

.slide-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease) 0.35s, transform 0.9s var(--ease) 0.35s;
}

.slide.is-active .slide-content {
  opacity: 1;
  transform: translateY(0);
}

.slide-content h1 {
  font-size: clamp(1.9rem, 5.5vw, 3.2rem);
  font-weight: 700;
  color: var(--title);
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem;
}

.slide-content p {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--muted);
  font-weight: 400;
  max-width: 620px;
  margin: 0 auto;
}

.slide-content strong {
  color: var(--accent-green);
  font-weight: 600;
}

.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 0 1.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-progress-track {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-green);
}

.hero-progress-track.is-done .hero-progress-fill {
  width: 100%;
}

.hero-progress-track.is-active .hero-progress-fill {
  animation: fillProgress linear forwards;
}

@keyframes fillProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@media (max-width: 767px) {
  .hero {
    height: 72vh;
  }

  .hero-progress {
    display: none;
  }
}

/* Color rhythm — alternating light/dark zones, like hki.paris */
.zone-light {
  background: var(--section-bg);
  color: var(--section-fg);
}

.zone-light h2,
.zone-light h3,
.zone-light h4 {
  color: var(--section-fg);
}

.zone-light .section-tagline {
  color: var(--accent-green);
}

.zone-dark {
  background: var(--bg-dark);
  color: var(--muted);
}

/* Section shells */
.section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  scroll-margin-top: var(--nav-height);
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.works-shell {
  padding: 5rem 0;
  scroll-margin-top: var(--nav-height);
}

.mission-section,
.about-section {
  scroll-margin-top: var(--nav-height);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tagline {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-green);
  margin-bottom: 0.6rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-header p {
  font-size: 1.05rem;
  margin-top: 0.5rem;
  opacity: 0.75;
}

/* Big "Latest work"-style heading, hki pattern */
.work-heading-row {
  margin-bottom: 3.5rem;
}

.work-heading-row h2 {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Works — category grid */
.work-category {
  margin-bottom: 4rem;
}

.work-category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 12px;
}

.work-category-header h3 {
  font-size: 1.4rem;
  margin: 0;
}

.work-category-count {
  font-size: 0.8rem;
  opacity: 0.75;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  will-change: transform, opacity;
}

.work-card.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .work-card {
    opacity: 1;
    transform: none;
  }
}

.work-card-media {
  position: absolute;
  inset: -8% 0;
  height: 116%;
  z-index: 0;
}

.work-card-media img,
.work-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.85) 100%);
}

.work-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.work-card:hover::after {
  opacity: 1;
}

.work-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px;
  color: #fff;
}

.work-card-index {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  margin-bottom: 4px;
}

.work-card-caption h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.work-card-view {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #000;
  font-size: 1.1rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}

.work-card:hover .work-card-view {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (hover: none) {
  .work-card-view {
    display: none;
  }
}

/* Vision — scroll-linked word reveal, hki-style */
.vision {
  padding: 6rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 55vh;
  scroll-margin-top: var(--nav-height);
}

.vision-text {
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  line-height: 1.5;
  font-weight: 500;
  margin: 0 auto;
  max-width: 640px;
}

.vision-text .word-inner {
  opacity: 0.2;
  transition: opacity 0.2s linear;
}

@media (prefers-reduced-motion: reduce) {
  .vision-text .word-inner {
    opacity: 1;
  }
}

@media (min-width: 900px) {
  .vision {
    padding: 0 56px;
    min-height: 70vh;
  }
}

/* Mission — parallax + glitch, hki-style */
.mission-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}

.mission-bg {
  position: absolute;
  inset: -10% 0;
  z-index: -1;
}

.mission-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(1.1);
}

.mission-tagline {
  position: absolute;
  top: 28px;
  left: 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
}

.mission-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.mission-content h2 {
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  margin: 0 0 24px;
  color: #fff;
}

.mission-content p {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-style: italic;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 16px;
}

.mission-quote-author {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-glitch] {
  --glitch: 0px;
  text-shadow:
    calc(var(--glitch) * -1) 0 rgba(122, 193, 66, 0.75),
    var(--glitch) 0 rgba(40, 200, 220, 0.75);
}

@media (min-width: 768px) {
  .mission-tagline {
    top: 28px;
    left: 56px;
  }
}

/* About stats (services / stats block) */
.about-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.about-grid h3 {
  color: var(--title);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.services-list li {
  position: relative;
  padding-left: 22px;
  color: var(--title);
  font-size: 0.95rem;
}

.services-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-number {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--accent-green);
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Back to top */
.back-to-top-container {
  text-align: center;
  margin: 3rem 0 1rem;
}

.btn-back-top {
  background: var(--accent-green);
  color: #000;
  padding: 0.85rem 2rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(122, 193, 66, 0.2);
  transition: all 0.3s ease;
}

.btn-back-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(122, 193, 66, 0.4);
}

/* Footer */
.site-footer {
  padding: 4rem 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  scroll-margin-top: var(--nav-height);
}

.site-footer h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.55;
  margin: 0 0 10px;
}

.footer-row {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1300px;
  margin: 0 auto;
}

.footer-block a {
  display: block;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 40px auto 0;
  padding: 20px 1.5rem;
  max-width: 1300px;
  background: #fff;
  color: rgba(10, 10, 10, 0.6);
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .footer-row {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 900px) {
  .site-footer {
    padding: 5rem 56px 0;
  }

  .footer-bottom {
    margin-left: -56px;
    margin-right: -56px;
    padding: 20px 56px;
    max-width: none;
  }
}
