/* ============================================================
   Titanetix — design tokens
   Palette derived from the logo: electric-blue circuit traces
   on deep navy.
   ============================================================ */
:root {
  --bg:        #080b12;
  --bg-2:      #0c111b;
  --surface:   #10161f;
  --surface-2: #131b27;
  --line:      #1c2534;
  --line-2:    #263248;

  --text:      #e7edf5;
  --muted:     #97a6bd;
  --faint:     #64748b;

  --blue:      #3b9dff;
  --blue-hi:   #6fc4ff;
  --blue-deep: #1b6fe0;
  --cyan:      #7ddcff;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1120px;
  --radius: 14px;
  --pad-section: 104px;
}

/* ============================================================
   Reset & base
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: 90%; max-width: var(--maxw); margin: 0 auto; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--blue);
  color: #06101f;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 200;
}
.skip-link:focus { left: 16px; }

/* ============================================================
   Shared type devices
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue-hi);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow .node {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(125,220,255,.12);
  position: relative;
}
.eyebrow .node::before {
  content: "";
  position: absolute;
  right: 100%; top: 50%;
  width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-deep));
  margin-right: 8px;
}

.section-head { margin-bottom: 48px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}

.section { padding: var(--pad-section) 0; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  position: relative;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(59,157,255,.1);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .9rem;
  letter-spacing: .02em;
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-hi), var(--blue-deep));
  color: #05101f;
  font-weight: 600;
  box-shadow: 0 8px 26px -12px rgba(59,157,255,.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(59,157,255,.85); }
.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: rgba(255,255,255,.02);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-hi); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,11,18,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { width: 40px; height: 40px; border-radius: 9px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
  transition: color .2s ease;
}
.nav a:hover { color: var(--text); }
.nav a.btn-ghost { color: var(--text); padding: 9px 18px; }
.nav a.btn-ghost:hover { color: var(--blue-hi); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s 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;
  padding: clamp(90px, 15vh, 160px) 0 clamp(90px, 14vh, 150px);
  background:
    radial-gradient(1000px 500px at 72% -10%, rgba(27,111,224,.22), transparent 60%),
    radial-gradient(700px 400px at 10% 20%, rgba(125,220,255,.08), transparent 55%),
    var(--bg);
  overflow: hidden;
}
.hero-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
  pointer-events: none;
}
.trace-static { opacity: .16; }
.trace-pulse {
  opacity: .9;
  filter: drop-shadow(0 0 6px rgba(125,220,255,.7));
}
.trace-pulse path { stroke-dasharray: 0 100000; } /* hidden until JS drives it */
.trace-nodes circle { filter: drop-shadow(0 0 5px rgba(125,220,255,.7)); }
.trace-nodes circle.flash { animation: node-flash .7s ease-out; }
@keyframes node-flash {
  0%   { r: 4;   fill: #7ddcff; filter: drop-shadow(0 0 5px rgba(125,220,255,.7)); }
  22%  { r: 9;   fill: #f2fbff; filter: drop-shadow(0 0 20px rgba(180,240,255,1)); }
  100% { r: 4;   fill: #7ddcff; filter: drop-shadow(0 0 5px rgba(125,220,255,.7)); }
}

.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.2vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin-bottom: 22px;
}
.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ============================================================
   Services
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.service-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity .25s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 22px 40px -26px rgba(0,0,0,.9);
}
.service-card:hover::before { opacity: 1; }

.service-icon {
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--blue-hi);
  background: rgba(59,157,255,.1);
  border: 1px solid rgba(59,157,255,.2);
  margin-bottom: 18px;
}
.service-icon svg { width: 24px; height: 24px; }
.service-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.service-card p { color: var(--muted); font-size: .96rem; }

.is-soon h3, .is-soon .service-icon { opacity: .82; }
.tag {
  position: absolute;
  top: 18px; right: 18px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(125,220,255,.08);
  border: 1px solid rgba(125,220,255,.2);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-copy p { color: var(--muted); font-size: 1.05rem; }
.stack {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stack li {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--blue);
  padding: 12px 14px;
  border-radius: 8px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact { text-align: center; }
.contact-inner { max-width: 640px; margin: 0 auto; }
.contact .eyebrow { justify-content: center; }
.contact .section-title { margin-bottom: 18px; }
.contact-lead { color: var(--muted); margin-bottom: 30px; }
.contact-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--faint);
  margin-top: 22px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  background: var(--bg-2);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--faint);
}
.footer-brand { color: var(--text); font-family: var(--font-display); font-size: 1rem; }
.footer-loc { color: var(--muted); }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--blue-hi); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  :root { --pad-section: 72px; }

  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 69px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 5%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  }
  .nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
  }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .nav a.btn-ghost { border: 1px solid var(--line-2); margin: 10px 0; text-align: center; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trace-pulse { opacity: 0; }
  .trace-nodes circle.flash { animation: none; }
  * { transition: none !important; }
}
