:root{
  --bg:#070A10;
  --ink:#F4F7FF;
  --muted:#A6B0C4;

  --line:rgba(255,255,255,.10);
  --line2:rgba(255,255,255,.06);

  --panel:rgba(255,255,255,.04);
  --panel2:rgba(255,255,255,.06);

  --blue:#2AA8FF;

  --rail: 280px;              /* default rail */
  --railMin: 240px;           /* allow rail to shrink before mobile */
  --max: 1140px;

  --radius: 18px;
  --radius2: 26px;

  --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 26px 90px rgba(0,0,0,.55);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  color:var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.6;

  /* stop horizontal scroll on “almost mobile” widths */
  overflow-x:hidden;

  background:
    radial-gradient(900px 700px at 18% 12%, rgba(42,168,255,.18), transparent 60%),
    radial-gradient(900px 700px at 85% 18%, rgba(42,168,255,.10), transparent 60%),
    radial-gradient(1000px 900px at 50% 120%, rgba(42,168,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 45%),
    var(--bg);
}

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

/* container adapts better at smaller desktop widths */
.container{width:min(var(--max), calc(100% - 48px)); margin:0 auto;}
@media (max-width: 720px){
  .container{ width: min(var(--max), calc(100% - 34px)); }
}

.small{font-size:13.5px;color:var(--muted);}
.muted{color:var(--muted);}

.skip-link{
  position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:16px; top:16px; width:auto; height:auto;
  background:rgba(0,0,0,.65);
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  z-index:9999;
}

/* ---- Page transitions ---- */
body.page-enter{
  animation: pageIn .24s var(--ease) both;
}
body.page-leave{
  animation: pageOut .18s var(--ease) both;
}
@keyframes pageIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes pageOut{
  from{ opacity:1; transform: translateY(0); }
  to{ opacity:0; transform: translateY(8px); }
}

/* --- Layout: Left Rail + Content --- */
.shell{
  display:grid;
  /* responsive desktop: rail can shrink; content can shrink without forcing horizontal scroll */
  grid-template-columns: minmax(var(--railMin), var(--rail)) minmax(0, 1fr);
  min-height:100vh;
}

.rail{
  position:sticky;
  top:0;
  height:100vh;
  padding: 22px 18px;
  border-right:1px solid var(--line2);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 35%),
    rgba(0,0,0,.10);
  backdrop-filter: blur(10px) saturate(1.15);
}

.brand{
  display:flex; gap:12px; align-items:center;
  padding: 10px 10px 14px;
}

.brand strong{
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
  letter-spacing:.2px;
}
.brand div{display:flex; flex-direction:column; line-height:1.1;}
.brand span{font-size:13px; color:var(--muted);}

/* nav */
.rail-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding: 8px 6px 14px;
}
.rail-nav a{
  padding: 10px 12px;
  border-radius: 14px;
  color: rgba(244,247,255,.88);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
  border: 1px solid transparent;
}
.rail-nav a:hover{
  background: rgba(255,255,255,.05);
  transform: translateX(2px);
}
.rail-nav a.active{
  background: rgba(42,168,255,.12);
  border-color: rgba(42,168,255,.25);
  color: var(--ink);
}

/* rail cta */
.rail-cta{
  margin-top: 10px;
  padding: 0 6px;
}

/* rail footer */
.rail-foot{
  position:absolute;
  left:18px; right:18px;
  bottom:18px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

/* content */
.content{
  padding: 24px 0 70px;
  min-width: 0; /* important to prevent grid overflow */
}

/* Mobile top bar */
.mobile-top{
  display:none;
  padding: 14px 0 0;
}
.rail-toggle{
  display:none;
  width:44px; height:44px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  align-items:center;
  justify-content:center;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  font-weight:700;
  font-size:14px;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.btn:active{ transform: translateY(0); }
.btn-primary{
  color:#071018;
  background: linear-gradient(135deg, rgba(42,168,255,.95), rgba(61,180,255,.86));
  border-color: rgba(42,168,255,.55);
  box-shadow: 0 18px 70px rgba(42,168,255,.18);
}
.btn-primary:hover{ box-shadow: 0 22px 90px rgba(42,168,255,.22); }
.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.14);
}

/* CTA rows */
.cta-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top: 14px;
}
.cta-row .btn{
  flex: 1 1 240px;
}

/* --- Page sections --- */
main{ padding-top: 6px; }

.hero{
  padding: 18px 0 10px;
}
.hero h1{
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 54px;
  letter-spacing: -.5px;
  line-height:1.02;
  margin: 0 0 12px;
}
.hero p{ margin:0; color: rgba(244,247,255,.88); max-width: 70ch; }

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top: 18px;
}
.hero-actions .btn{ width:auto; }

.marquee{
  margin-top: 22px;
  border-top:1px solid rgba(255,255,255,.08);
  border-bottom:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  background: rgba(255,255,255,.02);
}
.marquee .track{
  display:flex;
  gap:28px;
  padding: 10px 0;
  white-space:nowrap;
  animation: scroll 22s linear infinite;
  will-change: transform;
}
.marquee span{
  color: rgba(244,247,255,.82);
  font-size: 13px;
  letter-spacing:.4px;
  text-transform: uppercase;
}
@keyframes scroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

.section{
  padding: 34px 0;
}
.h2{
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 26px;
  margin: 0 0 10px;
}
.rule{
  height:1px;
  background: rgba(255,255,255,.08);
  border:0;
  margin: 18px 0;
}

/* split areas */
.split{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items:start;
}
.statement{
  padding: 18px;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.statement strong{
  display:block;
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 18px;
  margin-bottom: 6px;
}

.stack{
  display:grid;
  gap:12px;
}
.row{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding: 14px 14px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.row:hover{
  transform: translateY(-2px);
  border-color: rgba(42,168,255,.22);
  background: rgba(255,255,255,.05);
}
.bullet{
  width:28px; height:28px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(42,168,255,.14);
  border:1px solid rgba(42,168,255,.25);
  color: var(--ink);
  font-weight:800;
  flex: 0 0 auto;
}

/* Timeline */
.timeline{
  display:grid;
  gap:10px;
}
.step{
  display:grid;
  grid-template-columns: 100px 1fr;
  gap:14px;
  padding: 14px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.step .tag{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing:.35px;
  color: rgba(244,247,255,.70);
}
.step .title{
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
  margin:0 0 4px;
}
.step p{margin:0;color:var(--muted);}

/* Projects */
.project{
  padding: 16px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.project:hover{
  transform: translateY(-2px);
  border-color: rgba(42,168,255,.22);
  background: rgba(255,255,255,.05);
}
.project-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.project h3{
  margin:0;
  font-family:"Space Grotesk", Inter, system-ui, sans-serif;
}
.project p{ margin:6px 0 0; color:var(--muted); }

/* Forms */
.form{ display:grid; gap:12px; }
.field{ display:grid; gap:7px; }
label{ font-size: 13px; color: rgba(245,247,250,.88); }
input, textarea, select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: var(--ink);
  outline:none;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(42,168,255,.45);
  box-shadow: 0 0 0 4px rgba(42,168,255,.12);
}
textarea{ min-height: 130px; resize: vertical; }
.help{ font-size: 12.5px; color: var(--muted); }

/* Footer inside content area */
.page-footer{
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.page-footer a{ color: rgba(244,247,255,.86); }
.page-footer a:hover{ color: var(--ink); }

/* reveal */
.reveal{
  opacity:0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  will-change: opacity, transform;
}
.reveal.show{ opacity:1; transform: translateY(0); }
.reveal.delay-1{ transition-delay:.08s; }
.reveal.delay-2{ transition-delay:.16s; }
.reveal.delay-3{ transition-delay:.24s; }

/* Mobile rail overlay */
.nav-overlay{
  display:none;
}

/* Mobile rail */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }

  .rail{
    position:fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    transform: translateX(-102%);
    transition: transform .22s var(--ease);
    z-index: 999;
    height: 100vh;
  }
  body.nav-open .rail{ transform: translateX(0); }

  /* optional dim overlay for click-outside */
  .nav-overlay{
    display:block;
    position:fixed;
    inset:0;
    background: rgba(0,0,0,.45);
    opacity:0;
    pointer-events:none;
    transition: opacity .22s var(--ease);
    z-index: 998;
  }
  body.nav-open .nav-overlay{
    opacity:1;
    pointer-events:auto;
  }

  .rail-foot{ position:static; margin-top: 16px; }

  .mobile-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }
  .rail-toggle{ display:inline-flex; }

  .content{ padding-top: 10px; }
  .split{ grid-template-columns: 1fr; }

  .hero h1{ font-size: 40px; }
  .step{ grid-template-columns: 86px 1fr; }
}
