/* =========================================================
   LogicLabs — premium redesign
   Design tokens, component classes & motion.
   Tailwind (CDN) handles layout utilities; this file owns
   the brand system, custom components and animations.
   ========================================================= */

:root {
  --navy: #0B1020;
  --accent: #2563EB;
  --accent-600: #1D4ED8;
  --bg: #FFFFFF;
  --bg-2: #F8FAFC;
  --text: #111827;
  --muted: #6B7280;
  --line: #E9EDF3;
  --line-strong: #DBE2EC;
  --ring: rgba(37, 99, 235, .35);
  --shadow-sm: 0 1px 2px rgba(11, 16, 32, .04), 0 1px 3px rgba(11, 16, 32, .06);
  --shadow: 0 8px 24px rgba(11, 16, 32, .06), 0 2px 6px rgba(11, 16, 32, .04);
  --shadow-lg: 0 30px 60px -20px rgba(11, 16, 32, .18), 0 12px 24px -12px rgba(11, 16, 32, .10);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: -0.011em;
}
h1, h2, h3, h4, .font-display {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1.05;
}
::selection { background: rgba(37, 99, 235, .16); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Layout helpers ---------- */
.container-x { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .5; }
.section-title { font-size: clamp(2rem, 3.6vw, 3.1rem); font-weight: 800; }
.lead { color: var(--muted); font-size: 1.075rem; line-height: 1.7; }
.hairline { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .95rem; line-height: 1; white-space: nowrap;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(11, 16, 32, .5); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-accent:hover { background: var(--accent-600); transform: translateY(-2px); box-shadow: 0 16px 34px -12px var(--accent); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-ghost-dark:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .06); }
.btn-arrow svg { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow-icon { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header { transition: background .3s, border-color .3s, box-shadow .3s; border-bottom: 1px solid transparent; }
.site-header.scrolled { background: rgba(255, 255, 255, .8); backdrop-filter: saturate(1.4) blur(14px); border-bottom-color: var(--line); }
.nav-link { position: relative; color: var(--text); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-link:hover { color: var(--navy); }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; margin: 0 auto; width: 0;
  background: var(--accent); transition: width .25s var(--ease);
}
.nav-link:hover::after { width: 100%; }

/* ---------- Mega-menu navigation ---------- */
.nav-item { position: static; display: flex; align-items: center; height: 74px; }
.nav-trigger {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer;
  font-family: inherit; color: var(--text); font-weight: 500; font-size: .95rem; padding: 0;
}
.nav-trigger .chev { width: 15px; height: 15px; transition: transform .25s var(--ease); color: var(--muted); }
.nav-item.open .nav-trigger .chev, .nav-item:hover .nav-trigger .chev { transform: rotate(180deg); }
.nav-item.open .nav-trigger, .nav-item:hover .nav-trigger { color: var(--navy); }

.mega {
  position: fixed; left: 0; right: 0; top: 74px; z-index: 45;
  background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(11,16,32,.22);
  opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.nav-item:hover > .mega, .nav-item:focus-within > .mega, .nav-item.open > .mega {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.mega-inner { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 36px 0 40px; }
.mega-inner--wide { grid-template-columns: 1fr; }
.mega-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 26px; }
.mega-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mega-group-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.mega-link { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; transition: background .18s; }
.mega-link:hover { background: var(--bg-2); }
.mega-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--bg-2); border: 1px solid var(--line); color: var(--navy); transition: background .2s, color .2s; }
.mega-ico svg { width: 18px; height: 18px; }
.mega-link:hover .mega-ico { background: var(--navy); color: #fff; }
.mega-link-title { display: block; font-weight: 600; font-size: .93rem; color: var(--navy); line-height: 1.2; }
.mega-link-desc { font-size: .8rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.mega-feature { background: var(--navy); border-radius: 16px; padding: 26px; color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.mega-feature h4 { color: #fff; font-size: 1.05rem; }
.mega-feature p { color: rgba(255,255,255,.65); font-size: .85rem; margin-top: 6px; flex: 1; }
.mega-feature .link-more { color: #7fb0ff; margin-top: 14px; }
.mega-feature img { border-radius: 10px; border: 1px solid rgba(255,255,255,.12); margin-bottom: 16px; }
/* simple product/industry tiles */
.mega-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .2s var(--ease); }
.mega-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.mega-tile .mega-ico { background: var(--bg-2); }
.mega-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); margin-top: 8px; }

/* Mobile accordion for nav groups */
.m-acc-panel { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.m-acc.open .m-acc-panel { max-height: 900px; }
.m-acc-trigger .chev { transition: transform .25s var(--ease); }
.m-acc.open .m-acc-trigger .chev { transform: rotate(180deg); }

/* ---------- Cards ---------- */
.card {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.icon-box {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--navy);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.icon-box svg { width: 22px; height: 22px; }
.card-hover:hover .icon-box { background: var(--navy); color: #fff; transform: translateY(-2px) rotate(-4deg); }
.link-more {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--accent);
}
.link-more svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.card-hover:hover .link-more svg { transform: translateX(4px); }

/* ---------- Badges (tech stack) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 500; font-size: .9rem;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.badge:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.badge svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Logo strip marquee ---------- */
.marquee { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.marquee-track { display: flex; align-items: center; gap: 64px; padding-right: 64px; }
.marquee-item { color: #9aa4b2; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; white-space: nowrap; opacity: .8; transition: color .25s, opacity .25s; }
.marquee-item:hover { color: var(--navy); opacity: 1; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mask-fade { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }

/* ---------- Process timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--accent), var(--line-strong));
}
.tl-node {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 22px;
  background: #fff; border: 1px solid var(--line-strong); color: var(--navy); position: relative; z-index: 1;
  box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s;
}
.tl-node svg { width: 24px; height: 24px; }
.tl-step:hover .tl-node { background: var(--navy); color: #fff; transform: translateY(-4px); box-shadow: var(--shadow); }
.tl-num { font-size: .75rem; font-weight: 700; color: var(--accent); letter-spacing: .1em; }

/* ---------- Dark sections ---------- */
.section-dark { background: var(--navy); color: #fff; }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark .lead { color: rgba(255, 255, 255, .68); }
.card-dark {
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  transition: transform .3s var(--ease), background .3s, border-color .3s, box-shadow .3s;
}
.card-dark:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }
.grid-glow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.grid-glow::before {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; top: -320px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(37, 99, 235, .35), transparent 62%); filter: blur(30px);
}

/* ---------- Hero visual ---------- */
.hero-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 70% 40%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 70% 40%, #000, transparent 72%);
}
.float { animation: float 6s ease-in-out infinite; }
.float-2 { animation: float 7.5s ease-in-out infinite; animation-delay: -1.5s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.spin-slow { animation: spin 26s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Stat ---------- */
.stat-num { font-family: "Manrope", sans-serif; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: .07s; }
[data-reveal-delay="2"] { transition-delay: .14s; }
[data-reveal-delay="3"] { transition-delay: .21s; }
[data-reveal-delay="4"] { transition-delay: .28s; }
[data-reveal-delay="5"] { transition-delay: .35s; }

/* ---------- Featured-in press logos ---------- */
.press-logo { height: 30px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .5; transition: opacity .25s, filter .25s; }
.press-logo:hover { opacity: .9; filter: grayscale(0); }

/* ---------- AI capabilities (dark bento) ---------- */
.ai-tile { position: relative; overflow: hidden; }
.ai-tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 120% at 100% 0%, rgba(37, 99, 235, .28), transparent 55%);
  transition: opacity .4s var(--ease);
}
.ai-tile:hover::after { opacity: 1; }
.ai-tile-num { font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: rgba(255, 255, 255, .35); }
.ai-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(37, 99, 235, .16); border: 1px solid rgba(37, 99, 235, .3); color: #fff;
  transition: background .3s, transform .3s var(--ease);
}
.ai-icon svg { width: 22px; height: 22px; }
.ai-tile:hover .ai-icon { background: var(--accent); transform: translateY(-2px); }

/* ---------- Model & framework chips ---------- */
.model-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 600; font-size: .9rem; color: var(--navy); white-space: nowrap;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.model-chip img { height: 20px; width: auto; object-fit: contain; }
.model-chip:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.model-row { display: flex; width: max-content; gap: 14px; animation: marquee 44s linear infinite; }
.model-row.rev { animation-direction: reverse; }
.model-row:hover { animation-play-state: paused; }

/* ---------- Product media ---------- */
.product-shot { position: relative; overflow: hidden; }
.product-shot img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .5s var(--ease); }
.card-hover:hover .product-shot img { transform: scale(1.03); }

/* ---------- Contact form ---------- */
.field-label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: #fff; font-size: .95rem; color: var(--text); font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.field-input::placeholder { color: #9aa4b2; }
.field-input:hover { border-color: #cbd5e1; }
.field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.form-status { font-size: .9rem; font-weight: 500; padding: 11px 14px; border-radius: 10px; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.form-status.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-info-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; }
.contact-info-icon svg { width: 19px; height: 19px; }

/* ---------- Case-study figures ---------- */
.case-figure { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.case-figure:hover { transform: translateY(-5px); }

/* ---------- Page hero illustration scenes (reusable) ---------- */
.scene { position: relative; border-radius: 22px; border: 1px solid rgba(255,255,255,.09); background: linear-gradient(158deg,#0b1020 0%,#131e42 55%,#182a5c 100%); box-shadow: 0 30px 60px -22px rgba(11,16,32,.55); overflow: hidden; aspect-ratio: 5 / 4; }
.scene-grid { position:absolute; inset:0; background-image: linear-gradient(rgba(127,160,255,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(127,160,255,.10) 1px,transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(circle at 52% 44%,#000,transparent 80%); mask-image: radial-gradient(circle at 52% 44%,#000,transparent 80%); }
.scene-glow { position:absolute; width:95%; height:95%; left:52%; top:40%; transform:translate(-50%,-50%); border-radius:50%; background: radial-gradient(circle, rgba(37,99,235,.45), transparent 60%); filter: blur(26px); }
.scene-art { position:relative; z-index:1; width:100%; height:100%; display:block; }
.scene-chip { position:absolute; z-index:2; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow: var(--shadow); padding:9px 13px; display:flex; align-items:center; gap:8px; font-size:.8rem; color:var(--muted); white-space:nowrap; }
.scene-chip b { font-family:"Manrope",sans-serif; font-weight:800; color:var(--navy); font-size:.95rem; }
.scene-chip .live { width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.16); flex:0 0 auto; }
.scene-node-pulse { animation: nodePulse 2.6s ease-in-out infinite; transform-origin:center; }
@keyframes nodePulse { 0%,100%{opacity:.45} 50%{opacity:1} }

/* ---------- Mobile nav ---------- */
.mobile-panel { transition: opacity .3s var(--ease), visibility .3s; }
.mobile-panel[hidden] { display: none; }

@media (max-width: 900px) {
  .timeline::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
  .marquee { animation-duration: 36s !important; } /* keep logo strip moving */
}
