/* XL Media - Monochrome Award-Worthy Design */

/* ============================================
   Design Tokens
   ============================================ */
:root {
  /* Fluid calculations */
  --fluid-screen: 100vw;
  --fluid-bp: calc((var(--fluid-screen) - 20rem) / 2240);
  
  /* Typography Scale */
  --step--2: calc(0.75rem + 0.2 * var(--fluid-bp));
  --step--1: calc(0.875rem + 1 * var(--fluid-bp));
  --step-0: calc(1rem + 4 * var(--fluid-bp));
  --step-1: calc(1.125rem + 8 * var(--fluid-bp));
  --step-2: calc(1.25rem + 14 * var(--fluid-bp));
  --step-3: calc(1.5rem + 22 * var(--fluid-bp));
  --step-4: calc(1.75rem + 32 * var(--fluid-bp));
  --step-5: calc(2rem + 48 * var(--fluid-bp));
  --step-6: calc(2.5rem + 70 * var(--fluid-bp));
  --step-7: calc(3rem + 100 * var(--fluid-bp));
  --step-8: calc(3.5rem + 140 * var(--fluid-bp));
  
  /* Spacing Scale */
  --space-3xs: calc(0.25rem + 1 * var(--fluid-bp));
  --space-2xs: calc(0.5rem + 2 * var(--fluid-bp));
  --space-xs: calc(0.75rem + 3 * var(--fluid-bp));
  --space-s: calc(1rem + 4 * var(--fluid-bp));
  --space-m: calc(1.5rem + 6 * var(--fluid-bp));
  --space-l: calc(2rem + 10 * var(--fluid-bp));
  --space-xl: calc(3rem + 15 * var(--fluid-bp));
  --space-2xl: calc(4rem + 20 * var(--fluid-bp));
  --space-3xl: calc(6rem + 30 * var(--fluid-bp));
  --space-4xl: calc(8rem + 40 * var(--fluid-bp));
  
  /* Monochrome Palette */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray-light: #f5f5f5;
  --color-gray: #888888;
  --color-gray-dark: #333333;
  
  /* Line styling */
  --line-weight: 1px;
  --line-color: currentColor;
  --line-opacity: 0.15;
  
  /* Layout */
  --container-padding: clamp(1.5rem, 4vw, 4rem);
  --gutter: clamp(1rem, 3vw, 3rem);
  
  /* Animation */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-medium: 0.5s;
  --duration-slow: 0.8s;
  --duration-slower: 1.2s;
  
  /* Section spacing - generous for premium feel */
  --section-spacing: var(--space-4xl);
  --section-spacing-large: calc(var(--space-4xl) * 1.5);
}

@media (min-width: 1024px) {
  :root {
    --section-spacing: var(--section-spacing-large);
  }
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--color-black);
  background-color: var(--color-white);
}

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

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

ul, ol {
  list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.t-display {
  font-size: var(--step-8);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.t-heading-1 {
  font-size: var(--step-6);
}

.t-heading-2 {
  font-size: var(--step-5);
}

.t-heading-3 {
  font-size: var(--step-4);
}

.t-body-large {
  font-size: var(--step-2);
  line-height: 1.5;
}

.t-label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================
   Layout
   ============================================ */
.o-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.o-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.o-section {
  position: relative;
  padding: var(--section-spacing) 0;
}

.o-section--dark {
  color: var(--color-white);
  background-color: var(--color-black);
}

.o-section--dark .o-line {
  background-color: var(--color-white);
}

/* ============================================
   Decorative Lines
   ============================================ */
.o-line {
  position: absolute;
  background-color: var(--color-black);
  opacity: var(--line-opacity);
  pointer-events: none;
}

.o-line--horizontal {
  height: var(--line-weight);
  left: 0;
  right: 0;
}

.o-line--vertical {
  width: var(--line-weight);
  top: 0;
  bottom: 0;
}

.o-line--top { top: 0; }
.o-line--bottom { bottom: 0; }
.o-line--left { left: var(--container-padding); }
.o-line--right { right: var(--container-padding); }
.o-line--center { left: 50%; transform: translateX(-50%); }

/* Lines over images */
.o-media-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.o-media-lines::before,
.o-media-lines::after {
  content: '';
  position: absolute;
  background-color: var(--color-white);
  opacity: 0.1;
}

.o-media-lines::before {
  width: var(--line-weight);
  top: 10%;
  bottom: 10%;
  left: 33.333%;
}

.o-media-lines::after {
  width: var(--line-weight);
  top: 10%;
  bottom: 10%;
  left: 66.666%;
}

/* ============================================
   Buttons with Micro-interactions
   ============================================ */
.o-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-s) var(--space-l);
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white);
  background-color: var(--color-black);
  border: var(--line-weight) solid var(--color-black);
  cursor: pointer;
  transition: 
    transform var(--duration-medium) var(--ease-out-expo),
    padding var(--duration-medium) var(--ease-in-out),
    background-color var(--duration-fast) ease;
}

.o-button:hover {
  padding: var(--space-s) calc(var(--space-l) + var(--space-xs));
  transform: scale(1.02);
}

.o-button:active {
  transform: scale(0.98);
}

.o-button--outline {
  color: var(--color-black);
  background-color: transparent;
}

.o-button--outline:hover {
  color: var(--color-white);
  background-color: var(--color-black);
}

.o-button--white {
  color: var(--color-black);
  background-color: var(--color-white);
  border-color: var(--color-white);
}

.o-button--white:hover {
  background-color: var(--color-gray-light);
}

.o-button .o-icon {
  width: 1em;
  height: 1em;
  transition: transform var(--duration-medium) var(--ease-out-expo);
}

.o-button:hover .o-icon {
  transform: translateX(4px);
}

/* ============================================
   Media with Parallax
   ============================================ */
.o-media {
  position: relative;
  overflow: hidden;
  background-color: var(--color-gray-light);
}

.o-media__wrapper {
  position: absolute;
  inset: -15%;
  will-change: transform;
}

.o-media__image,
.o-media__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Parallax container */
.o-parallax {
  position: relative;
  overflow: hidden;
}

.o-parallax__bg {
  position: absolute;
  inset: -20%;
  will-change: transform;
}

.o-parallax__bg img,
.o-parallax__bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.o-parallax__content {
  position: relative;
  z-index: 2;
}

/* ============================================
   Reveal Animations
   ============================================ */
.o-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: 
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slower) var(--ease-out-expo);
  transition-delay: calc(var(--index, 0) * 0.1s);
}

.o-reveal.is-visible,
.is-inview .o-reveal {
  opacity: 1;
  transform: translateY(0);
}

.o-reveal--fade {
  transform: none;
}

.o-reveal--slide-left {
  transform: translateX(-40px);
}

.o-reveal--slide-right {
  transform: translateX(40px);
}

.is-inview .o-reveal--slide-left,
.is-inview .o-reveal--slide-right {
  transform: translateX(0);
}

/* Line reveal animation */
.o-line-reveal {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slower) var(--ease-out-expo);
  transition-delay: calc(var(--index, 0) * 0.15s);
}

.o-line-reveal--vertical {
  transform: scaleY(0);
  transform-origin: top;
}

.is-inview .o-line-reveal {
  transform: scaleX(1);
}

.is-inview .o-line-reveal--vertical {
  transform: scaleY(1);
}

/* Text reveal line by line */
.o-text-reveal .line-wrapper {
  overflow: hidden;
  display: block;
}

.o-text-reveal .line {
  display: block;
  transform: translateY(100%);
  transition: transform var(--duration-slower) var(--ease-out-expo);
  transition-delay: calc(var(--line-index, 0) * 0.08s);
}

.is-inview .o-text-reveal .line {
  transform: translateY(0);
}

/* ============================================
   Header
   ============================================ */
.c-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-m) 0;
  mix-blend-mode: difference;
}

.c-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.c-header__logo {
  height: clamp(24px, 3vw, 36px);
  /* Logo is already white - no invert needed */
}

@media (max-width: 768px) {
  .c-header__logo {
    height: 72px;
  }
}

.c-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

.c-header__link {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white);
  position: relative;
}

.c-header__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-medium) var(--ease-out-expo);
}

.c-header__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (max-width: 768px) {
  .c-header__nav {
    display: none;
  }
}

/* ============================================
   Hero Section
   ============================================ */
.c-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: var(--color-white);
  overflow: hidden;
}

.c-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.c-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, 
    rgba(0,0,0,0.2) 0%, 
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0.6) 100%
  );
  z-index: 1;
}

.c-hero__bg video,
.c-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-3xl) 0;
}

.c-hero__title {
  max-width: 14ch;
  margin-bottom: var(--space-l);
}

.c-hero__subtitle {
  max-width: 45ch;
  opacity: 0.8;
  font-size: var(--step-1);
}

.c-hero__cta {
  margin-top: var(--space-xl);
}

/* Scroll Indicator */
.c-hero__scroll {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 1.5s forwards;
}

.c-hero__scroll-text {
  font-size: var(--step--2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

.c-hero__scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--color-white) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.c-hero__scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--color-white);
  animation: scrollPulse 2s var(--ease-in-out) infinite;
}

@keyframes scrollPulse {
  0% { transform: translateY(-100%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(300%); opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Decorative lines on hero */
.c-hero .o-line {
  background-color: var(--color-white);
  opacity: 0.1;
}

/* ============================================
   Intro Section
   ============================================ */
.c-intro {
  position: relative;
}

.c-intro__text {
  grid-column: 2 / 12;
  font-size: var(--step-4);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .c-intro__text {
    grid-column: 3 / 11;
  }
}

.c-intro__indent {
  display: inline-block;
  width: 3ch;
}

/* ============================================
   Projects Grid
   ============================================ */
.c-projects {
  position: relative;
}

.c-projects__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.c-projects__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.c-project {
  position: relative;
}

.c-project:nth-child(1) { grid-column: 1 / 5; }
.c-project:nth-child(2) { grid-column: 5 / 9; margin-top: var(--space-4xl); }
.c-project:nth-child(3) { grid-column: 9 / 13; margin-top: calc(var(--space-4xl) * 1.8); }

@media (max-width: 768px) {
  .c-project:nth-child(n) {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  
  .c-project + .c-project {
    margin-top: var(--space-xl);
  }
}

.c-project__media {
  position: relative;
  aspect-ratio: 3/4;
  margin-bottom: var(--space-m);
  overflow: hidden;
}

.c-project__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-out-expo);
}

.c-project:hover .c-project__image {
  transform: scale(1.05);
}

.c-project__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2xs);
  font-size: var(--step--1);
  opacity: 0.5;
}

.c-project__title {
  font-size: var(--step-2);
  font-weight: 500;
}

/* ============================================
   Full-width Image Section
   ============================================ */
.c-fullwidth {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  overflow: hidden;
}

.c-fullwidth__bg {
  position: absolute;
  inset: 0;
}

.c-fullwidth__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

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

.c-fullwidth__content {
  position: relative;
  z-index: 2;
}

.c-fullwidth__title {
  max-width: 20ch;
  margin-bottom: var(--space-l);
}

.c-fullwidth__text {
  max-width: 50ch;
  opacity: 0.85;
}

.c-fullwidth .o-line {
  background-color: var(--color-white);
}

/* ============================================
   Services Section
   ============================================ */
.c-services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

@media (max-width: 768px) {
  .c-services__grid {
    grid-template-columns: 1fr;
  }
}

.c-service {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  color: var(--color-white);
}

.c-service__bg {
  position: absolute;
  inset: 0;
  transition: transform var(--duration-slower) var(--ease-out-expo);
}

.c-service__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 100%);
}

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

.c-service:hover .c-service__bg {
  transform: scale(1.05);
}

.c-service__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: var(--space-l);
}

.c-service__title {
  font-size: var(--step-3);
  margin-bottom: var(--space-xs);
}

.c-service__desc {
  font-size: var(--step--1);
  opacity: 0.8;
  max-width: 30ch;
}

/* ============================================
   CTA Section
   ============================================ */
.c-cta {
  text-align: center;
}

.c-cta__title {
  max-width: 18ch;
  margin: 0 auto var(--space-xl);
}

/* ============================================
   Footer
   ============================================ */
.c-footer {
  position: relative;
  padding: var(--space-4xl) 0 var(--space-xl);
}

.c-footer__inner {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.c-footer__brand {
  grid-column: 1 / 5;
}

.c-footer__logo {
  height: 32px;
  /* Logo is already white - no invert needed */
  margin-bottom: var(--space-m);
}

.c-footer__tagline {
  font-size: var(--step--1);
  opacity: 0.7;
  max-width: 30ch;
}

.c-footer__nav {
  grid-column: 5 / 13;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

@media (max-width: 768px) {
  .c-footer__brand,
  .c-footer__nav {
    grid-column: 1 / -1;
  }
  
  .c-footer__nav {
    margin-top: var(--space-xl);
  }
}

.c-footer__nav-title {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
  margin-bottom: var(--space-m);
}

.c-footer__nav-list a {
  display: block;
  padding: var(--space-2xs) 0;
  font-size: var(--step--1);
  transition: opacity var(--duration-fast);
}

.c-footer__nav-list a:hover {
  opacity: 0.6;
}

.c-footer__bottom {
  margin-top: var(--space-3xl);
  padding-top: var(--space-m);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: var(--step--2);
  opacity: 0.5;
}

.c-footer__legal a {
  margin-left: var(--space-m);
}

/* ============================================
   Page Hero (Inner Pages)
   ============================================ */
.c-page-hero {
  padding: calc(var(--space-4xl) + 80px) 0 var(--space-3xl);
}

/* ============================================
   Gallery (Inspiration)
   ============================================ */
.c-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

@media (max-width: 768px) {
  .c-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .c-gallery {
    grid-template-columns: 1fr;
  }
}

.c-gallery__item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.c-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-out-expo);
}

.c-gallery__item:hover img {
  transform: scale(1.05);
}

/* ============================================
   Contact Info
   ============================================ */
.c-contact-info {
  margin-top: var(--space-xl);
}

.c-contact-info__item {
  margin-bottom: var(--space-m);
}

.c-contact-info__label {
  display: block;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: var(--space-2xs);
}

.c-contact-info__value {
  font-size: var(--step-2);
  display: block;
}

a.c-contact-info__value:hover {
  opacity: 0.7;
}

/* ============================================
   Social Links
   ============================================ */
.c-social-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.c-social-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-m) 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: padding-left var(--duration-medium) var(--ease-out-expo);
}

.c-social-link:hover {
  padding-left: var(--space-s);
}

.c-social-link__name {
  font-size: var(--step-3);
  font-weight: 500;
}

.c-social-link .o-icon {
  width: 1.5em;
  height: 1.5em;
  transition: transform var(--duration-medium) var(--ease-out-expo);
}

.c-social-link:hover .o-icon {
  transform: translateX(8px);
}

/* ============================================
   Utilities
   ============================================ */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.u-text-center { text-align: center; }

/* Icons */
.o-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  vertical-align: middle;
}

/* ============================================
   Page Loading Animation
   ============================================ */
html:not(.is-loaded) body {
  overflow: hidden;
}

.c-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-black);
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
}

.is-loaded .c-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.c-loader__logo {
  height: 40px;
  filter: invert(1);
  animation: loaderPulse 1.5s var(--ease-in-out) infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

/* ============================================
   Enhanced Hover States
   ============================================ */
.c-project__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-out-expo);
  z-index: 1;
}

.c-project:hover .c-project__media::after {
  opacity: 1;
}

.c-project__title {
  transition: transform var(--duration-medium) var(--ease-out-expo);
}

.c-project:hover .c-project__title {
  transform: translateX(8px);
}

/* ============================================
   Smooth Scroll
   ============================================ */
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}
