/* ============================================================
   Mtandao Labs - style.css
   Dark network-language agency site. One accent: teal.
   Shape system: cards 6px / buttons pill / hairlines 1px.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #090c12;
  --bg-soft: #0d121a;
  --panel: #0f151e;
  --panel-2: #131a25;
  --hairline: rgba(148, 163, 184, 0.14);
  --text: #e8edf2;
  --text-muted: #93a1ad;
  --text-dim: #5c6b78;
  --accent: #7c5cff;
  --accent-ink: #10092b;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --radius-card: 6px;
  --radius-btn: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 68px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }
.mono { font-family: var(--font-mono); }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Background layers ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 650px at 85% -10%, rgba(124, 92, 255, 0.16), transparent 62%),
    radial-gradient(900px 550px at -10% 30%, rgba(124, 92, 255, 0.09), transparent 55%),
    radial-gradient(700px 500px at 110% 75%, rgba(34, 211, 238, 0.06), transparent 60%),
    var(--bg);
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}
.bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 340px at 50% 0%, rgba(124, 92, 255, 0.14), transparent 70%);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: #0a0e15;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.35s var(--ease);
}
.nav.scrolled {
  background: #0a0e15;
  border-bottom-color: var(--hairline);
}
.nav.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark { color: var(--text); flex: none; width: 26px; height: 26px; }
.logo-text {
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-accent { color: var(--accent); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a { color: var(--text-muted); transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 28px 60px;
  overflow: hidden;
}
.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}
.hero-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 30px;
}
.hero-tag {
  color: var(--accent);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius-btn);
  padding: 5px 14px;
  letter-spacing: 0.14em;
  background: var(--accent-soft);
}
.hero-loc { color: var(--text-dim); }

.hero-title {
  font-size: clamp(2.7rem, 7.2vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 14ch;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
}
.hero-title .word.accent { color: var(--accent); }

.hero-sub {
  margin-top: 28px;
  max-width: 52ch;
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-cta {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 15px 30px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
  will-change: transform;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.4), 0 10px 30px -12px rgba(124, 92, 255, 0.5);
}
.btn-primary:hover { background: #9b8cff; box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.6), 0 14px 34px -12px rgba(124, 92, 255, 0.6); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--hairline);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--text-muted); background: rgba(148, 163, 184, 0.06); }
.btn-phone { font-family: var(--font-mono); font-size: 0.92rem; letter-spacing: 0.02em; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 18px 0;
  overflow: hidden;
  background: rgba(13, 18, 26, 0.6);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-group {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.mq-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
  flex: none;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 110px 28px;
}
.section-alt {
  max-width: none;
  margin: 0;
  background: linear-gradient(180deg, rgba(13, 18, 26, 0.5), rgba(9, 12, 18, 0.4));
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.section-alt .container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}
.section-head {
  margin-bottom: 56px;
}
.section-title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.section-sub {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- Work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 28px;
}
.work-card {
  grid-column: span 4;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.4);
}
.work-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  background: var(--panel-2);
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.work-card:hover .work-media img { transform: scale(1.045); }
.work-info {
  padding: 22px 24px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.work-info h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }
.work-info p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.work-year {
  flex: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius-btn);
  padding: 5px 12px;
  align-self: flex-start;
}

/* ---------- Services ---------- */
.services-list {
  border-top: 1px solid var(--hairline);
}
.service-row {
  display: grid;
  grid-template-columns: 72px 1.1fr 1.4fr auto;
  align-items: baseline;
  gap: 26px;
  padding: 34px 4px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.service-row:hover {
  background: rgba(124, 92, 255, 0.03);
  padding-left: 14px;
}
.service-num { color: var(--text-dim); font-size: 0.85rem; }
.service-body h3 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; }
.service-body p { color: var(--text-muted); font-size: 0.98rem; max-width: 44ch; margin-top: 6px; line-height: 1.6; }
.service-tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-btn);
  padding: 4px 11px;
  text-transform: uppercase;
  justify-self: end;
  white-space: nowrap;
}

/* ---------- Steps (how it works) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  position: relative;
}
.step {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--panel);
  padding: 30px 26px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
  position: relative;
}
.step:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 92, 255, 0.4);
}
.step-num {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}
.step h3 {
  margin-top: 14px;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.step p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ---------- Contact (lead-gen) ---------- */
.section-contact { padding-bottom: 130px; }
.contact-card {
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: var(--radius-card);
  background:
    radial-gradient(600px 300px at 85% 0%, rgba(124, 92, 255, 0.1), transparent 65%),
    var(--panel);
  padding: 60px 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-tag { color: var(--accent); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.contact-title {
  margin-top: 18px;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.contact-sub {
  margin-top: 16px;
  color: var(--text-muted);
  max-width: 40ch;
  font-size: 1rem;
  line-height: 1.6;
}
.contact-channels {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.channel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.channel:hover {
  border-color: rgba(124, 92, 255, 0.5);
  transform: translateX(4px);
}
.channel-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.channel-value {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Lead form ---------- */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: rgba(9, 12, 18, 0.6);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  padding: 12px 14px;
  transition: border-color 0.3s var(--ease);
  appearance: none;
}
.form-row select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393a1ad' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}
.form-row textarea { resize: vertical; min-height: 84px; }
.btn-block { width: 100%; justify-content: center; margin-top: 4px; }
.form-note {
  color: var(--text-dim);
  font-size: 0.74rem;
  text-align: center;
  letter-spacing: 0.06em;
  min-height: 1em;
}
.form-note.ok { color: var(--accent); }
.form-note.err { color: #f87171; }

/* ---------- Sticky mobile call bar ---------- */
.call-bar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #06121a;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
  transition: transform 0.3s var(--ease);
}
.call-bar:hover { transform: translateY(-2px); }
.call-bar-icon { font-size: 1.05rem; }
.call-bar-phone { margin-left: auto; font-family: var(--font-mono); font-size: 0.85rem; opacity: 0.85; }

/* ---------- Work CTA ---------- */
.work-cta {
  margin-top: 34px;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}
.work-cta a { color: var(--accent); border-bottom: 1px solid rgba(124, 92, 255, 0.4); }
.work-cta a:hover { border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 44px 28px;
  background: rgba(9, 12, 18, 0.7);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  align-items: center;
  gap: 30px;
}
.footer-brand .logo-text { font-size: 1.15rem; }
.footer-brand p {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 34ch;
}
.footer-links {
  display: flex;
  gap: 26px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-links a { color: var(--text-muted); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.footer-contact a { color: var(--text-muted); transition: color 0.2s var(--ease); }
.footer-contact a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Reveal (JS toggles) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
  .service-row { grid-template-columns: 56px 1fr; }
  .service-tag { grid-column: 2; justify-self: start; }
}

@media (max-width: 900px) {
  .work-card { grid-column: span 12; }
  .work-grid { grid-template-columns: 1fr; gap: 22px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-card { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .footer-contact { flex-direction: row; gap: 18px; align-items: center; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 28px 28px;
    background: #0a0e15;
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 1.05rem; padding: 8px 0; }
  .nav-cta { margin-top: 8px; }
  .nav-toggle { display: flex; }

  .hero { padding-left: 20px; padding-right: 20px; }
  .hero-title { font-size: clamp(2.1rem, 11vw, 2.8rem); }
  .hero-sub { font-size: 1rem; }
  .section { padding: 72px 20px; }
  .service-row { grid-template-columns: 40px 1fr; gap: 12px; padding: 24px 2px; }
  .service-body h3 { font-size: 1.25rem; }
  .service-name { font-size: 1.25rem; }
  .steps { grid-template-columns: 1fr; }
  .work-info { padding: 18px 18px 20px; }
  .contact-card { padding: 36px 22px; }
  .hero-cta .btn { width: 100%; }
  .call-bar { display: flex; }
  .footer { padding: 40px 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-title .word { transform: none; }
  .work-card, .step, .service-row { transition: none; }
  .work-card:hover { transform: none; }
  .step:hover { transform: none; }
  .btn, .btn:hover { transition: none; }
}
