/* =========================================================
   NyveCode — design tokens
   ========================================================= */
:root{
  --ink:        #030611;
  --ink-2:      #0b0f1c;
  --ink-3:      #111627;
  --line:       rgba(255,255,255,0.09);
  --line-soft:  rgba(255,255,255,0.05);
  --white:      #f6f7fb;
  --mist:       #8991ab;
  --mist-dim:   #5c6377;
  --blue:       #4f6ff7;
  --violet:     #8457f0;
  --grad:       linear-gradient(100deg, var(--blue) 0%, var(--violet) 100%);
  --ok:         #3ddc97;

  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;

  --fs-hero: clamp(2.3rem, 1.2rem + 4.6vw, 4rem);
  --fs-h2:   clamp(1.7rem, 1.1rem + 2.3vw, 2.6rem);
  --fs-h3:   1.25rem;

  --maxw: 1180px;
  --pad:  clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(.22,.68,0,1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display:block; }
a{ color: inherit; text-decoration: none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,p{ margin:0; }
button, input, textarea, select{ font-family: inherit; color: inherit; }

::selection{ background: var(--violet); color: var(--white); }

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

.grad{
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* faint blueprint grid + noise, sits behind everything */
.grain{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.6;
}

main, header, footer{ position: relative; z-index: 1; }

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

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal{ opacity: 1; transform: none; transition: none; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   Eyebrow / labels
   ========================================================= */
.eyebrow{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.85rem;
}

/* =========================================================
   Nav
   ========================================================= */
.nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(3,6,17,0);
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s var(--ease);
}
.nav.is-scrolled{
  background: rgba(3,6,17,0.82);
  border-bottom-color: var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav__inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand{
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand__mark{
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: 50% 38%;
  border-radius: 8px;
}
.brand__word{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--white);
}
.nav__links{
  display: flex;
  align-items: center;
  gap: 1.9rem;
}
.nav__links a{
  font-size: 0.92rem;
  color: var(--mist);
  transition: color .2s var(--ease);
}
.nav__links a:hover{ color: var(--white); }
.nav__cta{
  font-family: var(--font-mono);
  font-size: 0.8rem !important;
  color: var(--white) !important;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.nav__cta:hover{ border-color: var(--blue); background: rgba(79,111,247,0.08); }

.nav__toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav__toggle span{
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn--primary{
  background: var(--grad);
  color: var(--white);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset, 0 8px 24px -12px rgba(79,111,247,0.55);
}
.btn--primary:hover{ transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 12px 28px -10px rgba(132,87,240,0.6); }
.btn--ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--white);
}
.btn--ghost:hover{ border-color: var(--blue); background: rgba(79,111,247,0.06); }

/* =========================================================
   Hero
   ========================================================= */
.hero{
  position: relative;
  padding: clamp(7.5rem,10vw,9.5rem) var(--pad) clamp(4rem,8vw,6rem);
  overflow: hidden;
}
.hero__bg{
  position: absolute;
  top: -10%; right: -10%;
  width: 60%; height: 70%;
  background: radial-gradient(circle, rgba(79,111,247,0.16) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner{
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
.hero__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 1.35rem;
}
.hero__sub{
  color: var(--mist);
  font-size: 1.08rem;
  max-width: 40em;
  margin-bottom: 2rem;
}
.hero__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}
.hero__trust{
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mist-dim);
}
.hero__trust .dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61,220,151,0.15);
  flex-shrink: 0;
}

/* =========================================================
   Terminal panel (signature element)
   ========================================================= */
.terminal{
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7);
}
.terminal__bar{
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--ink-3);
}
.terminal__dot{ width: 9px; height: 9px; border-radius: 50%; background: var(--mist-dim); opacity: 0.6; }
.terminal__dot--r{ background: #ef5a5a; opacity: .8;}
.terminal__dot--y{ background: #eab55a; opacity: .8;}
.terminal__dot--g{ background: #3ddc97; opacity: .8;}
.terminal__title{
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mist-dim);
}
.terminal__body{
  padding: 1.3rem 1.2rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}
.terminal__body--code{ font-size: 0.8rem; }
.tline{ white-space: pre-wrap; word-break: break-word; opacity: 0; animation: tline-in .5s var(--ease) forwards; }
.tline:nth-child(1){ animation-delay: .15s; }
.tline:nth-child(2){ animation-delay: .45s; }
.tline:nth-child(3){ animation-delay: .68s; }
.tline:nth-child(4){ animation-delay: .91s; }
.tline:nth-child(5){ animation-delay: 1.1s; }
.tline:nth-child(6){ animation-delay: 1.28s; }
.tline:nth-child(7){ animation-delay: 1.42s; }
.tline:nth-child(8){ animation-delay: 1.56s; }
.tline:nth-child(9){ animation-delay: 1.7s; }
@keyframes tline-in{
  from{ opacity: 0; transform: translateY(3px); }
  to{ opacity: 1; transform: translateY(0); }
}
.prompt{ color: var(--blue); margin-right: 0.4em; }
.mut{ color: var(--mist-dim); }
.t-mut{ color: var(--mist-dim); }
.tag{
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.08em 0.5em;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag--ok{ background: rgba(61,220,151,0.14); color: var(--ok); margin-right: 0.5em; }
.tag--live{ background: rgba(79,111,247,0.16); color: #9db2ff; margin-left: 0.5em; }
.cursor{ animation: blink 1s steps(1) infinite; color: var(--blue); }
@keyframes blink{ 50%{ opacity: 0; } }

.code-kw{ color: #c792ea; }
.code-cls{ color: #82aaff; }
.code-fn{ color: #89ddff; }
.code-cm{ color: var(--mist-dim); }

/* =========================================================
   Sections (generic)
   ========================================================= */
.section{ padding: clamp(4.5rem,8vw,7rem) var(--pad); }
.section--alt{ background: var(--ink-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section__inner{ max-width: var(--maxw); margin: 0 auto; }
.section__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 18em;
  margin-bottom: 1.1rem;
}
.section__lead{
  color: var(--mist);
  max-width: 40em;
  font-size: 1.05rem;
}
.section__inner--split{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem,5vw,4rem);
  align-items: center;
}

/* =========================================================
   Pillars
   ========================================================= */
.pillars{
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.pillar{
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.pillar:hover{ border-color: rgba(79,111,247,0.4); transform: translateY(-3px); }
.pillar__tag{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist-dim);
  margin-bottom: 0.9rem;
}
.pillar h3{
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.pillar p{ color: var(--mist); font-size: 0.94rem; }

/* =========================================================
   Products
   ========================================================= */
.products{
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.product{
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.product:hover{ border-color: rgba(132,87,240,0.4); transform: translateY(-3px); }
.product__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.product__kicker{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}
.product__name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.product__desc{ color: var(--mist); font-size: 0.94rem; margin-bottom: 1.1rem; }
.product__meta{ display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.4rem; }
.product__meta li{
  font-size: 0.85rem;
  color: var(--mist);
  padding-left: 1.1rem;
  position: relative;
}
.product__meta li::before{
  content: '';
  position: absolute;
  left: 0; top: 0.5em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--grad);
}
.product__link{
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--white);
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  transition: color .2s var(--ease);
}
.product__link:hover{ color: var(--blue); }

/* =========================================================
   Pipeline
   ========================================================= */
.pipeline{
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.pstep{
  position: relative;
  padding: 1.5rem 1.3rem 0 0;
  border-top: 2px solid var(--line);
}
.pstep::before{
  content: '';
  position: absolute;
  top: -6px; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad);
}
.pstep__label{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.7rem;
}
.pstep__text{ color: var(--mist); font-size: 0.88rem; }

/* =========================================================
   AI points
   ========================================================= */
.ai-points{ margin-top: 2.2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.ai-point__title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}
.ai-point p{ color: var(--mist); font-size: 0.95rem; }
.terminal--small{ max-width: 460px; }

/* =========================================================
   Contact
   ========================================================= */
.cta-section{ position: relative; }
.contact{
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.contact__direct{ display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.contact__direct .btn{ width: 100%; max-width: 320px; }
.contact__email{ font-size: 0.9rem; color: var(--mist); margin-top: 0.4rem; }
.contact__email a{ color: var(--white); border-bottom: 1px solid var(--line); }
.contact__email a:hover{ color: var(--blue); border-color: var(--blue); }

.contact__form{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.form__row{ display: flex; flex-direction: column; gap: 0.45rem; }
.form__row label{
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--mist-dim);
}
.form__row input,
.form__row select,
.form__row textarea{
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color .2s var(--ease);
}
.form__row input:focus,
.form__row select:focus,
.form__row textarea:focus{ border-color: var(--blue); outline: none; }
.form__submit{ align-self: flex-start; }
.form__note{
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ok);
  min-height: 1.2em;
}

/* =========================================================
   Footer
   ========================================================= */
.footer{ border-top: 1px solid var(--line-soft); padding: 3rem var(--pad) 2.5rem; }
.footer__inner{
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand--footer{ flex-shrink: 0; }
.footer__tag{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mist-dim);
  letter-spacing: 0.03em;
}
.footer__links{ display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer__links a{ font-size: 0.88rem; color: var(--mist); transition: color .2s var(--ease); }
.footer__links a:hover{ color: var(--white); }
.footer__copy{ width: 100%; font-size: 0.8rem; color: var(--mist-dim); text-align: center; margin-top: 1rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .hero__inner{ grid-template-columns: 1fr; }
  .section__inner--split{ grid-template-columns: 1fr; }
  .pillars{ grid-template-columns: 1fr; }
  .products{ grid-template-columns: 1fr; }
  .pipeline{ grid-template-columns: 1fr; gap: 1.6rem; }
  .pstep{ padding-top: 1.1rem; }
  .contact{ grid-template-columns: 1fr; }
  .terminal--small{ max-width: none; }
}

@media (max-width: 760px){
  .nav__links{
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--ink-2);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform .3s var(--ease);
  }
  .nav__links.is-open{ transform: translateX(0); }
  .nav__toggle{ display: flex; }
  .nav__toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2){ opacity: 0; }
  .nav__toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
  .nav__cta{ margin-top: 0.5rem; }
}
