/* ============================================
   Sippar Architects - Custom Styles
   ============================================ */

/* --- Base & Reset --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

::selection {
  background-color: rgba(196, 168, 114, 0.3);
  color: #1a1a2e;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f0f1a;
}
::-webkit-scrollbar-thumb {
  background: rgba(196, 168, 114, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 168, 114, 0.6);
}

/* --- Typography --- */
.font-serif {
  font-family: 'Cormorant Garamond', serif;
}

/* --- Gold Gradient Text --- */
.text-gradient {
  background: linear-gradient(135deg, #c4a872, #d4b896, #c4a872);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Link Underline Animation --- */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #c4a872;
  transition: width 0.5s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* --- Ken Burns Effect --- */
.ken-burns {
  animation: kenBurns 20s ease-in-out infinite alternate;
}
@keyframes kenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-2%, -1%); }
}

/* --- Noise Texture Overlay --- */
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}
.noise > * {
  position: relative;
  z-index: 2;
}

/* --- Architectural Blueprint Pattern Overlay --- */
.blueprint::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    /* Main grid */
    linear-gradient(rgba(196, 168, 114, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 168, 114, 0.4) 1px, transparent 1px),
    /* Sub-grid */
    linear-gradient(rgba(196, 168, 114, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 168, 114, 0.2) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
  pointer-events: none;
  z-index: 1;
}
.blueprint > * {
  position: relative;
  z-index: 2;
}

/* --- Gold Glow Effects --- */
.glow-gold-sm {
  box-shadow: 0 0 15px rgba(196, 168, 114, 0.15);
}
.glow-gold {
  box-shadow: 0 0 30px rgba(196, 168, 114, 0.2);
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Slide Up Animation --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up {
  animation: slideUp 0.8s ease forwards;
}

/* --- Fade Up Animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fadeUp 0.8s ease forwards;
}

/* --- Line Grow Animation --- */
@keyframes lineGrow {
  from { width: 0; }
  to { width: 3rem; }
}
.animate-line-grow {
  animation: lineGrow 1s ease forwards;
}

/* --- Hero Slide Transitions --- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}
.hero-slide.active img {
  animation: kenBurns 20s ease-in-out infinite alternate;
}

/* --- Header States --- */
.header-scrolled {
  background-color: rgba(15, 15, 26, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* --- Mobile Menu --- */
.mobile-menu {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.5s, opacity 0.5s;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
}
.mobile-menu .menu-panel {
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open .menu-panel {
  transform: translateX(0);
}

/* --- Floating Label for Forms --- */
.float-label {
  position: relative;
}
.float-label label {
  position: absolute;
  left: 0;
  top: 0.75rem;
  color: #6b7280;
  transition: all 0.3s ease;
  pointer-events: none;
  font-size: 0.875rem;
}
.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label,
.float-label textarea:focus ~ label,
.float-label textarea:not(:placeholder-shown) ~ label {
  top: -0.75rem;
  font-size: 0.7rem;
  color: #c4a872;
}

/* --- Project Card Hover Bar --- */
.project-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #c4a872, #d4b896);
  transition: width 0.7s ease;
}
.group:hover .project-bar {
  width: 100%;
}

/* --- Service Card Bottom Line --- */
.service-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #c4a872, #d4b896);
  transition: width 0.7s ease;
}
.group:hover .service-line {
  width: 100%;
}

/* --- Hamburger Animation --- */
.hamburger-line {
  transition: all 0.3s ease;
}
.hamburger-active .hamburger-line:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-active .hamburger-line:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Staggered Animation Delays --- */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }
.stagger-6 { animation-delay: 600ms; }

/* --- Hide Scrollbar (for horizontal tab scroll) --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Process Section Animations --- */

/* Progress bar segments animate in sequentially */
.process-bar {
  width: 0;
  animation: barGrow 0.8s ease forwards;
}
.process-bar.bar-1 { animation-delay: 0.6s; }
.process-bar.bar-2 { animation-delay: 0.9s; }
.process-bar.bar-3 { animation-delay: 1.2s; }
.process-bar.bar-4 { animation-delay: 1.5s; }

@keyframes barGrow {
  to { width: 2.5rem; }
}

/* Headline words slide up */
.process-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: wordSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.process-word.w1 { animation-delay: 0.1s; }
.process-word.w2 { animation-delay: 0.25s; }
.process-word.w3 { animation-delay: 0.4s; }

@keyframes wordSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Description text fades in */
.process-desc {
  opacity: 0;
  transform: translateY(20px);
  animation: descFade 0.8s ease forwards;
  animation-delay: 0.6s;
}
@keyframes descFade {
  to { opacity: 1; transform: translateY(0); }
}

/* Subtitle label slides in from left */
.process-label {
  opacity: 0;
  transform: translateX(-20px);
  animation: labelSlide 0.6s ease forwards;
  animation-delay: 0.05s;
}
@keyframes labelSlide {
  to { opacity: 1; transform: translateX(0); }
}

/* Phases text counter */
.process-phases {
  opacity: 0;
  animation: phasesFade 0.5s ease forwards;
  animation-delay: 1.8s;
}
@keyframes phasesFade {
  to { opacity: 1; }
}

/* Ghost number floats up slowly */
.process-ghost {
  opacity: 0;
  transform: translateY(30px);
  animation: ghostFloat 1.5s ease forwards;
  animation-delay: 0.8s;
}
@keyframes ghostFloat {
  to { opacity: 1; transform: translateY(0); }
}

/* Floating stat card slides in */
.process-stat-card {
  opacity: 0;
  transform: translateY(30px) translateX(-20px);
  animation: statCardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1s;
}
@keyframes statCardIn {
  to { opacity: 1; transform: translateY(0) translateX(0); }
}

/* Counter number animates */
.process-counter {
  opacity: 0;
  animation: counterPop 0.5s ease forwards;
  animation-delay: 1.4s;
}
@keyframes counterPop {
  0% { opacity: 0; transform: scale(0.5); }
  70% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* Pause animations until section is in viewport */
.process-animate-on-scroll .process-word,
.process-animate-on-scroll .process-desc,
.process-animate-on-scroll .process-label,
.process-animate-on-scroll .process-bar,
.process-animate-on-scroll .process-phases,
.process-animate-on-scroll .process-ghost,
.process-animate-on-scroll .process-stat-card,
.process-animate-on-scroll .process-counter {
  animation-play-state: paused;
}
.process-animate-on-scroll.is-visible .process-word,
.process-animate-on-scroll.is-visible .process-desc,
.process-animate-on-scroll.is-visible .process-label,
.process-animate-on-scroll.is-visible .process-bar,
.process-animate-on-scroll.is-visible .process-phases,
.process-animate-on-scroll.is-visible .process-ghost,
.process-animate-on-scroll.is-visible .process-stat-card,
.process-animate-on-scroll.is-visible .process-counter {
  animation-play-state: running;
}

/* --- Page Transition --- */
.page-enter {
  animation: pageEnter 0.6s ease forwards;
}
@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
