/* ---------- Tokens ---------- */
:root{
  --bg: #f7f7f4;
  --surface: #ffffff;
  --accent: #2f5fdb;
  --accent-soft: #e9eefb;
  --text: #10182c;
  --text-dim: #5a6472;
  --line: rgba(16,24,44,0.1);

  --hero-bg-1: #0d1f4a;
  --hero-bg-2: #060c1a;
  --hero-text: #f2f5fa;
  --hero-text-dim: #9aa8c9;
  --hero-accent: #6d99ff;
  --hero-line: rgba(255,255,255,0.14);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --container: 1080px;
  --edge: clamp(24px, 6vw, 96px);
}

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

html{ scroll-behavior: smooth; }

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

a{ color: inherit; text-decoration: none; }
ol, ul{ list-style: none; }

.section-label{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

/* ---------- Circuit background decoration (hero only) ---------- */
.circuit{
  position: absolute;
  color: var(--hero-line);
  pointer-events: none;
  z-index: 0;
}
.circuit svg{ width:100%; height:100%; overflow: visible; }
.circuit--right{
  top: 200px;
  right: 40px;
  width: min(38vw, 380px);
  height: min(38vw, 380px);
}

.globe-3d,
.globe-3d canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
  filter: drop-shadow(0 0 40px rgba(76, 130, 255, 0.15));
}

/* ---------- Nav ---------- */
.nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--edge);
  color: var(--hero-text);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled{
  background: rgba(247,247,244,0.9);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.nav__mark{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
}
.nav__links{
  display: flex;
  align-items: center;
  gap: 2.2rem;
  font-size: 0.92rem;
  color: inherit;
  opacity: 0.85;
}
.nav__links a:hover{ opacity: 1; }
.nav__cta{
  opacity: 1 !important;
  border: 1px solid var(--hero-line);
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
}
.nav.is-scrolled .nav__cta{ border-color: var(--line); }
.nav__cta:hover{ border-color: var(--accent); color: var(--accent); }
.nav__toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span{
  width: 22px; height: 2px; background: var(--hero-accent); display:block; border-radius: 2px;
}

/* ---------- Layout helpers ---------- */
main > section:not(.hero){
  position: relative;
  z-index: 1;
  padding: 7.5rem var(--edge);
  max-width: calc(var(--container) + var(--edge) * 2);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.eyebrow{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-text-dim);
  margin-bottom: 1.6rem;
}

/* ---------- Hero (dark band, full-bleed) ---------- */
.hero{
  position: relative;
  width: 100%;
  background: radial-gradient(120% 100% at 15% 0%, var(--hero-bg-1) 0%, var(--hero-bg-2) 55%);
  color: var(--hero-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 130px 0 4rem;
  overflow: hidden;
}
.hero__inner{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--container) + var(--edge) * 2);
  margin: 0 auto;
  padding: 0 var(--edge);
}
.hero__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 14ch;
  position: relative;
}
.hero__desc{
  margin-top: 2rem;
  max-width: 46ch;
  font-size: 1.1rem;
  color: var(--hero-text-dim);
  position: relative;
}
.hero__actions{
  display: flex;
  gap: 1rem;
  margin-top: 2.8rem;
  flex-wrap: wrap;
  position: relative;
}
.btn{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 100px;
  display: inline-block;
  transition: all 0.2s ease;
}
.btn--primary{
  background: var(--hero-accent);
  color: #060c1a;
}
.btn--primary:hover{ background: #8bb0ff; }
.btn--ghost{
  border: 1px solid var(--hero-line);
  color: var(--hero-text);
}
.btn--ghost:hover{ border-color: var(--hero-accent); color: var(--hero-accent); }

/* ---------- Services (light) ---------- */
.services__list{ border-top: 1px solid var(--line); }
.service-row{
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.service-row h3{
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.service-row p{
  color: var(--text-dim);
  max-width: 52ch;
}

/* ---------- Work ---------- */
.project{
  padding: 2.6rem 0;
  border-top: 1px solid var(--line);
}
.project:last-child{ border-bottom: none; }
.project__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.project__head h3{
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.project__tag{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.project__desc{
  margin-top: 1.1rem;
  max-width: 68ch;
  color: var(--text-dim);
  font-size: 1.02rem;
}
.project__stack{
  margin-top: 1.3rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.project__stack span{
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text-dim);
  background: var(--surface);
}

/* ---------- Process ---------- */
.process__list{
  border-top: 1px solid var(--line);
}
.process__list li{
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
}
.process__num{
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.8;
}
.process__list h3{
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.process__list p{
  color: var(--text-dim);
  max-width: 56ch;
}

/* ---------- About ---------- */
.about__text{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.45;
  max-width: 34ch;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact{ border-bottom: none; padding-bottom: 5rem !important; }
.contact__title{
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 600;
  margin-bottom: 2.5rem;
  max-width: 16ch;
}
.contact__links{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
}
.contact__links a{
  width: fit-content;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact__links a:hover{
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Footer ---------- */
.footer{
  display: flex;
  justify-content: space-between;
  padding: 2rem var(--edge);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
  background: var(--bg);
}

/* ---------- Reveal on scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
  html{ scroll-behavior: auto; }
}

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px){
  .nav{ padding: 1.1rem var(--edge); }
  .nav__links{
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 78vw;
    max-width: 320px;
    background: var(--hero-bg-2);
    color: var(--hero-text);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem var(--edge);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav__links.is-open{ transform: translateX(0); }
  .nav__toggle{
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }

  .hero{ padding: 110px 0 3rem; min-height: auto; }
  .hero__title{ font-size: clamp(2.1rem, 9vw, 3rem); }
  .hero__desc{ font-size: 1rem; }
  .hero__actions .btn{ flex: 1 1 auto; text-align: center; }

  main > section:not(.hero){ padding: 4.5rem var(--edge); }

  .service-row{ grid-template-columns: 1fr; gap: 0.7rem; }
  .process__list li{ grid-template-columns: 40px 1fr; }
  .circuit--right{ display: none; }

  .project__head h3{ font-size: 1.4rem; }

  .footer{
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (max-width: 420px){
  .hero__actions{ flex-direction: column; }
  .hero__actions .btn{ width: 100%; }
  .contact__links{ font-size: 1rem; }
  .nav__mark{ font-size: 0.95rem; }
}
