@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Outfit:wght@300;400;600;800&display=swap');

:root {
  /* Canvas Colors */
  --bg-canvas: #ffffff;
  --bg-paper: #fafafa;
  
  /* Ink Colors */
  --ink-black: #1a1a1a;
  --ink-light: #4b5563;
  
  /* Xiaohei Annotation Pops (Legacy + Accents) */
  --pop-red: #b91c1c;
  --pop-blue: #1d4ed8;
  --pop-orange: #b45309;
  
  /* Vibrant Agency Memphis Palette */
  --agency-pink: #ec4899;
  --agency-cyan: #06b6d4;
  --agency-yellow: #fde047;
  --agency-green: #10b981;
  --agency-purple: #8b5cf6;
  
  /* Typography */
  --font-main: 'Outfit', sans-serif;
  --font-sketch: 'Caveat', cursive;
  
  /* Hand-drawn borders (CSS Trick) */
  --border-sketch: 2px solid var(--ink-black);
  --radius-sketch-1: 2px 255px 3px 25px / 255px 5px 225px 3px;
  --radius-sketch-2: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius-sketch-3: 15px 225px 15px 255px / 255px 15px 225px 15px;
}

/* Background Utility Classes */
.bg-pink { background-color: var(--agency-pink) !important; color: white !important; }
.bg-cyan { background-color: var(--agency-cyan) !important; color: white !important; }
.bg-yellow { background-color: var(--agency-yellow) !important; color: var(--ink-black) !important; }
.bg-green { background-color: var(--agency-green) !important; color: white !important; }
.bg-purple { background-color: var(--agency-purple) !important; color: white !important; }

/* Text Utility Classes */
.text-pink { color: var(--agency-pink) !important; }
.text-cyan { color: var(--agency-cyan) !important; }
.text-yellow { color: var(--agency-yellow) !important; }
.text-green { color: var(--agency-green) !important; }
.text-purple { color: var(--agency-purple) !important; }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--ink-black);
  line-height: 1.6;
  /* Subtle notebook dot grid */
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  color: inherit;
  line-height: 1.1;
}

.sketch-highlight {
  position: relative;
  display: inline-block;
}

@keyframes waveHi {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(20deg); }
}

@keyframes draw-underline {
  0% { width: 0%; opacity: 0; }
  100% { width: 104%; opacity: 1; }
}

.sketch-highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -2%;
  width: 104%;
  height: 8px;
  background-color: rgba(239, 68, 68, 0.2);
  border-bottom: 2px solid var(--pop-red);
  border-radius: var(--radius-sketch-1);
  transform: rotate(-1deg);
  z-index: -1;
  animation: draw-underline 1s cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards;
}

@keyframes sketch-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-4px) rotate(-2deg); }
}

.annotation {
  font-family: var(--font-sketch);
  font-size: 1.8rem;
  color: var(--pop-blue);
  transform: rotate(-5deg);
  display: inline-block;
  animation: sketch-float 4s ease-in-out infinite;
}

.annotation.red { color: var(--pop-red); }
.annotation.orange { color: var(--pop-orange); }

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
  position: relative;
}

/* Navbar */
.navbar {
  padding: 24px 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink-black);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-black);
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
}

.nav-links a:hover::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  border-bottom: 2px solid var(--pop-blue);
  border-radius: var(--radius-sketch-2);
}

/* Buttons */
.btn-sketch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-canvas);
  border: var(--border-sketch);
  border-radius: var(--radius-sketch-1);
  color: var(--ink-black);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 4px 4px 0 var(--ink-black);
}

.btn-sketch:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink-black);
  border-radius: var(--radius-sketch-3);
}

.btn-sketch.primary {
  background: var(--ink-black);
  color: var(--bg-canvas);
  box-shadow: 4px 4px 0 var(--pop-blue);
}

.btn-sketch.primary:hover {
  box-shadow: 6px 6px 0 var(--pop-blue);
}

/* Hero Section */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 24px;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--ink-light);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-visual {
  position: relative;
}

.sketch-box {
  background: var(--bg-paper);
  border: var(--border-sketch);
  border-radius: var(--radius-sketch-2);
  padding: 32px;
  position: relative;
}

.sketch-box::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: 8px; bottom: 8px;
  border: 1px dashed var(--ink-light);
  border-radius: var(--radius-sketch-3);
  z-index: -1;
}

/* Polaroid Style Component */
.polaroid {
  background: white;
  padding: 16px 16px 48px 16px;
  border: var(--border-sketch);
  border-radius: var(--radius-sketch-1);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
  margin-bottom: 24px;
  position: relative;
  text-align: center;
}
.polaroid-img {
  width: 100%;
  height: 200px;
  background-color: var(--bg-paper);
  border: 1px solid var(--ink-light);
  background-image: repeating-linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0), repeating-linear-gradient(45deg, #f0f0f0 25%, #fafafa 25%, #fafafa 75%, #f0f0f0 75%, #f0f0f0);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-family: var(--font-sketch);
  font-size: 1.5rem;
}
.polaroid-caption {
  font-family: var(--font-sketch);
  font-size: 1.4rem;
  color: var(--ink-light);
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
}

/* Trend Feed Widget */
.trend-widget {
  margin-top: 48px;
  border: var(--border-sketch);
  border-radius: var(--radius-sketch-1);
  padding: 16px;
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.trend-label {
  font-family: var(--font-sketch);
  color: var(--pop-orange);
  font-size: 1.5rem;
  white-space: nowrap;
}

.trend-ticker-container {
  overflow: hidden;
  flex: 1;
}

.trend-ticker {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-black);
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  display: inline-block;
}

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

/* Services / Architecture Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 64px;
}

.card-sketch {
  background: var(--bg-canvas);
  border: var(--border-sketch);
  border-radius: var(--radius-sketch-3);
  padding: 32px;
  transition: transform 0.2s ease;
}

.card-sketch:hover {
  transform: translateY(-8px);
  border-radius: var(--radius-sketch-1);
  box-shadow: 8px 8px 0 rgba(0,0,0,0.05);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: inline-block;
  border: 2px solid var(--ink-black);
  border-radius: 50%;
  width: 60px; height: 60px;
  text-align: center;
  line-height: 56px;
  background: var(--bg-paper);
}

/* Footer */
footer {
  border-top: var(--border-sketch);
  padding: 64px 0;
  margin-top: 100px;
  text-align: center;
}

/* --- Swup Page Transitions --- */
.transition-fade {
  transition: opacity 0.4s cubic-bezier(0.85, 0, 0.15, 1), transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);
  opacity: 1;
  transform: translateY(0);
}
html.is-animating .transition-fade {
  opacity: 0;
  transform: translateY(15px);
}

/* Musa Navbar Jump Container */
#musa-nav-jumper {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 1000;
  display: none;
}

/* Annotation Color Extensions */
.annotation.purple { color: var(--agency-purple); }
.annotation.cyan { color: var(--agency-cyan); }
.annotation.pink { color: var(--agency-pink); }
.annotation.yellow { color: var(--agency-yellow); }
.annotation.green { color: var(--agency-green); }

/* ================================
   RESPONSIVE — Mobile First
   ================================ */

/* Tablets & smaller desktops */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-visual {
    order: -1; /* Blueprint card above text on tablets */
  }

  .hero-content h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Navbar stacks */
  .navbar .container {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 16px;
    padding-top: 16px;
    border-top: var(--border-sketch);
    margin-top: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: 80px 0 48px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-content h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem) !important;
    line-height: 1.15 !important;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-visual .sketch-box {
    padding: 24px 16px;
  }

  /* Cards */
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }

  .card-sketch {
    padding: 24px;
  }

  /* Trend widget */
  .trend-widget {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 40px;
  }

  /* Sections */
  section {
    padding: 60px 0;
  }

  /* Footer */
  footer {
    padding: 40px 0;
    margin-top: 60px;
  }

  /* Hide decorative SVGs on small screens */
  .hero-content > svg,
  .services svg[viewBox="0 0 100 150"],
  .card-sketch > svg {
    display: none;
  }

  /* CTA buttons stack */
  .hero-content > div[style*="display: flex"] {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .btn-sketch {
    text-align: center;
    justify-content: center;
  }

  /* Typography scale */
  h2 {
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
  }

  .annotation {
    font-size: 1.3rem;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .container {
    padding: 0 16px;
  }

  .hero-content h1 {
    font-size: 1.6rem !important;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .card-icon {
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 44px;
  }
}

/* Canvas performance hint */
#hero-canvas {
  will-change: transform;
}

/* Hamburger Menu Button (appears on mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink-black);
  transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
}
