/* ═══════════════════════════════════════════
   3MD — Design System v2
   ═══════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --accent: #E8873D;
  --accent-light: #F4A664;
  --accent-glow: rgba(232, 135, 61, 0.15);
  --bg: #09090B;
  --bg-elevated: #0F0F11;
  --bg-card: #141416;
  --text: #F0F0F2;
  --text-muted: #6E6E73;
  --border: #1C1C1F;
  --border-light: #2A2A2E;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; }

/* ─── NOISE OVERLAY ─── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ─── UTILITIES ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--sm { max-width: 720px; }

/* ─── BUTTON ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  border-radius: 60px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 60px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.btn:hover { box-shadow: 0 12px 40px rgba(232,135,61,0.35); }
.btn:hover::after { opacity: 1; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: none;
}

.btn--sm { padding: 11px 26px; font-size: 0.825rem; }
.btn--full { width: 100%; justify-content: center; }

.btn__arrow { transition: transform 0.4s var(--ease); }
.btn:hover .btn__arrow { transform: translate(3px, -3px); }

/* Magnetic wrapper — JS handles the transform */
.btn--magnetic { transition: transform 0.3s var(--ease); }

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  transition: all 0.5s var(--ease);
}

.nav--scrolled {
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 14px 48px;
}

.nav__logo img { height: 30px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link {
  font-size: 0.825rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
  letter-spacing: 0.01em;
  padding: 8px 18px;
  border-radius: 50px;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.btn--nav {
  margin-left: 12px;
}

/* ─── BURGER ─── */
.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  z-index: 201;
  border-radius: 50%;
  transition: background 0.3s var(--ease);
}

.nav__burger:hover { background: rgba(255,255,255,0.05); }

.nav__burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.4s var(--ease);
  border-radius: 2px;
}

.nav__burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav__burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__burger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ─── MOBILE MENU ─── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.mobile-menu.open {
  pointer-events: all;
  visibility: visible;
}

.mobile-menu__bg {
  position: absolute;
  inset: 0;
  background: rgba(9,9,11,0.95);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.mobile-menu.open .mobile-menu__bg { opacity: 1; }

.mobile-menu__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 0 32px;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mobile-menu__link {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  padding: 12px 24px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

.mobile-menu__link:hover {
  color: var(--accent);
  background: rgba(232,135,61,0.06);
}

.mobile-menu.open .mobile-menu__link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.open .mobile-menu__link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open .mobile-menu__link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-menu__link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open .mobile-menu__link:nth-child(4) { transition-delay: 0.25s; }

.mobile-menu__cta {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.4s var(--ease);
  transition-delay: 0s;
  padding: 18px 48px;
  font-size: 1rem;
}

.mobile-menu.open .mobile-menu__cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.25;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 24px;
}

.hero__tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero__title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.hero__title span { display: block; }

.hero__em {
  font-style: normal;
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-light), #FFD4A8, var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 44px;
  line-height: 1.8;
}

.hero__cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero__scroll-line {
  width: 1px;
  height: 64px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  30% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  70% { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
  100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* ─── REVEAL ANIMATIONS ─── */
.anim-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.anim-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.anim-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── SECTIONS ─── */
.section { padding: 140px 0; }
.section--dark { background: var(--bg-elevated); }

.section__header { margin-bottom: 64px; }

.section__tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.section__title {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section__sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-top: 16px;
  line-height: 1.7;
}

/* ─── BENTO GRID ─── */
.bento {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.bento__card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 36px;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
  will-change: transform;
}

.bento__card--wide {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento__card:hover {
  border-color: rgba(232,135,61,0.25);
}

/* Glow that follows cursor */
.bento__glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  transform: translate(-50%, -50%);
}

.bento__card:hover .bento__glow { opacity: 1; }

.bento__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 24px;
}

.bento__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.bento__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

.bento__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.bento__tags span {
  padding: 5px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all 0.3s var(--ease);
}

.bento__card:hover .bento__tags span {
  border-color: var(--border-light);
  color: var(--text);
}

/* ─── MARQUEE / TECH STACK ─── */
.marquee-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 20px 0;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.marquee {
  overflow: hidden;
  width: 100%;
}

.marquee__track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
}

/* speed variants set via CSS custom properties, animated in JS */
.marquee__item {
  flex-shrink: 0;
  padding: 10px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.3s var(--ease);
}

.marquee__item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,135,61,0.06);
}

.marquee__item.accent {
  color: var(--text);
}

/* ─── PROCESS ─── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.process-step {
  position: relative;
  padding: 36px 28px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: background 0.4s var(--ease);
}

.process-step:hover { background: var(--bg-card); }

.process-step__bg {
  position: absolute;
  top: -10px; right: -10px;
  font-size: 8rem;
  font-weight: 800;
  color: var(--text);
  opacity: 0.02;
  line-height: 1;
  letter-spacing: -0.05em;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.process-step:hover .process-step__bg { opacity: 0.04; }

.process-step__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  display: block;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.process-step__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.process-step__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Stagger process steps */
.process-step:nth-child(1) { transition-delay: 0s; }
.process-step:nth-child(2) { transition-delay: 0.08s; }
.process-step:nth-child(3) { transition-delay: 0.16s; }
.process-step:nth-child(4) { transition-delay: 0.24s; }

/* ─── CONTACT FORM ─── */
.form { margin-top: 8px; }

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form__group {
  position: relative;
  margin-bottom: 20px;
}

.form__row .form__group { margin-bottom: 0; }

.form__group input,
.form__group textarea {
  width: 100%;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.3s var(--ease);
  outline: none;
}

.form__group textarea { resize: vertical; min-height: 130px; }

.form__group label {
  position: absolute;
  left: 20px; top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.3s var(--ease);
}

.form__group input:focus,
.form__group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232,135,61,0.08);
}

.form__group input:focus + label,
.form__group input:not(:placeholder-shown) + label,
.form__group textarea:focus + label,
.form__group textarea:not(:placeholder-shown) + label {
  top: -10px;
  left: 16px;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent);
}

.form__status {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  min-height: 24px;
}

.form__status--success { color: #4ade80; }
.form__status--error { color: #f87171; }

/* ─── FOOTER ─── */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

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

.footer__logo { height: 22px; width: auto; opacity: 0.4; }

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .bento { grid-template-columns: 1fr; }
  .bento__card--wide { grid-row: auto; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 100px 0; }
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav { padding: 18px 24px; }
  .nav--scrolled { padding: 14px 24px; }
}

@media (max-width: 600px) {
  .section { padding: 80px 0; }
  .process-grid { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: center; }
  .footer__inner { flex-direction: column; gap: 16px; text-align: center; }
  .bento__card { padding: 32px 24px; }
  .bento__title { font-size: 1.3rem; }
}
