/* ============================================================
   MaestroTech — deep ocean / turquoise signal aesthetic
   ============================================================ */

:root {
  --bg:        #081b2f;
  --bg-2:      #0d263f;
  --surface:   #12314d;
  --surface-2: #163d5d;
  --line:      #285574;
  --line-2:    #3a7190;

  --text:      #eef9ff;
  --muted:     #9ab8c8;
  --dim:       #6f8ea1;

  --signal:    #42d9e8;
  --signal-dim:#32aebd;
  --signal-glow: rgba(66, 217, 232, 0.32);
  --amber:     #ff9f7a;

  --font-display: "Bricolage Grotesque", "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(66, 217, 232, 0.16), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(255, 159, 122, 0.12), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(48, 93, 180, 0.18), transparent 42%),
    linear-gradient(145deg, #081b2f 0%, #102b48 48%, #173b55 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

::selection { background: var(--signal); color: #032527; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

/* ---------------- texture overlays ---------------- */
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.5;
}
.noise-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scanline {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.35;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(5, 20, 38, 0.14) 3px 4px);
}

/* keep content above overlays */
.nav, main, .footer { position: relative; z-index: 5; }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 52px);
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 27, 47, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: 12px; padding-bottom: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand-mark { color: var(--signal); display: grid; place-items: center; filter: drop-shadow(0 0 6px var(--signal-glow)); }
.brand-pulse { stroke-dasharray: 60; stroke-dashoffset: 0; }
.brand-accent { color: var(--signal); }
.brand-word { color: var(--text); }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav-links a { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--line-2); color: var(--text) !important;
  padding: 8px 16px; border-radius: 2px; transition: all .25s var(--ease) !important;
}
.nav-cta:hover { border-color: var(--signal); background: var(--signal); color: #032527 !important; box-shadow: 0 0 24px var(--signal-glow); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); width: 42px; height: 38px; border-radius: 2px; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-toggle span { width: 18px; height: 2px; background: var(--text); transition: .25s; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
  padding: 14px 24px; border-radius: 2px; cursor: pointer;
  transition: all .28s var(--ease); border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.btn span { transition: transform .28s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-primary { background: var(--signal); color: #032527; box-shadow: 0 0 0 var(--signal-glow); }
.btn-primary:hover { box-shadow: 0 0 30px var(--signal-glow); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(20px, 5vw, 52px) 60px;
  max-width: var(--maxw); margin: 0 auto;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.9; }
.hero-inner { position: relative; z-index: 3; max-width: 920px; }

.kicker {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--signal); text-transform: lowercase; margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 0.98; letter-spacing: -0.03em;
  margin-bottom: 30px;
}
.hero-title .line { display: block; }
.hero-title em { font-style: italic; color: var(--signal); font-weight: 600; }

.hero-sub { max-width: 600px; font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--muted); margin-bottom: 38px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 64px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px); border-top: 1px solid var(--line); padding-top: 28px; }
.hero-stats > div { display: flex; align-items: baseline; gap: 14px; }
.hero-stats dt { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: var(--signal); line-height: 1; letter-spacing: -0.02em; }
.hero-stats dd { font-size: 0.82rem; color: var(--text); line-height: 1.35; }
.hero-stats dd span { color: var(--dim); font-family: var(--font-mono); font-size: 0.72rem; }

.hero-foot {
  position: relative; z-index: 3; max-width: var(--maxw); margin: 40px auto 0;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--dim);
  display: flex; align-items: center; gap: 10px;
}
.blip { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); animation: blip 1.6s infinite; }
@keyframes blip { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }

/* ---------------- marquee ---------------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; align-items: center; gap: 28px; white-space: nowrap; width: max-content; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; color: var(--text); }
.marquee-track .dot { color: var(--signal); font-size: 0.7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- sections ---------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vw, 150px) clamp(20px, 5vw, 52px); }
.section-alt { max-width: none; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section-head { max-width: 760px; margin-bottom: clamp(48px, 7vw, 84px); }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.025em; margin: 16px 0 22px; }
.section-lead { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 620px; }
.section-lead strong { color: var(--text); }

/* ---------------- service cards ---------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  background: var(--surface); padding: 38px 30px 32px; position: relative;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.card:hover { background: var(--surface-2); }
.card-no { font-family: var(--font-mono); font-size: 0.72rem; color: var(--signal-dim); letter-spacing: 0.05em; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.42rem; margin: 16px 0 12px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }
.card .tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.card .tags li { font-family: var(--font-mono); font-size: 0.7rem; color: var(--dim); border: 1px solid var(--line-2); padding: 4px 9px; border-radius: 2px; }
.card::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--signal); transition: width .35s var(--ease); box-shadow: 0 0 14px var(--signal-glow); }
.card:hover::after { width: 100%; }

/* ---------------- stack grid ---------------- */
.stack-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stack-col { background: var(--surface); padding: 28px 22px; }
.stack-col h4 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--signal); margin-bottom: 16px; }
.stack-col ul { list-style: none; }
.stack-col li { font-size: 0.9rem; color: var(--text); padding: 7px 0; border-top: 1px solid var(--line); }
.stack-col li:first-child { border-top: none; }

/* ---------------- why grid ---------------- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.why-item { background: var(--bg-2); padding: 40px 34px; transition: background .3s; }
.why-item:hover { background: var(--surface); }
.why-item h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: 12px; letter-spacing: -0.01em; }
.why-item h3::before { content: "◆ "; color: var(--amber); font-size: 0.8em; }
.why-item p { color: var(--muted); }

/* ---------------- steps ---------------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; }
.step { position: relative; padding-top: 28px; border-top: 2px solid var(--line); }
.step-no { font-family: var(--font-mono); font-size: 0.8rem; color: var(--signal); }
.step h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 14px 0 10px; }
.step p { color: var(--muted); font-size: 0.92rem; }
.step::before { content: ""; position: absolute; top: -2px; left: 0; width: 36px; height: 2px; background: var(--signal); box-shadow: 0 0 12px var(--signal-glow); }

/* ---------------- contact ---------------- */
.contact { max-width: 760px; }
.contact-inner { text-align: center; }
.contact-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -0.03em; margin: 16px 0 22px; }
.contact-lead { color: var(--muted); max-width: 520px; margin: 0 auto 44px; font-size: 1.1rem; }

.contact-actions { display: flex; justify-content: center; }
.contact-alt { margin-top: 30px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--dim); }
.contact-alt a { color: var(--signal); border-bottom: 1px solid var(--signal-dim); }

/* ---------------- footer ---------------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px clamp(20px, 5vw, 52px) 30px; }
.footer-top { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.footer-tag { color: var(--muted); max-width: 360px; font-size: 0.92rem; }
.footer-bottom { max-width: var(--maxw); margin: 24px auto 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--dim); }

/* ---------------- reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-duration: .8s; }
.hero-title .line { opacity: 0; transform: translateY(28px); animation: rise .9s var(--ease) forwards; }
.hero-title .line:nth-child(1) { animation-delay: .15s; }
.hero-title .line:nth-child(2) { animation-delay: .28s; }
.hero-title .line:nth-child(3) { animation-delay: .41s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* stagger groups */
.cards .reveal:nth-child(2){transition-delay:.06s}
.cards .reveal:nth-child(3){transition-delay:.12s}
.cards .reveal:nth-child(4){transition-delay:.18s}
.cards .reveal:nth-child(5){transition-delay:.24s}
.cards .reveal:nth-child(6){transition-delay:.30s}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 940px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(8,27,47,0.97); backdrop-filter: blur(14px);
    padding: 24px clamp(20px,5vw,52px) 30px; border-bottom: 1px solid var(--line);
  }
  .nav-toggle { display: flex; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }
  .cards, .why-grid, .steps { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 24px; }
  .hero-stats > div { width: 100%; }
}
