/* Legacy to Modern — site-specific styles */

:root { --maxw: 1312px; }

html { scroll-behavior: smooth; }
body { font-family: 'IBM Plex Sans', Helvetica, Arial, sans-serif; }

/* Utility */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.mono { font-family: 'IBM Plex Mono', Menlo, monospace; }

/* ---------- RESPONSIVE: mobile masthead + content ---------- */
@media (max-width: 900px) {
  .masthead-nav { display: none !important; }
  .masthead-hamburger { display: inline-flex !important; }
  .masthead-phone { display: none !important; }
  .masthead-cta { min-width: 0 !important; padding: 0 12px !important; }
  .masthead-cta .mono { margin-left: 12px !important; }
}
@media (max-width: 640px) {
  .masthead-cta-label { display: none; }
  .masthead-cta { min-width: 0 !important; padding: 0 14px !important; }
}

/* Hero: stack terminal/code panel below headline on tablet+mobile */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .display-hero { font-size: clamp(36px, 9vw, 56px) !important; }
  .display-section { font-size: clamp(28px, 7vw, 44px) !important; margin-bottom: 32px !important; }
  section { padding-left: 0 !important; padding-right: 0 !important; }
  .two-col { grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* Hero animation panel: tighten code sizing on phones so more of each line fits */
@media (max-width: 640px) {
  .hero-anim-lines { font-size: 11px !important; padding: 0 12px !important; }
}

/* CTA buttons: shrink minWidth on mobile so they don't overflow */
@media (max-width: 640px) {
  button, a { max-width: 100%; }
  .cta-wide { min-width: 0 !important; width: 100% !important; }
}

/* Ensure any inline padding around sections stays within viewport */
@media (max-width: 640px) {
  .section-pad { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ---------- RESPONSIVE: catch inline 2-column grids across pages ---------- */
/* Every section uses .container as the inner wrapper. Force any grid inside
   a .container to stack on narrow viewports. */
@media (max-width: 900px) {
  .container > div[style*="grid-template-columns"],
  .container > div[style*="gridTemplateColumns"],
  .container div[style*="1.1fr 0.9fr"],
  .container div[style*="1.2fr 0.8fr"],
  .container div[style*="1.3fr 0.7fr"],
  .container div[style*="1fr 1.4fr"],
  .container div[style*="1fr 2fr"],
  .container div[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Footer's 5-col grid */
  .container div[style*="1.6fr 1fr 1fr 1fr 1fr"],
  .container[style*="1.6fr 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  .container div[style*="repeat(4, 1fr)"],
  .container div[style*="repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .container div[style*="repeat(6, 1fr)"],
  .container div[style*="repeat(6,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  /* Inner container padding */
  .container { padding: 0 20px !important; }
  .container div[style*="padding: 48px 32px"],
  .container div[style*="padding: 64px 32px"],
  .container div[style*="padding: 24px 32px"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 16px !important; }
  .container div[style*="1.6fr 1fr 1fr 1fr 1fr"],
  .container[style*="1.6fr 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Hero stats grid — stack to single column */
  .container div[style*="grid-template-columns: repeat(4, 1fr)"],
  .container div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Huge inline padding sections: clamp on mobile */
  section[style*="padding: 96px 0"],
  section[style*="padding:96px 0"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  section[style*="padding: 72px"],
  section[style*="padding:72px"] { padding-top: 40px !important; padding-bottom: 24px !important; }
}

/* CTA banner (ContactInfo blue strip) — stack on mobile */
@media (max-width: 640px) {
  div[style*="background: #0f62fe"][style*="padding: 40px 32px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
    padding: 32px 20px !important;
  }
}

/* Grid hairline effect — tiles separated by 1px of border color */
.grid-hairline { display: grid; gap: 1px; background: #e0e0e0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}

/* Eyebrow treatment used throughout */
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16px;
  color: #525252;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: #0f62fe;
}

/* Display type */
.display-hero {
  font-family: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  font-size: clamp(42px, 6.2vw, 76px);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: #161616;
  margin: 0;
}
.display-section {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: -0.005em;
  color: #161616;
  margin: 0 0 48px;
  max-width: 980px;
}

/* Subtle animations — Carbon productive curve */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 480ms cubic-bezier(0.2, 0, 0.38, 0.9) both; }

/* Link with animated underline */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f62fe;
  font-size: 14px;
  letter-spacing: 0.16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 110ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.link-arrow:hover { border-color: #0f62fe; text-decoration: none; }
.link-arrow .arrow { font-family: 'IBM Plex Mono', monospace; transition: transform 110ms cubic-bezier(0.2, 0, 0.38, 0.9); }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* Dot grid background accent */
.dot-grid {
  background-image: radial-gradient(#c6c6c6 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Code-like tag */
.tag-mono {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0;
  color: #0f62fe;
  background: #edf5ff;
  padding: 4px 8px;
}

/* Scroll reveal — uses IntersectionObserver class toggle */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 520ms cubic-bezier(0.2,0,0.38,0.9), transform 520ms cubic-bezier(0.2,0,0.38,0.9); }
.reveal.in { opacity: 1; transform: none; }

/* Marquee for tech stack */
@keyframes scrollX {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scrollX 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Event Storming sticky-note fly-in ---------- */
.es-sticky {
  opacity: 0;
  will-change: transform, opacity;
}
@keyframes es-flyin {
  0% {
    opacity: 0;
    transform:
      translate(var(--es-from-x, 0), var(--es-from-y, 0))
      rotate(var(--es-from-rot, 0deg))
      scale(.7);
  }
  100% {
    opacity: 1;
    transform:
      translate(0, 0)
      rotate(var(--es-final-rot, 0deg))
      scale(1);
  }
}
.es-sticky.es-in {
  animation: es-flyin 720ms cubic-bezier(.2, 1.05, .4, 1) var(--es-delay, 0ms) both;
}
