/* ==========================================================================
   KIGAN CONSULTING - DESIGN SYSTEM
   Theme: Collaborative Canvas Enterprise
   Strictly aligned with Stitch Design Tokens
   ========================================================================== */

:root {
  /* Brand Core Colors */
  --color-primary: #11425D;             /* Neptune's Wrath */
  --color-primary-container: #11425D;
  --color-midnight: #002233;            /* Midnight Dreams */
  --color-accent: #DDFF55;              /* Isotonic Water */
  --color-accent-hover: #D2F83B;
  --color-accent-dim: #B4D42A;
  
  /* Canvas & Surface Layers */
  --color-canvas: #F6F2E8;              /* Cheviot Canvas Warm White */
  --color-surface: #FDF9EF;
  --color-surface-card: #FFFFFF;
  --color-surface-container: #F2EEE4;
  --color-surface-container-high: #ECE8DE;
  --color-surface-container-low: #F7F3E9;
  
  /* Semantic Tones & Accents */
  --color-on-surface: #1C1C16;
  --color-on-surface-variant: #41474D;
  --color-pacific: #C0D6EA;             /* Pacific Panorama */
  --color-pacific-light: #E3EEF8;
  --color-grape: #C5C0C9;               /* Grape Mist */
  --color-border-subtle: rgba(0, 34, 51, 0.08);
  --color-border-hover: rgba(0, 34, 51, 0.16);
  --color-canvas-dot: rgba(17, 66, 93, 0.16);
  
  /* Multiplayer Presence Indicators */
  --color-presence-1: #FF6B6B;
  --color-presence-2: #4D96FF;
  
  /* Typography */
  --font-headline: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout & Radii */
  --container-max: 1280px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;
  
  /* Shadows & Elevation */
  --shadow-level-1: 0 2px 8px -2px rgba(0, 34, 51, 0.04), 0 6px 16px -4px rgba(0, 34, 51, 0.06);
  --shadow-level-2: 0 8px 24px -4px rgba(17, 66, 93, 0.08), 0 2px 6px -1px rgba(0, 34, 51, 0.04);
  --shadow-level-3: 0 20px 40px -8px rgba(0, 34, 51, 0.14), 0 4px 12px -2px rgba(17, 66, 93, 0.06);
  --shadow-accent-glow: 0 4px 20px rgba(221, 255, 85, 0.45);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6,
.font-headline {
  font-family: var(--font-headline);
  color: var(--color-midnight);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--color-on-surface-variant);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Accessibility Focus (animated ring) */
@keyframes focus-expand {
  from {
    outline-offset: 0px;
    outline-color: transparent;
  }
  to {
    outline-offset: 3px;
    outline-color: var(--color-primary);
  }
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
  animation: focus-expand 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Skip link for a11y */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-midnight);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  z-index: 9999;
  font-family: var(--font-headline);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Spatial Infinite Dot-Grid Background */
.canvas-dot-bg {
  background-image: radial-gradient(var(--color-canvas-dot) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}

/* Container Structure */
.container-max {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 1024px) {
  .container-max {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Header & Navigation */
.header-nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem 1rem;
}

@media (min-width: 1024px) {
  .header-nav-wrapper {
    padding: 0.75rem 2rem;
  }
}

.header-nav-bar {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 4rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-level-1);
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand img {
  height: 2.25rem;
  width: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.nav-links-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1.5rem;
}

@media (min-width: 1024px) {
  .nav-links-desktop {
    display: flex;
  }
}

.nav-link-item {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-headline);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-on-surface-variant);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.nav-link-item:hover {
  color: var(--color-midnight);
  background-color: var(--color-surface-container);
}

.nav-link-item.active {
  background-color: var(--color-pacific-light);
  color: var(--color-primary);
  font-weight: 700;
}

/* Language Switcher Pill */
.lang-switcher-pill {
  display: flex;
  align-items: center;
  background: var(--color-surface-container);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.lang-btn.active {
  background: #FFFFFF;
  color: var(--color-midnight);
  box-shadow: 0 1px 4px rgba(0, 34, 51, 0.08);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: #fff;
  color: var(--color-midnight);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Drawer Overlay */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 34, 51, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer.open {
  display: block;
  opacity: 1;
}

.mobile-drawer-content {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-level-3);
  border: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-drawer-content img {
  height: 2.25rem;
  width: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Pill Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-headline);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background-color 0.25s, color 0.25s, translate 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-midnight);
  translate: 0 -1px;
  box-shadow: var(--shadow-level-2);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-midnight);
  box-shadow: var(--shadow-accent-glow);
}

.btn-accent:hover {
  background-color: var(--color-accent-hover);
  translate: 0 -2px;
  scale: 1.02;
  box-shadow: 0 6px 24px rgba(221, 255, 85, 0.6);
}

.btn-ghost {
  background-color: var(--color-surface-card);
  color: var(--color-midnight);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-level-1);
}

.btn-ghost:hover {
  background-color: var(--color-surface-container);
  translate: 0 -1px;
}

/* Card Geometry */
.card-canvas {
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-level-1);
}

/* Sticky Note Widget */
.sticky-note {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-level-1);
  transition:
    rotate 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    scale 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    translate 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.sticky-note.tilt-left {
  rotate: -1.5deg;
}

.sticky-note.tilt-right {
  rotate: 1.5deg;
}

.sticky-note:hover {
  rotate: 0deg;
  scale: 1.02;
  box-shadow: var(--shadow-level-2);
}

.sticky-cream {
  background-color: #FFFDF9;
}

.sticky-blue {
  background-color: var(--color-pacific-light);
}

.sticky-lime {
  background-color: #F4FFCC;
}

/* Multiplayer Cursor Badge */
.multiplayer-cursor {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-headline);
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 20, 35, 0.2);
}

.cursor-presence-1 {
  background-color: var(--color-presence-1);
}

.cursor-presence-2 {
  background-color: var(--color-presence-2);
}

/* Symmetrical 2x2 Grid on Large Screens (Max 2 columns) */
.grid-2x2 {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 768px) {
  .grid-2x2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Straight Sticky Note */
.sticky-straight {
  translate: none !important;
  rotate: none !important;
  scale: none !important;
}

.sticky-straight:hover {
  translate: 0 -2px !important;
}

/* Stitch 1:1 Flow & Mockup Components */
.stitch-flow-box {
  background-color: var(--color-canvas);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-headline);
  font-size: 0.8125rem;
  color: var(--color-midnight);
  border: 1px solid var(--color-border-subtle);
}

.stitch-flow-pill {
  background-color: var(--color-surface-card);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 34, 51, 0.05);
  font-weight: 600;
  color: var(--color-midnight);
}

.stitch-chat-box {
  background-color: var(--color-canvas);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid var(--color-border-subtle);
}

.stitch-ai-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: var(--color-midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.stitch-chat-bubble {
  background-color: var(--color-surface-card);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-midnight);
  box-shadow: 0 1px 2px rgba(0, 34, 51, 0.05);
}

.stitch-compare-box {
  background-color: var(--color-canvas);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  border: 1px solid var(--color-border-subtle);
}

.stitch-compare-bad {
  background-color: rgba(186, 26, 26, 0.08);
  color: var(--color-on-surface-variant);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stitch-compare-good {
  background-color: rgba(221, 255, 85, 0.4);
  color: var(--color-midnight);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.stitch-checklist-box {
  background-color: var(--color-canvas);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--color-midnight);
  border: 1px solid var(--color-border-subtle);
}

/* Micro-Badges & Status Pills */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Details & Accordion Styling */
details.faq-item {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-level-1);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

details.faq-item[open] {
  border-color: var(--color-pacific);
  box-shadow: var(--shadow-level-2);
}

details.faq-item summary {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-midnight);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-primary);
  font-weight: 400;
  transition: transform 0.2s ease;
}

details.faq-item[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

details.faq-item p {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--color-on-surface-variant);
  border-top: 1px dashed var(--color-border-subtle);
  padding-top: 1rem;
}

/* Range Input Styling for ROI Calculator */
input[type="range"].roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-container-high);
  outline: none;
}

input[type="range"].roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-midnight);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 34, 51, 0.2);
  transition: transform 0.15s ease;
}

input[type="range"].roi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Pulse animation */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.7; }
}

.animate-pulse-dot {
  animation: pulse-dot 2s infinite ease-in-out;
}

/* Footer styling */
.footer-wrapper {
  background-color: var(--color-surface-container);
  border-top: 1px solid var(--color-border-subtle);
  padding: 4rem 1.5rem 2.5rem;
  margin-top: 4rem;
}

@media (min-width: 1024px) {
  .footer-wrapper {
    padding: 5rem 2rem 3rem;
  }
}

/* ==========================================================================
   ANIMATION SYSTEM — Scroll Reveals & Micro-Interactions
   ========================================================================== */

/* ── Scroll Reveal: Hidden ONLY when JS is confirmed loaded ──
   Content is visible by default. The inline <script> in <head> adds
   .js-loaded to <html>, enabling the hidden initial state.
   If JS fails, CDN is blocked, or noscript: content stays visible. ── */
.js-loaded .reveal,
.js-loaded .reveal-hero {
  opacity: 0;
  transform: translateY(2rem);
}

.js-loaded .reveal-child {
  opacity: 0;
  transform: translateY(2rem);
}

/* ── Reduced Motion: Instant display, no animation ── */
@media (prefers-reduced-motion: reduce) {
  .js-loaded .reveal,
  .js-loaded .reveal-hero,
  .js-loaded .reveal-child {
    opacity: 1 !important;
    translate: none !important;
  rotate: none !important;
  scale: none !important;
  }
}

/* ── Enhanced Card Hover Depth System (3-tier) ── */
.card-canvas {
  transition:
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    translate 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-canvas:hover {
  box-shadow: var(--shadow-level-2);
  translate: 0 -3px;
  border-color: var(--color-border-hover);
}

.card-canvas:active {
  translate: 0 -1px;
  box-shadow: var(--shadow-level-1);
}

/* ── Button Gradient Sweep (mural.co pattern) ── */
.btn-accent {
  background-image: linear-gradient(
    90deg,
    var(--color-accent-hover) 0%,
    var(--color-accent) 50%,
    var(--color-accent-hover) 100%
  );
  background-size: 200% 100%;
  background-position: right center;
  transition:
    background-position 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    translate 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    scale 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-accent:hover {
  background-position: left center;
}

/* ── Nav Link Underline Reveal ── */
.nav-link-item {
  position: relative;
}

.nav-links-desktop .nav-link-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links-desktop .nav-link-item:hover::after {
  width: 60%;
  left: 20%;
}

.nav-links-desktop .nav-link-item.active::after {
  width: 0;
}

/* ── Badge Pill Hover Lift ── */
.badge-pill {
  transition: translate 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

/* ── Multiplayer Cursor Float ── */
@keyframes cursor-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.multiplayer-cursor {
  animation: cursor-float 3s ease-in-out infinite;
}

.cursor-presence-2 {
  animation-delay: 1.5s;
}

/* ==========================================================================
   MODERN CSS ENHANCEMENTS
   ========================================================================== */

/* ── Typography: prevent orphan words ── */
h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ── Rendering: defer off-screen section paint ── */
.footer-wrapper {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

