/* =========================================================
   PILGRIM AI — Stylesheet
   Palette sourced from the brand mark (hex circuit gradient)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;600;700&family=Manrope:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root{
  /* ---- surfaces ---- */
  --void:        #050911;   /* page background — deep space */
  --void-soft:   #080d18;   /* secondary background band */
  --panel:       #0c1322;   /* card / panel surface */
  --panel-edge:  rgba(125, 211, 247, 0.14);
  --panel-edge-strong: rgba(125, 211, 247, 0.32);

  /* ---- ink ---- */
  --ink:         #f3f7fb;   /* primary heading / body white */
  --ink-dim:     #b7c2d6;   /* secondary body */
  --ink-mute:    #6c7790;   /* labels, captions */

  /* ---- brand blue gradient, sampled from the logo ---- */
  --blue-pale:   #b7e8fa;
  --blue-glow:   #5fd3f7;
  --blue-mid:    #2ba3de;
  --blue-deep:   #11608f;
  --blue-abyss:  #04162e;

  --gradient-accent: linear-gradient(120deg, var(--blue-pale) 0%, var(--blue-glow) 28%, var(--blue-mid) 62%, var(--blue-deep) 100%);
  --gradient-thin:    linear-gradient(90deg, transparent, var(--blue-glow), transparent);

  /* ---- type ---- */
  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Manrope', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* ---- rhythm ---- */
  --edge: 1px solid var(--panel-edge);
  --radius: 14px;
  --max: 1180px;
  --section-pad: clamp(72px, 11vw, 140px);

  --ease: cubic-bezier(.16,.84,.32,1);
}

/* =========================================================
   RESET
   ========================================================= */
*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--void);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4,p{ margin:0; }
button{ font-family:inherit; cursor:pointer; }
:focus-visible{ outline:2px solid var(--blue-glow); outline-offset:3px; border-radius:4px; }

.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 28px;
}

/* =========================================================
   BACKGROUND — deep space photography + constellation canvas
   ========================================================= */
.cosmos{
  position:fixed;
  inset:0;
  z-index:-1;
  overflow:hidden;
  pointer-events:none;
  background:var(--void);
}
.cosmos-stars,
.cosmos-nebula{
  position:absolute;
  inset:-6%;
  background-repeat:no-repeat;
  background-size:cover;
  will-change:transform;
}
.cosmos-stars{
  background-image:
    linear-gradient(180deg, rgba(5,9,17,.72) 0%, rgba(5,9,17,.52) 35%, rgba(5,9,17,.86) 100%),
    url('https://images.unsplash.com/photo-1524334228333-0f6db392f8a1?auto=format&fit=crop&w=2400&q=70');
  background-position:center;
  filter:saturate(1.05) brightness(.85);
  animation:cosmosDriftSlow 130s linear infinite alternate;
}
.cosmos-nebula{
  background-image:
    radial-gradient(ellipse 70% 60% at 72% 28%, rgba(5,9,17,0) 0%, rgba(5,9,17,.55) 62%, rgba(5,9,17,.97) 100%),
    var(--nebula-img, url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?auto=format&fit=crop&w=2400&q=70'));
  background-position:75% 20%;
  mix-blend-mode:screen;
  opacity:.4;
  filter:saturate(1.1) hue-rotate(2deg);
  animation:cosmosDriftFast 90s ease-in-out infinite alternate;
}
@keyframes cosmosDriftSlow{
  0%{ transform:scale(1.04) translate(0,0); }
  100%{ transform:scale(1.12) translate(-1.5%,1%); }
}
@keyframes cosmosDriftFast{
  0%{ transform:scale(1.08) translate(0,0); }
  100%{ transform:scale(1.18) translate(-3%,2.5%); }
}
#field{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
}
.void-vignette{
  position:fixed;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    radial-gradient(ellipse 900px 600px at 50% -10%, rgba(43,163,222,0.16), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 100%, rgba(17,96,143,0.12), transparent 60%),
    linear-gradient(180deg, rgba(5,9,17,.18) 0%, rgba(5,9,17,0) 18%, rgba(5,9,17,0) 70%, rgba(5,9,17,.55) 100%);
}

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

/* =========================================================
   TYPE SCALE
   ========================================================= */
.eyebrow{
  font-family:var(--font-mono);
  font-size:12.5px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--blue-glow);
  display:flex;
  align-items:center;
  gap:10px;
}
.eyebrow::before{
  content:'';
  width:7px; height:7px;
  border-radius:50%;
  background:var(--blue-glow);
  box-shadow:0 0 10px 2px rgba(95,211,247,.7);
  flex:none;
}

h1, .h1{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(40px, 6.4vw, 84px);
  line-height:1.04;
  letter-spacing:-.01em;
  color:var(--ink);
}
h2, .h2{
  font-family:var(--font-display);
  font-weight:600;
  font-size:clamp(30px, 4vw, 48px);
  line-height:1.12;
  letter-spacing:-.01em;
  color:var(--ink);
}
h3, .h3{
  font-family:var(--font-display);
  font-weight:600;
  font-size:clamp(20px, 2.2vw, 25px);
  line-height:1.3;
  color:var(--ink);
}
.lede{
  font-size:clamp(17px, 1.6vw, 20px);
  line-height:1.65;
  color:var(--ink-dim);
  max-width:640px;
}
.body-text{
  font-size:16.5px;
  color:var(--ink-dim);
  max-width:620px;
}
.gradient-text{
  background-image:var(--gradient-accent);
  background-size:200% auto;
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  animation:shimmer 7s ease-in-out infinite;
}
@keyframes shimmer{
  0%,100%{ background-position:0% 50%; }
  50%{ background-position:100% 50%; }
}

/* =========================================================
   KINETIC HEADLINE (word-by-word reveal)
   ========================================================= */
.kinetic{ overflow:visible; }
.kinetic .word{
  display:inline-block;
  opacity:0;
  filter:blur(6px);
  transform:translateY(.35em);
  animation:wordIn .9s var(--ease) forwards;
}
@keyframes wordIn{
  to{ opacity:1; filter:blur(0); transform:translateY(0); }
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal{
  opacity:0;
  transform:translateY(26px);
  transition:opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible{ opacity:1; transform:translateY(0); }
.reveal-delay-1{ transition-delay:.08s; }
.reveal-delay-2{ transition-delay:.16s; }
.reveal-delay-3{ transition-delay:.24s; }
.reveal-delay-4{ transition-delay:.32s; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:50;
  padding:20px 0;
  transition:background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
  border-bottom:1px solid transparent;
}
.site-header.is-scrolled{
  background:rgba(5,9,17,0.78);
  backdrop-filter:blur(14px);
  border-bottom-color:var(--panel-edge);
  padding:14px 0;
}
.site-header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:17px;
  letter-spacing:.01em;
  color:var(--ink);
  flex:none;
}
.brand img{ height:75px; width:75px; object-fit:contain; }
.brand .ai{ color:var(--blue-glow); }

.nav-links{
  display:flex;
  align-items:center;
  gap:34px;
}
.nav-links .btn{
  margin-left:12px;
  padding:14px 28px;
}
.nav-links a{
  font-family:var(--font-mono);
  font-size:12.5px;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--ink-dim);
  position:relative;
  padding:4px 0;
  transition:color .25s;
}
.nav-links a::after{
  content:'';
  position:absolute; left:0; bottom:-2px;
  width:0; height:1px;
  background:var(--gradient-accent);
  transition:width .3s var(--ease);
}
.nav-links a:hover, .nav-links a.active{ color:var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after{ width:100%; }

.btn{
  font-family:var(--font-mono);
  font-size:12.5px;
  letter-spacing:.06em;
  text-transform:uppercase;
  padding:13px 22px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  gap:9px;
  white-space:nowrap;
  transition:transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.btn-primary{
  background:var(--blue-abyss);
  color:var(--blue-glow);
  font-weight:700;
  border:1.5px solid var(--blue-mid);
  box-shadow:0 0 0 0 rgba(95,211,247,0);
}
.btn-primary:hover{
  transform:translateY(-2px);
  background:#071f3d;
  border-color:var(--blue-glow);
  box-shadow:0 10px 30px -8px rgba(95,211,247,.45);
}
.btn-ghost{
  background:transparent;
  border:1px solid var(--panel-edge-strong);
  color:var(--ink);
}
.btn-ghost:hover{
  border-color:var(--blue-glow);
  background:rgba(95,211,247,.06);
}
.nav-toggle{
  display:none;
  flex:none;
  width:38px; height:38px;
  border-radius:8px;
  border:1px solid var(--panel-edge-strong);
  background:transparent;
  position:relative;
}
.nav-toggle span{
  position:absolute; left:9px; right:9px; height:1.5px;
  background:var(--ink);
  transition:transform .3s, opacity .3s;
}
.nav-toggle span:nth-child(1){ top:14px; }
.nav-toggle span:nth-child(2){ top:19px; }
.nav-toggle span:nth-child(3){ top:24px; }
.nav-toggle.is-open span:nth-child(1){ transform:translateY(5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2){ opacity:0; }
.nav-toggle.is-open span:nth-child(3){ transform:translateY(-5px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero{
  padding:calc(var(--section-pad) + 56px) 0 var(--section-pad);
  min-height:92vh;
  display:flex;
  align-items:center;
}
.hero-inner{ max-width:880px; }
.hero .eyebrow{ margin-bottom:22px; }
.hero h1{ margin-bottom:26px; }
.hero .lede{ margin-bottom:34px; }
.hero-cta{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:56px; }

.quote-block{
  border-left:2px solid transparent;
  border-image:var(--gradient-accent) 1;
  padding:6px 0 6px 24px;
  max-width:620px;
}
.quote-block p{
  font-family:var(--font-display);
  font-size:clamp(18px,1.9vw,22px);
  font-weight:500;
  color:var(--ink);
  line-height:1.5;
}
.quote-block p::before, .quote-block p::after{ content:'"'; color:var(--blue-glow); }

/* proof strip */
.proof-strip{
  margin-top:64px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border-top:1px solid var(--panel-edge);
}
.proof-item{
  padding:28px 28px 0 0;
  border-right:1px solid var(--panel-edge);
}
.proof-item:last-child{ border-right:none; }
.proof-item .proof-icon{
  width:30px; height:30px;
  color:var(--blue-glow);
  margin-bottom:18px;
}
.proof-item .proof-icon svg{ width:100%; height:100%; }
.proof-item .stat{
  font-family:var(--font-mono);
  font-weight:700;
  font-size:clamp(26px,2.7vw,34px);
  line-height:1.15;
  min-height:calc(2 * 1.15em);
  background-image:var(--gradient-accent);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  display:block;
  margin-bottom:10px;
}
.proof-item p{
  color:var(--ink-dim);
  font-size:14.5px;
  line-height:1.55;
  max-width:230px;
}

/* =========================================================
   SECTION GENERICS
   ========================================================= */
section{ padding:var(--section-pad) 0; position:relative; }
.section-head{ max-width:680px; margin-bottom:56px; }
.section-head .eyebrow{ margin-bottom:18px; }
.divider{
  height:1px;
  background:var(--panel-edge);
  border:none;
  margin:0;
}
.band-soft{ background:linear-gradient(180deg, transparent, rgba(255,255,255,.012), transparent); }

/* two column */
.cols-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:64px;
  align-items:start;
}

/* =========================================================
   CARDS — services / values
   ========================================================= */
.card-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:1px;
  background:var(--panel-edge);
  border:1px solid var(--panel-edge);
  border-radius:var(--radius);
  overflow:hidden;
}
.service-card{
  background:var(--void-soft);
  padding:38px 36px;
  transition:background .4s var(--ease);
}
.service-card:hover{ background:var(--panel); }
.service-card .icon{
  width:42px; height:42px;
  margin-bottom:24px;
  color:var(--blue-glow);
}
.service-card .icon svg{ width:100%; height:100%; }
.service-card h3{ margin-bottom:6px; }
.service-card .tagline{
  font-family:var(--font-mono);
  font-size:12.5px;
  color:var(--blue-glow);
  letter-spacing:.04em;
  margin-bottom:14px;
  display:block;
}
.service-card p{ color:var(--ink-dim); font-size:15px; line-height:1.6; }

.value-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1px;
  background:var(--panel-edge);
  border:1px solid var(--panel-edge);
  border-radius:var(--radius);
  overflow:hidden;
}
.value-card{ background:var(--void-soft); padding:34px 32px; }
.value-card .mark{
  font-family:var(--font-mono);
  color:var(--blue-glow);
  font-size:13px;
  display:block;
  margin-bottom:18px;
}
.value-card h3{ margin-bottom:10px; }
.value-card p{ color:var(--ink-dim); font-size:14.5px; line-height:1.6; }

/* =========================================================
   FEATURE ROW (What We Do — detailed service list)
   ========================================================= */
.feature-row{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:30px;
  padding:54px 0;
  border-bottom:1px solid var(--panel-edge);
}
.feature-row:first-child{ padding-top:0; }
.feature-row:last-child{ border-bottom:none; }
.feature-row .icon{ width:62px; height:62px; color:var(--blue-glow); flex-shrink:0; }
.feature-row .icon svg{ width:100%; height:100%; }
.feature-row .tagline{
  font-family:var(--font-mono);
  font-size:20px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--blue-glow);
  margin-bottom:10px;
  display:block;
}
.feature-row h3{ margin-bottom:14px; font-size:clamp(23px,2.5vw,30px); }
.feature-row p{ color:var(--ink-dim); font-size:16px; max-width:620px; line-height:1.65; }

/* =========================================================
   WAYPOINT TIMELINE  (How It Works)
   ========================================================= */
.trail{ position:relative; padding-left:6px; }
.trail-line{
  position:absolute;
  left:23px; top:14px; bottom:14px;
  width:1px;
  background:linear-gradient(to bottom, var(--panel-edge), var(--panel-edge));
}
.trail-line-fill{
  position:absolute;
  left:23px; top:14px;
  width:1px;
  background:var(--gradient-accent);
  height:0%;
  transition:height 1.2s var(--ease);
  box-shadow:0 0 8px rgba(95,211,247,.6);
}
.waypoint{
  position:relative;
  display:grid;
  grid-template-columns:48px 1fr;
  gap:28px;
  padding-bottom:64px;
}
.waypoint:last-child{ padding-bottom:0; }
.waypoint-node{
  width:13px; height:13px;
  border-radius:50%;
  background:var(--void);
  border:2px solid var(--blue-mid);
  margin-top:6px;
  position:relative;
  z-index:2;
  transition:box-shadow .4s, border-color .4s;
}
.waypoint.is-visible .waypoint-node{
  border-color:var(--blue-glow);
  box-shadow:0 0 0 5px rgba(95,211,247,.14), 0 0 16px rgba(95,211,247,.6);
}
.waypoint-tag{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.1em;
  color:var(--blue-glow);
  display:block;
  margin-bottom:10px;
}
.waypoint h3{ margin-bottom:10px; }
.waypoint p{ color:var(--ink-dim); font-size:15.5px; max-width:560px; }

/* =========================================================
   CASE STUDIES
   ========================================================= */
.case-file{
  border:1px solid var(--panel-edge);
  border-radius:var(--radius);
  padding:48px;
  margin-bottom:28px;
  position:relative;
  background:var(--void-soft);
  overflow:hidden;
}
.case-file::before{
  content:'';
  position:absolute; top:0; left:0; right:0; height:2px;
  background:var(--gradient-accent);
  opacity:0;
  transition:opacity .5s;
}
.case-file:hover::before{ opacity:1; }
.case-file .file-tag{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.1em;
  color:var(--ink-mute);
  display:flex;
  justify-content:space-between;
  margin-bottom:28px;
  border-bottom:1px dashed var(--panel-edge);
  padding-bottom:18px;
}
.case-file .file-tag span:last-child{ color:var(--blue-glow); }
.case-file h3{ font-size:clamp(22px,2.4vw,28px); margin-bottom:14px; max-width:540px; }
.case-file .outcome{
  font-family:var(--font-display);
  font-weight:500;
  color:var(--blue-pale);
  font-size:17px;
  margin-bottom:18px;
}
.case-file p.body-text{ margin-bottom:0; }

/* =========================================================
   FORM (contact)
   ========================================================= */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.field{ display:flex; flex-direction:column; gap:9px; margin-bottom:22px; }
.field.full{ grid-column:1/-1; }
.field label{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-mute);
}
.field input, .field textarea{
  background:var(--panel);
  border:1px solid var(--panel-edge);
  border-radius:8px;
  padding:14px 16px;
  color:var(--ink);
  font-family:var(--font-body);
  font-size:15px;
  resize:vertical;
  transition:border-color .3s;
}
.field input:focus, .field textarea:focus{
  border-color:var(--blue-glow);
  outline:none;
}
.field input::placeholder, .field textarea::placeholder{ color:var(--ink-mute); }

/* =========================================================
   WAYPOINT SCROLL RAIL (desktop side nav)
   ========================================================= */
.scroll-rail{
  position:fixed;
  right:30px;
  top:50%;
  transform:translateY(-50%);
  z-index:40;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
}
.scroll-rail .rail-line{
  width:1px; flex:1;
  background:var(--panel-edge);
  min-height:14px;
}
.rail-dot{
  width:8px; height:8px;
  border-radius:50%;
  border:1.5px solid var(--ink-mute);
  background:var(--void);
  cursor:pointer;
  position:relative;
  transition:border-color .3s, box-shadow .3s;
}
.rail-dot::after{
  content:attr(data-label);
  position:absolute;
  right:20px; top:50%;
  transform:translateY(-50%);
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-dim);
  white-space:nowrap;
  opacity:0;
  transition:opacity .25s;
  pointer-events:none;
}
.rail-dot:hover::after{ opacity:1; }
.rail-dot.is-active{
  border-color:var(--blue-glow);
  box-shadow:0 0 10px rgba(95,211,247,.7);
  background:var(--blue-glow);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  border-top:1px solid var(--panel-edge);
  padding:64px 0 36px;
}
.footer-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:40px;
  margin-bottom:48px;
  flex-wrap:wrap;
}
.footer-tag{ color:var(--ink-mute); font-size:14.5px; max-width:320px; margin-top:14px; }
.footer-nav{ display:flex; gap:36px; flex-wrap:wrap; }
.footer-nav a{
  font-family:var(--font-mono);
  font-size:12.5px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-dim);
  transition:color .25s;
}
.footer-nav a:hover{ color:var(--blue-glow); }
.footer-bottom{
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:14px;
  padding-top:28px;
  border-top:1px solid var(--panel-edge);
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--ink-mute);
  letter-spacing:.04em;
}

/* =========================================================
   PAGE HERO (sub-pages, shorter than home hero)
   ========================================================= */
.page-hero{
  padding:calc(var(--section-pad) + 50px) 0 60px;
}
.page-hero h1{ font-size:clamp(36px,5.4vw,64px); margin-bottom:20px; }
.page-hero .lede{ margin-top:18px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width:980px){
  .cols-2{ grid-template-columns:1fr; gap:40px; }
  .card-grid{ grid-template-columns:1fr; }
  .value-grid{ grid-template-columns:1fr; }
  .proof-strip{ grid-template-columns:1fr; }
  .proof-item{ border-right:none; border-bottom:1px solid var(--panel-edge); padding:24px 0; }
  .proof-item:last-child{ border-bottom:none; }
  .scroll-rail{ display:none; }
  .form-grid{ grid-template-columns:1fr; }
}
@media (max-width:760px){
  .feature-row{ grid-template-columns:1fr; gap:16px; }
  .nav-links{
    position:fixed; top:0; right:0; height:100vh; width:78%;
    background:rgba(5,9,17,.97);
    backdrop-filter:blur(18px);
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    padding:0 40px;
    gap:26px;
    transform:translateX(100%);
    transition:transform .45s var(--ease);
    border-left:1px solid var(--panel-edge);
  }
  .nav-links.is-open{ transform:translateX(0); }
  .nav-links a{ font-size:14px; }
  .nav-toggle{ display:block; }
  .nav-links .btn{ margin-top:10px; margin-left:0; }
  .hero{ min-height:auto; }
  .footer-top{ flex-direction:column; }
}
@media (max-width:560px){
  .wrap{ padding:0 20px; }
  .hero-cta{ flex-direction:column; align-items:flex-start; }
  .case-file{ padding:30px 24px; }
  .case-file .file-tag{ flex-direction:column; gap:6px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .kinetic .word{ animation:none; opacity:1; filter:none; transform:none; }
  .reveal{ transition:none; opacity:1; transform:none; }
  .gradient-text{ animation:none; }
  *{ scroll-behavior:auto !important; }
}
