/* Ahead Digital — AI Practice — Site styles */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ahead-fg-1);
  background: #fff;
  overflow-x: hidden;
}

/* Smooth anchor scrolling */
html { scroll-behavior: smooth; }

/* Reusable layout container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 720px) {
  .container { padding: 0 24px; }
}

/* Section paddings */
.section { padding: 120px 0; }
.section-tight { padding: 80px 0; }
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .section-tight { padding: 56px 0; }
}

/* Display - oversized headlines */
.display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.88;
  font-size: clamp(56px, 9vw, 140px);
  color: var(--ahead-primary);
  margin: 0;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  line-height: 0.92;
  font-size: clamp(44px, 6.5vw, 96px);
  color: var(--ahead-primary);
  margin: 0;
}

.display-md {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.95;
  font-size: clamp(36px, 4.5vw, 64px);
  color: var(--ahead-primary);
  margin: 0;
}

.h-section {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
  font-size: clamp(36px, 5vw, 72px);
  color: var(--ahead-primary);
  margin: 0;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ahead-secondary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--ahead-secondary);
}

.lede {
  font-family: var(--font-sans);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--ahead-fg-2);
  font-weight: 400;
  max-width: 640px;
  margin: 0;
  text-wrap: pretty;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 16px 28px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: all 200ms cubic-bezier(.2,.7,.2,1);
  white-space: nowrap;
}
.btn-accent {
  background: var(--ahead-secondary);
  color: #fff;
}
.btn-accent:hover {
  background: var(--ahead-comp-04);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(229,41,84,.5);
}
.btn-primary {
  background: var(--ahead-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--ahead-comp-01);
  color: #fff;
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ahead-primary);
  box-shadow: inset 0 0 0 1.5px var(--ahead-primary);
}
.btn-ghost:hover {
  background: var(--ahead-primary);
  color: #fff;
}
.btn-onDark {
  background: #fff;
  color: var(--ahead-primary);
}
.btn-onDark:hover {
  background: var(--ahead-comp-05);
  color: var(--ahead-primary);
  transform: translateY(-2px);
}
.btn-link-onDark {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3);
}
.btn-link-onDark:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.btn-sm { padding: 10px 18px; font-size: 13px; border-radius: 10px; }

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,85,91,.1);
  color: var(--ahead-secondary);
  font-family: var(--font-sans);
}
.pill-onDark {
  background: rgba(255,255,255,.1);
  color: #fff;
  backdrop-filter: blur(12px);
}

/* Card */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(25,23,56,.06);
  transition: all 240ms cubic-bezier(.2,.7,.2,1);
  border: 1px solid var(--ahead-line);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -12px rgba(25,23,56,.18);
  border-color: transparent;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Letter mark for the AI Practice */
.ai-mark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 0.9em;
  color: var(--ahead-secondary);
  letter-spacing: -0.04em;
  transform: skewX(-6deg);
  display: inline-block;
}

/* Skew utility */
.skew-block {
  display: inline-block;
  transform: skewY(-6deg);
}

/* Marquee */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  gap: 64px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* Pulse for live nodes */
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Floating coral blob */
@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-15px, 10px) scale(0.97); }
}

/* Slide in left/right */
@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Underline on hover for nav */
.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--ahead-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms;
  padding: 6px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -2px;
  height: 2px;
  background: var(--ahead-secondary);
  transition: right 200ms cubic-bezier(.2,.7,.2,1);
}
.nav-link:hover::after { right: 0; }
.nav-link.is-active::after { right: 0; }

/* Hide scrollbar in marquee row */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Form */
.input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--ahead-line);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ahead-fg-1);
  background: #fff;
  transition: border-color 150ms, box-shadow 150ms;
}
.input:focus {
  outline: none;
  border-color: var(--ahead-primary);
  box-shadow: 0 0 0 3px rgba(44, 51, 242, .14);
}
.textarea { min-height: 140px; resize: vertical; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ahead-primary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

/* Responsive grids */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ========================================================
   Responsive — global tweaks for the website
   ======================================================== */

/* Tablet (≤1024px) — reduce paddings, simplify layouts */
@media (max-width: 1024px) {
  .container { padding: 0 32px; }
  .section { padding: 96px 0; }
  .btn { padding: 14px 24px; font-size: 14px; }
}

/* Small tablet (≤720px) — already covered above for container/section */

/* Mobile (≤640px) — final tightening */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 56px 0; }
  .btn {
    padding: 14px 22px;
    font-size: 14px;
    width: auto;
  }
  .pill { font-size: 12px; padding: 5px 12px; }
  .lede { font-size: 16px !important; line-height: 1.55; }
  .input { font-size: 14px; padding: 12px 14px; }
  .label { font-size: 12px; }
}

/* Mobile — display fonts must shrink more aggressively */
@media (max-width: 480px) {
  .display-xl { font-size: clamp(40px, 12vw, 64px); }
  .display-lg { font-size: clamp(36px, 11vw, 56px); }
  .display-md { font-size: clamp(32px, 9vw, 48px); }
  .h-section { font-size: clamp(28px, 8vw, 44px); }
}

/* Hide marquee a bit on mobile */
@media (max-width: 640px) {
  .marquee { gap: 32px; animation-duration: 30s; }
}

/* Mobile FAQ buttons */
@media (max-width: 640px) {
  .nav-link { font-size: 16px; }
}

/* ========================================================
   Override inline grids on mobile
   Inline `style="grid-template-columns: repeat(N, 1fr)"`
   gets stacked on small viewports.
   ======================================================== */
@media (max-width: 720px) {
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="gridTemplateColumns: \"repeat(4, 1fr)\""] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 540px) {
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Also catch repeat(N, 1fr) and repeat(2,1fr) at very small widths */
@media (max-width: 480px) {
  [style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Hero meta strips and similar — break any grid into stack on tiny screens */
@media (max-width: 720px) {
  [style*="grid-template-columns: 1fr 1fr"]:not([style*="auto"]) {
    grid-template-columns: 1fr !important;
  }
}
