/* ==========================================================================
   CIPTACODING DESIGN SYSTEM - MASTER CSS TOKENS
   Master reference: index.html
   ========================================================================== */

:root {
  /* Brand Colors */
  --color-primary: #0062ff;
  --color-primary-hover: #0051d4;
  --color-primary-light: #edf4ff;
  --color-primary-subtle: #f3f7fd;
  
  --color-navy: #08143a;
  --color-navy-dark: #0a1744;
  --color-navy-card: #0c1c4f;
  
  --color-background: #f8faff;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f5fb;
  --color-surface-muted: #e8eef8;
  
  --color-border: #d2dced;
  --color-border-subtle: rgba(210, 220, 237, 0.7);
  
  --color-text-main: #08143a;
  --color-text-muted: #495874;
  --color-text-light: #94a3b8;
  
  --color-success: #10b981;
  --color-success-light: #ecfdf5;
  --color-success-text: #047857;
  
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Typography */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(8, 20, 58, 0.05);
  --shadow-sm: 0 2px 8px rgba(8, 20, 58, 0.04);
  --shadow-md: 0 6px 18px rgba(8, 20, 58, 0.07);
  --shadow-lg: 0 12px 28px rgba(0, 98, 255, 0.1);
  --shadow-xl: 0 20px 40px rgba(8, 20, 58, 0.12);
  --shadow-glow: 0 0 24px rgba(0, 98, 255, 0.25);

  /* Radius */
  --radius-sm: 0.375rem; /* 6px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-3xl: 1.5rem;  /* 24px */
  --radius-full: 9999px;

  /* Motion Timings */
  --motion-fast: 180ms;
  --motion-normal: 300ms;
  --motion-reveal: 600ms;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: page-enter 0.35s var(--ease-smooth) forwards;
}

/* Background Texture Utilities */
.bg-tech-grid {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(0, 98, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 98, 255, 0.04) 1px, transparent 1px);
}

.bg-tech-dots {
  background-size: 24px 24px;
  background-image: radial-gradient(circle, rgba(0, 98, 255, 0.07) 1.5px, transparent 1.5px);
}

/* Animations from index.html */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

@keyframes float-reverse {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(6px); }
}

@keyframes float-particle {
  0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.25; }
  50% { transform: translateY(-16px) rotate(10deg); opacity: 0.65; }
}

@keyframes float-particle-alt {
  0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-22px) rotate(-12deg); opacity: 0.7; }
}

@keyframes radar-ripple {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 98, 255, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(0, 98, 255, 0); }
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes subtle-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes subtle-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Animation Utility Classes */
.animate-float {
  animation: float 4.5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-reverse 5s ease-in-out 1.2s infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2.5s infinite;
}

.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 24s linear infinite;
}
.animate-marquee:hover {
  animation-play-state: paused;
}

/* ==========================================================================
   PREMIUM TECH STACK MARQUEE SYSTEM
   ========================================================================== */
.tech-marquee-wrapper {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.tech-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 0.875rem;
  padding: 0.35rem 0;
  will-change: transform;
  animation: tech-marquee-scroll 32s linear infinite;
}

.tech-marquee-wrapper:hover .tech-marquee-track {
  animation-play-state: paused;
}

@keyframes tech-marquee-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.tech-card-item {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(210, 220, 237, 0.85);
  border-radius: 0.875rem;
  box-shadow: 0 1px 3px rgba(8, 20, 58, 0.03);
  font-size: 0.75rem;
  font-weight: 600;
  color: #08143a;
  white-space: nowrap;
  cursor: default;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-card-item:hover {
  transform: translateY(-2px);
  border-color: #0062ff;
  box-shadow: 0 6px 18px rgba(0, 98, 255, 0.12), 0 1px 3px rgba(8, 20, 58, 0.04);
  background: #ffffff;
}

.tech-card-item .tech-logo {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-card-item:hover .tech-logo {
  transform: scale(1.15) translateY(-1px);
}

.tech-card-highlight {
  border-color: rgba(0, 98, 255, 0.4);
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  box-shadow: 0 2px 8px rgba(0, 98, 255, 0.08);
}

.tech-card-highlight::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #0062ff;
  opacity: 0.75;
  margin-left: -2px;
}

@media (prefers-reduced-motion: reduce) {
  .tech-marquee-track {
    animation: none;
  }
}

.animate-particle-1 {
  animation: float-particle 6s ease-in-out infinite;
}

.animate-particle-2 {
  animation: float-particle-alt 7.5s ease-in-out 1.5s infinite;
}

.animate-particle-3 {
  animation: float-particle 5s ease-in-out 2.5s infinite;
}

.animate-bounce-subtle {
  animation: bounce-subtle 3s ease-in-out infinite;
}

/* Radar Double Rings */
.radar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 2px solid #10b981;
  animation: radar-ripple 2.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.radar-ring-2 {
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 2px solid #10b981;
  animation: radar-ripple 2.2s cubic-bezier(0, 0.2, 0.8, 1) 0.8s infinite;
}

/* Cursor typing blink */
.cursor-blink {
  display: inline-block;
  width: 7px;
  height: 15px;
  background-color: #60a5fa;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.9s infinite;
}

/* Button Shimmer & Lift Micro-Interactions */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.btn-shimmer:hover::after {
  transform: rotate(30deg) translateX(100%);
}

.btn-hover-lift {
  transition: transform var(--motion-fast) var(--ease-smooth), box-shadow var(--motion-fast) ease;
}
.btn-hover-lift:hover {
  transform: translateY(-2px);
}
.btn-hover-lift:active {
  transform: translateY(0);
}

.icon-glide {
  transition: transform var(--motion-fast) var(--ease-smooth);
}
.group:hover .icon-glide {
  transform: translateX(4px);
}

.icon-wiggle:hover {
  animation: subtle-wiggle 0.35s ease-in-out;
}

.icon-pop:hover {
  animation: subtle-pop 0.25s var(--ease-smooth);
}

/* 3D tilt interactive card spotlight effect */
.tilt-card {
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s ease, border-color 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-card:hover {
  border-color: rgba(0, 98, 255, 0.5);
  box-shadow: 0 16px 32px -8px rgba(0, 98, 255, 0.12), 0 6px 12px -4px rgba(8, 20, 58, 0.05);
}

/* Scroll reveal helper */
.reveal-init {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--motion-reveal) var(--ease-smooth), transform var(--motion-reveal) var(--ease-smooth);
}

.reveal-show {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Delays for Cards */
.stagger-1 { transition-delay: 60ms !important; }
.stagger-2 { transition-delay: 120ms !important; }
.stagger-3 { transition-delay: 180ms !important; }
.stagger-4 { transition-delay: 240ms !important; }
.stagger-5 { transition-delay: 300ms !important; }
.stagger-6 { transition-delay: 360ms !important; }

/* Navbar on scroll transition */
header.navbar-scrolled {
  background-color: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 4px 20px -2px rgba(8, 20, 58, 0.07) !important;
  border-bottom-color: rgba(0, 98, 255, 0.15) !important;
}

/* Smooth Accordion CSS Grid helper */
.faq-accordion-grid {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease-smooth), opacity 0.25s ease;
  opacity: 0;
}
.faq-accordion-grid.open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.faq-accordion-overflow {
  overflow: hidden;
}

/* Filter Item Animations */
.filter-card-item {
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}
.filter-item-hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.96);
}

/* ==========================================================================
   DEVELOPMENT STUDIO MOCKUP & TIMELINE UTILITIES
   ========================================================================== */
.browser-mockup-frame {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(210, 220, 237, 0.8);
  box-shadow: 0 10px 30px -10px rgba(8, 20, 58, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
}

.browser-mockup-frame:hover {
  border-color: rgba(0, 98, 255, 0.5);
  box-shadow: 0 16px 36px -10px rgba(0, 98, 255, 0.16);
}

.browser-mockup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f8faff;
  border-bottom: 1px solid rgba(210, 220, 237, 0.7);
}

.browser-dots {
  display: flex;
  gap: 0.35rem;
}

.browser-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
}

.browser-url-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: #ffffff;
  border: 1px solid rgba(210, 220, 237, 0.6);
  border-radius: 0.375rem;
  font-family: var(--font-code);
  font-size: 0.625rem;
  color: #495874;
  max-width: 60%;
}

.terminal-mini-box {
  background: #08143a;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-code);
  font-size: 0.6875rem;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-mini-box:hover {
  border-color: rgba(0, 98, 255, 0.6);
  box-shadow: 0 8px 24px -6px rgba(0, 98, 255, 0.25);
}

.timeline-step-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #d2dced;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-step-card:hover {
  transform: translateY(-3px);
  border-color: #0062ff;
  box-shadow: 0 12px 28px -6px rgba(0, 98, 255, 0.12);
}

@keyframes timeline-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.timeline-connector-glow {
  animation: timeline-pulse 3s ease-in-out infinite;
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body {
    animation: none !important;
  }
  .animate-marquee, .animate-float, .animate-pulse-glow, .animate-particle-1, .animate-particle-2, .animate-particle-3, .tilt-card {
    animation: none !important;
    transform: none !important;
  }
}

/* ==========================================================================
   UNIVERSAL FLUID RESPONSIVE SYSTEM (360px -> 2560px+ MAXIMIZED)
   One Design, Flawless Scaling Across Every Viewport
   ========================================================================== */

/* 1. Global Viewport & Container Safety */
html {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}

/* 2. Fluid Container Width Scaling for Normal & Maximized Screens */
.max-w-7xl {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3.5vw, 2.5rem);
  padding-right: clamp(1rem, 3.5vw, 2.5rem);
}

/* 1024px to 1439px: Standard Laptop / Small Desktop */
@media (min-width: 1024px) and (max-width: 1439px) {
  .max-w-7xl {
    max-width: 1280px;
  }
  .max-w-4xl {
    max-width: 900px;
  }
  .max-w-3xl {
    max-width: 780px;
  }
}

/* 1440px to 1719px: Modern Expanded Desktop */
@media (min-width: 1440px) {
  .max-w-7xl {
    max-width: min(92vw, 1420px);
  }
  .max-w-4xl {
    max-width: min(85vw, 1020px);
  }
  .max-w-3xl {
    max-width: min(80vw, 880px);
  }
  .max-w-2xl {
    max-width: 48rem;
  }
  .max-w-xl {
    max-width: 42rem;
  }
}

/* 1720px to 2199px: Full HD 1080p Maximized & QHD Laptops */
@media (min-width: 1720px) {
  .max-w-7xl {
    max-width: min(90vw, 1620px);
    padding-left: clamp(2rem, 3.5vw, 3.5rem);
    padding-right: clamp(2rem, 3.5vw, 3.5rem);
  }
  .max-w-4xl {
    max-width: min(80vw, 1160px);
  }
  .max-w-3xl {
    max-width: min(75vw, 980px);
  }
  .max-w-2xl {
    max-width: 52rem;
  }
  .max-w-xl {
    max-width: 46rem;
  }
  
  /* Cards & Bento comfort on 1080p Maximized */
  .tilt-card {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  /* Counter number scaling */
  .counter-number {
    font-size: clamp(2rem, 1.8rem + 0.8vw, 3.25rem);
  }
}

/* 2200px+ (2K, QHD 2560px, 4K Ultrawide Maximized) */
@media (min-width: 2200px) {
  .max-w-7xl {
    max-width: min(86vw, 1860px);
    padding-left: clamp(2.5rem, 4vw, 4.5rem);
    padding-right: clamp(2.5rem, 4vw, 4.5rem);
  }
  .max-w-4xl {
    max-width: min(75vw, 1300px);
  }
  .max-w-3xl {
    max-width: min(70vw, 1100px);
  }
  .max-w-2xl {
    max-width: 58rem;
  }
  .max-w-xl {
    max-width: 50rem;
  }

  /* Enhanced readability on high-DPI large screens */
  p.leading-relaxed {
    font-size: 1.0625rem;
    line-height: 1.75;
  }
}

/* 3. Fluid Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: clamp(1.85rem, 7.5vw, 2.45rem) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.025em;
  }
  h2 {
    font-size: clamp(1.4rem, 5.8vw, 1.95rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -0.02em;
  }
}

@media (min-width: 1440px) {
  h1 {
    font-size: clamp(2.75rem, 2.2rem + 1.2vw, 3.85rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
  }
  h2 {
    font-size: clamp(2.15rem, 1.6rem + 1vw, 2.85rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
}

@media (min-width: 1920px) {
  h1 {
    font-size: clamp(3.25rem, 2.5rem + 1vw, 4.25rem);
    line-height: 1.14;
    letter-spacing: -0.035em;
  }
}

/* 4. Fluid Section Spacing */
@media (min-width: 1720px) {
  section.py-8 {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }
  section.py-10 {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  section.py-12 {
    padding-top: 4.25rem;
    padding-bottom: 4.25rem;
  }
  section.pt-8, section.pt-10 {
    padding-top: 3.25rem;
  }
  section.pb-12, section.pb-14 {
    padding-bottom: 4.5rem;
  }
}

/* 5. Minimum 44px Touch Targets for Interactive Controls */
@media (pointer: coarse), (max-width: 768px) {
  button:not(.text-xs),
  a.btn-hover-lift,
  .filter-tab-btn,
  .filter-btn,
  .category-btn,
  .faq-toggle,
  .faq-btn,
  #mobile-menu-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  #mobile-menu a {
    min-height: 46px;
    display: flex;
    align-items: center;
  }
}

/* 6. Touch-Friendly Filter Tabs & No-Scrollbar Utility */
.filter-tabs-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}
.filter-tabs-scroll::-webkit-scrollbar {
  display: none;
}

/* 7. Mobile Vertical Connecting Line for Roadmap (cara-order.html) */
@media (max-width: 639px) {
  #workflowSteps {
    position: relative;
  }
  #workflowSteps::before {
    content: '';
    position: absolute;
    top: 2.5rem;
    bottom: 2.5rem;
    left: 2.35rem;
    width: 2px;
    background: linear-gradient(to bottom, #0062ff, rgba(0, 98, 255, 0.2));
    z-index: 0;
  }
  #workflowSteps .step-card {
    position: relative;
    z-index: 1;
  }
}

/* 8. Portfolio Card Heights and Aspect Consistency */
.portfolio-item .relative.h-56 {
  aspect-ratio: 16 / 10;
  height: auto;
  min-height: 220px;
  max-height: 320px;
}

@media (min-width: 1720px) {
  .portfolio-item .relative.h-56 {
    min-height: 260px;
    max-height: 360px;
  }
}

