/* ═══════════════════════════════════════════
   MOMENTIC — Single-Page Minimalist
   60:30:10 Color Rule with Alpha Channels
   Lenis Smooth Scrolling
   ═══════════════════════════════════════════ */

:root {
  /* 60% — Deep Blacks */
  --bg:          #080808;
  --bg-a90:      rgba(8, 8, 8, 0.92);
  --bg-a60:      rgba(8, 8, 8, 0.6);
  --surface:     #121212;
  --surface-a80: rgba(18, 18, 18, 0.8);
  --surface-a50: rgba(18, 18, 18, 0.5);

  /* 30% — Earthy */
  --earth:       #5D4037;
  --earth-mid:   #8D6E63;
  --earth-light: #BCAAA4;
  --earth-a40:   rgba(93, 64, 55, 0.4);
  --earth-a20:   rgba(141, 110, 99, 0.2);

  /* 10% — Accent */
  --accent:      #FFA726;
  --accent-dim:  rgba(255, 167, 38, 0.6);
  --accent-glow: rgba(255, 167, 38, 0.15);

  /* Neutral */
  --white:       #FFFFFF;
  --white-a70:   rgba(255,255,255,0.7);
  --white-a20:   rgba(255,255,255,0.2);
  --white-a10:   rgba(255,255,255,0.1);
  --white-a05:   rgba(255,255,255,0.05);
  --muted:       #888;

  /* Motion */
  --ease:  cubic-bezier(0.19, 1, 0.22, 1);
  --speed: 0.5s;
}

/* ═══ LENIS RECOMMENDED CSS ═══ */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

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

body {
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 167, 38, 0.03) 0%, transparent 70%),
                    radial-gradient(circle at 100% 100%, rgba(93, 64, 55, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 900; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }

/* ═══ PRELOADER ═══ */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; justify-content: center; align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader { display: block; width: 120px; height: auto; color: var(--accent); }

.loader_body, .loader_front, .loader_handlebars,
.loader_pedals, .loader_pedals-spin, .loader_seat,
.loader_spokes, .loader_spokes-spin, .loader_tire {
  animation: bikeBody 3s ease-in-out infinite;
  stroke: var(--accent);
}
.loader_front       { animation-name: bikeFront; }
.loader_handlebars  { animation-name: bikeHandlebars; }
.loader_pedals      { animation-name: bikePedals; }
.loader_pedals-spin { animation-name: bikePedalsSpin; }
.loader_seat        { animation-name: bikeSeat; }
.loader_spokes, .loader_tire { stroke: currentColor; }
.loader_spokes      { animation-name: bikeSpokes; }
.loader_spokes-spin { animation-name: bikeSpokesSpin; }
.loader_tire        { animation-name: bikeTire; }

@keyframes bikeBody       { from{stroke-dashoffset:79}  33%,67%{stroke-dashoffset:0} to{stroke-dashoffset:-79} }
@keyframes bikeFront      { from{stroke-dashoffset:19}  33%,67%{stroke-dashoffset:0} to{stroke-dashoffset:-19} }
@keyframes bikeHandlebars { from{stroke-dashoffset:10}  33%,67%{stroke-dashoffset:0} to{stroke-dashoffset:-10} }
@keyframes bikeSeat       { from{stroke-dashoffset:5}   33%,67%{stroke-dashoffset:0} to{stroke-dashoffset:-5} }
@keyframes bikePedals     { from{stroke-dashoffset:-25.133;animation-timing-function:ease-in} 33%,67%{stroke-dashoffset:-21.991;animation-timing-function:ease-out} to{stroke-dashoffset:-25.133} }
@keyframes bikePedalsSpin { from{transform:rotate(.1875turn)} to{transform:rotate(3.1875turn)} }
@keyframes bikeSpokes     { from{stroke-dashoffset:-31.416;animation-timing-function:ease-in} 33%,67%{stroke-dashoffset:-23.562;animation-timing-function:ease-out} to{stroke-dashoffset:-31.416} }
@keyframes bikeSpokesSpin { from{transform:rotate(0)} to{transform:rotate(3turn)} }
@keyframes bikeTire       { from{stroke-dashoffset:56.549;transform:rotate(0);animation-timing-function:ease-in} 33%{stroke-dashoffset:0;transform:rotate(.33turn)} 67%{stroke-dashoffset:0;transform:rotate(.67turn);animation-timing-function:ease-out} to{stroke-dashoffset:-56.549;transform:rotate(1turn)} }

/* ═══ THREE.JS CANVAS ═══ */
#three-canvas {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
}

/* ═══ HEADER & NAV ═══ */
#main-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100; height: 80px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 5%;
  background: transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
}
#main-header.scrolled {
  background: var(--bg-a90);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--white-a05);
}
.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900; font-size: 1.2rem;
  letter-spacing: 6px; color: var(--accent);
}
.top-nav {
  display: flex; gap: 30px;
}
.top-nav a {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--white); opacity: 0.6; transition: all var(--speed) var(--ease);
  position: relative;
}
.top-nav a:hover, .top-nav a.active {
  opacity: 1; color: var(--accent);
}
.top-nav a::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; background: var(--accent); transition: width var(--speed) var(--ease);
}
.top-nav a.active::after { width: 100%; }

/* ═══ LAYOUT BLOCKS ═══ */
.full-bleed-section {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 100px 5%;
  overflow: hidden;
}
.content-section {
  padding: 120px 5%;
  min-height: 100vh;
  display: flex; align-items: center;
}
.content-wrapper {
  position: relative; z-index: 2;
  width: 100%; max-width: 1400px; margin: 0 auto;
}

/* ═══ BACKGROUND IMAGES & TINTS ═══ */
.bg-image {
  position: absolute; inset: -10%; z-index: 0;
  background-size: cover; background-position: center;
  filter: grayscale(20%); /* cinematic tone */
}
.bg-tint {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, rgba(8,8,8,0.95) 0%, rgba(8,8,8,0.6) 100%);
}
.heavy-tint {
  background: linear-gradient(135deg, rgba(8,8,8,0.95) 0%, rgba(8,8,8,0.85) 100%);
}

/* ═══ SCROLL REVEAL ═══ */
.reveal { opacity: 0; transform: translateY(50px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══ BUTTON ═══ */
.btn {
  display: inline-block;
  padding: 16px 40px;
  border: 1px solid var(--white-a20);
  background: var(--surface-a50);
  backdrop-filter: blur(10px);
  color: var(--white);
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  border-radius: 50px;
  position: relative; overflow: hidden;
  transition: all var(--speed) var(--ease);
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  transform: scale(0); transition: transform 0.6s ease;
}
.btn:hover::after { transform: scale(4); }
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 40px var(--accent-glow); }

/* ═══ HERO ═══ */
.hero-content h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: 1.1; margin-bottom: 24px; text-transform: uppercase; letter-spacing: -1px; }
.hero-content h1 span { color: var(--accent); }
.hero-content p { font-size: 1.2rem; color: var(--white-a70); max-width: 600px; font-weight: 300; }

/* ═══ PORTFOLIO ═══ */
.section-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 60px; text-transform: uppercase; }
.section-title span { color: var(--accent); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px; /* Tighter packing */
  padding: 20px 0;
}

@keyframes slowFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.portfolio-card {
  position: relative; 
  aspect-ratio: 4/5; 
  overflow: hidden;
  background: var(--surface); 
  border-radius: 4px;
  animation: slowFloat 8s ease-in-out infinite;
  /* Stagger animation delays based on nth-child via inline or approx */
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

.portfolio-card:nth-child(2n) { animation-delay: -2s; aspect-ratio: 1/1; }
.portfolio-card:nth-child(3n) { animation-delay: -4s; aspect-ratio: 16/9; grid-column: span 2; }
.portfolio-card:nth-child(5n) { animation-delay: -6s; }

.portfolio-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  filter: brightness(0.8) contrast(1.1);
}

.portfolio-card:hover {
  z-index: 10;
  transform: scale(1.15) !important;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8), 0 0 40px var(--accent-glow);
  animation-play-state: paused; /* Stop floating on hover */
  border: 1px solid var(--white-a10);
}

.portfolio-card:hover img { 
  transform: scale(1.05); 
  filter: brightness(1.1) contrast(1.1);
}

.portfolio-card .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,8,8,0.95) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 30px;
  opacity: 0; transition: opacity var(--speed) var(--ease);
}
.portfolio-card:hover .overlay { opacity: 1; }
.portfolio-card .overlay h3 { 
  font-size: 1.5rem; 
  transform: translateY(15px); 
  transition: transform var(--speed) var(--ease); 
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.portfolio-card:hover .overlay h3 { transform: translateY(0); }

/* ═══ ABOUT ═══ */
.about-content h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 20px; text-transform: uppercase; }
.about-content h2 span { color: var(--accent); }
.about-content h3 { font-size: 2rem; color: var(--earth-mid); margin-bottom: 30px; font-style: italic; }
.about-content p { color: var(--white-a70); font-size: 1.2rem; max-width: 600px; font-weight: 300; }

/* ═══ SERVICES MINIMALIST ═══ */
.services-minimalist-flex {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0;
  border-bottom: 1px solid var(--white-a10);
  transition: all var(--speed) var(--ease);
  position: relative;
}

.service-row:first-child {
  border-top: 1px solid var(--white-a10);
}

.service-row::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 0%; height: 1px; background: var(--accent);
  transition: width 0.6s var(--ease);
}

.service-row:hover::after { width: 100%; }
.service-row:hover { background: linear-gradient(90deg, var(--white-a05) 0%, transparent 100%); }

.service-left { flex: 1; display: flex; align-items: baseline; gap: 20px; }
.service-num { font-size: 1rem; color: var(--accent); font-weight: 900; }
.service-left h3 { font-size: 2rem; font-family: 'Inter', sans-serif; font-weight: 300; margin: 0; letter-spacing: -1px; }

.service-mid { flex: 1.5; padding: 0 40px; }
.service-mid p { font-size: 1.1rem; color: var(--white-a70); margin: 0; font-weight: 300; }

.service-right { flex: 0.8; display: flex; align-items: center; justify-content: flex-end; gap: 40px; }
.service-right .price { font-size: 1.5rem; font-weight: 500; }

.link-arrow {
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  transition: color var(--speed) var(--ease);
  position: relative;
}
.link-arrow:hover { color: var(--accent); }

/* ═══ CONTACT ═══ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.contact-info h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 20px; text-transform: uppercase; }
.contact-info h2 span { color: var(--accent); }
.contact-info p { color: var(--white-a70); margin-bottom: 40px; font-size: 1.2rem; max-width: 500px; }

.contact-detail { display: flex; flex-direction: column; gap: 20px; font-size: 1.1rem; }
.contact-detail span { display: block; }
.contact-detail .icon-label { color: var(--accent); font-weight: 700; margin-right: 15px; font-style: normal; text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.contact-form input, .contact-form textarea {
  width: 100%; background: var(--white-a05); border: 1px solid var(--white-a10); padding: 20px 24px;
  color: var(--white); font-family: inherit; font-size: 1rem; border-radius: 4px; transition: border-color var(--speed) var(--ease); outline: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); background: var(--white-a10); }
.contact-form textarea { resize: vertical; min-height: 150px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-card:nth-child(n) { grid-column: span 1; aspect-ratio: 4/5; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .top-nav { display: none; }
  
  .service-row { flex-direction: column; align-items: flex-start; gap: 20px; }
  .service-left, .service-mid, .service-right { flex: auto; padding: 0; width: 100%; justify-content: flex-start; }
  .service-right { justify-content: space-between; }
}
