/* ==========================================================================
   El Amri Labs — styles
   ========================================================================== */

:root {
  --bg: #000;
  --bg-2: #0a0a0c;
  --card: #111114;
  --card-2: #16161a;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #86868b;
  --accent: #2997ff;
  --ai-1: #a78bfa;  --ai-2: #60a5fa;
  --web-1: #34d399; --web-2: #22d3ee;
  --app-1: #fb923c; --app-2: #f472b6;
  --radius: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(41, 151, 255, 0.35); }

.container { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); margin-bottom: 14px;
}
.display {
  font-size: clamp(52px, 10vw, 128px);
  line-height: 0.98; font-weight: 700; letter-spacing: -0.045em;
}
.display--md { font-size: clamp(44px, 7.5vw, 96px); }
.headline {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
}
.lede {
  margin-top: 24px; font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.4; color: #a1a1a6; font-weight: 500; letter-spacing: -0.01em;
}
.grad {
  background: linear-gradient(90deg, #a78bfa 0%, #60a5fa 35%, #34d399 70%, #fbbf24 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease-in-out infinite alternate;
}
.grad--ai  { background-image: linear-gradient(90deg, var(--ai-1), var(--ai-2), var(--ai-1)); }
.grad--web { background-image: linear-gradient(90deg, var(--web-1), var(--web-2), var(--web-1)); }
.grad--app { background-image: linear-gradient(90deg, var(--app-1), var(--app-2), var(--app-1)); }
@keyframes gradShift { to { background-position: 100% 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--text); color: #000; font-weight: 600; font-size: 17px;
  transition: transform .4s var(--ease), background .3s, box-shadow .4s var(--ease);
  will-change: transform;
}
.btn:hover { transform: scale(1.04); box-shadow: 0 10px 40px rgba(255,255,255,0.15); }
.btn:active { transform: scale(0.98); }
.btn--ghost { background: rgba(255,255,255,0.08); color: var(--text); backdrop-filter: blur(20px); }
.btn--ghost:hover { background: rgba(255,255,255,0.14); box-shadow: none; }
.btn--small { height: 32px; padding: 0 16px; font-size: 13px; }
.btn--large { height: 64px; padding: 0 36px; font-size: clamp(17px, 2.4vw, 22px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 56px; width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter);
}
.nav__logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.nav__mark {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(from 180deg, #a78bfa, #60a5fa, #34d399, #fbbf24, #f472b6, #a78bfa);
  animation: spin 6s linear infinite;
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.5);
}
@keyframes spin { to { transform: rotate(360deg); } }
.nav__links { display: flex; gap: 32px; font-size: 13px; color: #d2d2d7; }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: #fff; }
@media (max-width: 720px) { .nav__links { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; height: 500vh; }
.hero__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.75) 100%),
    linear-gradient(to bottom, transparent 70%, #000 100%);
}
.hero__scene {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 var(--gutter);
  opacity: 0; pointer-events: none;
  transform: translate3d(0, 40px, 0) scale(0.97); filter: blur(8px);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease);
}
.hero__scene--low { justify-content: flex-end; padding-bottom: clamp(64px, 11vh, 120px); }
.hero__scene--low .display--md { font-size: clamp(40px, 6vw, 80px); }
.hero__scene.is-active { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.hero__scene.is-past { transform: translate3d(0, -40px, 0) scale(1.03); }
.hero__cta { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; justify-content: center; }
.hero__scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase;
  transition: opacity .5s;
}
.hero__scroll span {
  width: 22px; height: 34px; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 12px; position: relative;
}
.hero__scroll span::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: #fff; animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
.hero__progress {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
  width: 2px; height: 120px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
}
.hero__progress span { display: block; width: 100%; height: 100%; background: #fff; transform-origin: top; transform: scaleY(0); }
@media (max-width: 720px) { .hero__progress { display: none; } }

/* ---------- Statement ---------- */
.statement { position: relative; height: 220vh; }
.statement__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--gutter);
}
.statement__text {
  max-width: 1000px;
  font-size: clamp(30px, 4.6vw, 60px); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em;
}
.statement__text .w { color: #2a2a2d; transition: color .35s ease; }
.statement__text .w.is-on { color: var(--text); }

/* ---------- Sections ---------- */
.section { padding: clamp(100px, 16vw, 180px) 0; }
.section--tight { padding: 80px 0; }
.section__head { margin-bottom: clamp(48px, 7vw, 80px); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translate3d(0, 48px, 0);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Bento ---------- */
.bento {
  display: grid; gap: 20px;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(260px, auto);
}
.card {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--card); border-radius: var(--radius);
  padding: clamp(28px, 3.5vw, 40px);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .6s var(--ease), border-color .4s, opacity 1s var(--ease);
  transform-style: preserve-3d;
}
.card:hover { border-color: rgba(255,255,255,0.16); }
.card__glow {
  position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgba(255,255,255,0.08), transparent 45%);
}
.card:hover .card__glow { opacity: 1; }
.card h3 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 10px; }
.card p { color: #a1a1a6; font-size: 17px; line-height: 1.47; max-width: 46ch; }
.card__icon {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 28px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
}
.card__icon svg { width: 24px; height: 24px; }

.card--xl { grid-column: span 6; min-height: 460px; }
.card--tall { grid-column: span 3; min-height: 480px; }
.card--auto, .card--design, .card--strategy { grid-column: span 2; }

.card--ai { background: radial-gradient(120% 120% at 100% 0%, rgba(167,139,250,0.16), transparent 50%), var(--card); }
.card--ai .card__icon { color: var(--ai-1); }
.card--web .card__icon { color: var(--web-1); }
.card--app .card__icon { color: var(--app-1); }
.card--auto .card__icon { color: #fbbf24; }
.card--design .card__icon { color: #f472b6; }
.card--strategy .card__icon { color: #60a5fa; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); color: #d2d2d7; border: 1px solid var(--line); }

/* Chat mock (AI card) */
.chat {
  position: absolute; right: clamp(24px, 4vw, 48px); bottom: clamp(24px, 4vw, 48px);
  width: min(420px, 42%); display: flex; flex-direction: column; gap: 12px;
}
.chat__bubble { padding: 14px 18px; border-radius: 20px; font-size: 15px; line-height: 1.4; max-width: 90%;
  opacity: 0; transform: translateY(16px) scale(0.96); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.chat__bubble--user { align-self: flex-end; background: #0a84ff; color: #fff; border-bottom-right-radius: 6px; }
.chat__bubble--ai { align-self: flex-start; background: #26262b; color: #e5e5ea; border-bottom-left-radius: 6px; position: relative; min-height: 48px; }
.card.is-in .chat__bubble--user { opacity: 1; transform: none; transition-delay: .5s; }
.card.is-in .chat__bubble--ai { opacity: 1; transform: none; transition-delay: 1.1s; }
.chat__answer { opacity: 0; transition: opacity .6s ease 2.6s; display: block; }
.card.is-in .chat__answer { opacity: 1; }
.typing { display: inline-flex; gap: 4px; position: absolute; left: 18px; top: 20px; transition: opacity .3s ease 2.5s; }
.card.is-in .typing { opacity: 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8e8e93; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Browser mock (Web card) */
.browser {
  margin-top: auto; padding-top: 32px;
  transform: translateY(24px); transition: transform 1s var(--ease);
}
.card--web:hover .browser { transform: translateY(8px); }
.browser__bar { display: flex; gap: 6px; padding: 12px 14px; background: #1c1c21; border-radius: 14px 14px 0 0; border: 1px solid var(--line); border-bottom: 0; }
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a3f; }
.browser__body { background: #141418; border: 1px solid var(--line); border-top: 0; padding: 22px; display: flex; flex-direction: column; gap: 10px; border-radius: 0 0 14px 14px; }
.sk { display: block; height: 10px; border-radius: 6px; background: #26262b; }
.sk--h { height: 18px; width: 60%; background: linear-gradient(90deg, var(--web-1), var(--web-2)); opacity: .85; }
.sk--p { width: 90%; } .sk--short { width: 55%; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.sk-grid span { height: 64px; border-radius: 10px; background: #1f1f24; }
.card.is-in .sk { animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .55; } }

/* Phone mock (App card) */
.phone {
  margin: auto auto -120px; width: 200px; height: 340px; border-radius: 38px; padding: 10px;
  background: #1c1c21; border: 1px solid rgba(255,255,255,0.12); position: relative;
  transform: translateY(40px); transition: transform 1s var(--ease);
  box-shadow: 0 30px 80px rgba(251, 146, 60, 0.15);
}
.card--app:hover .phone { transform: translateY(10px) rotate(-3deg); }
.phone__notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 64px; height: 18px; border-radius: 10px; background: #000; z-index: 1; }
.phone__screen { height: 100%; border-radius: 30px; padding: 50px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
  background: linear-gradient(160deg, rgba(251,146,60,0.35), rgba(244,114,182,0.25) 60%, #141418); }
.phone__screen span { height: 70px; border-radius: 16px; background: rgba(255,255,255,0.14); backdrop-filter: blur(10px); }
.phone__screen span:first-child { grid-column: span 2; height: 90px; }

@media (max-width: 900px) {
  .card--xl, .card--tall { grid-column: span 6; }
  .card--auto, .card--design, .card--strategy { grid-column: span 6; min-height: 0; }
  .card--xl { min-height: 640px; }
  .chat { left: clamp(24px, 4vw, 48px); right: clamp(24px, 4vw, 48px); width: auto; }
}

/* ---------- Process (horizontal) ---------- */
.process { position: relative; height: 350vh; }
.process__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 56px;
}
.process__head { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.process__track {
  display: flex; gap: 24px; will-change: transform;
  padding: 0 max(var(--gutter), calc((100vw - 1120px) / 2 + var(--gutter)));
}
.step {
  flex: 0 0 min(460px, 82vw); min-height: 340px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; display: flex; flex-direction: column;
}
.step__num {
  font-size: 80px; font-weight: 800; letter-spacing: -0.05em; line-height: 1;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.1));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: auto; padding-bottom: 40px;
}
.step h3 { font-size: 32px; letter-spacing: -0.025em; margin-bottom: 12px; }
.step p { color: #a1a1a6; }
.process__bar { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.process__bar::before { content: ""; display: block; height: 2px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.process__bar span { display: block; height: 2px; margin-top: -2px; background: linear-gradient(90deg, var(--ai-1), var(--web-1)); transform-origin: left; transform: scaleX(0); border-radius: 2px; }

/* ---------- Marquee ---------- */
.marquee {
  display: flex; overflow: hidden; margin-top: 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__row { display: flex; flex-shrink: 0; gap: 56px; padding-right: 56px; animation: marquee 40s linear infinite; }
.marquee__row span { font-size: clamp(24px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.03em; color: #3a3a3f; white-space: nowrap; transition: color .3s; }
.marquee__row span:hover { color: #fff; }
.marquee:hover .marquee__row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- About ---------- */
.about { display: grid; gap: 64px; }
.about__lead { font-size: clamp(22px, 2.8vw, 32px); line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; color: #d2d2d7; max-width: 30em; }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.principle { padding-top: 24px; border-top: 1px solid var(--line); }
.principle__k { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.principle p { color: var(--muted); font-size: 16px; }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { position: relative; overflow: hidden; padding: clamp(140px, 20vw, 240px) 0; text-align: center; }
.contact__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.contact__actions { margin-top: 48px; }
.contact__orb {
  position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; max-width: 160vw; max-height: 160vw;
  translate: -50% -50%; border-radius: 50%; filter: blur(90px); opacity: .45;
  background: conic-gradient(from 0deg, #7c3aed, #2563eb, #059669, #d97706, #db2777, #7c3aed);
  animation: spin 24s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
          mask-image: radial-gradient(circle, #000 20%, transparent 65%);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: #6e6e73; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
