/* Base, mobile-first, no external libs. System fonts only. */

:root{
  --bg: #0b0c10;
  --fg: #e8f0e8;
  --muted: #a7b3a7;
  --brand: #00f700; /* used later in phases too */
  --card: #131417;
  --link: #6dfc6d;
  --focus: #00f700;
  --container: 1160px;
  color-scheme: dark; /* proper UA widgets in dark mode */
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
html,body{ height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: var(--link); text-decoration: none; }
a:hover, a:focus{ text-decoration: underline; }
:focus{ outline: 2px solid var(--focus); outline-offset: 2px; }

.container{ width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }

.skip-link{
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus{
  position: static;
  width: auto; height: auto;
  display: inline-block;
  margin: 8px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 6px;
}

/* ===========================
   Header — Glass + Brand mark + Tagline
   =========================== */

.site-header{
  position: sticky; top: 0; z-index: 100;
  background:
    linear-gradient(180deg, rgba(6,8,10,.78), rgba(6,8,10,.62));
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid #17191f;
  box-shadow: 0 2px 20px -14px rgba(0,0,0,.6), 0 0 60px -30px rgba(0,247,0,.15);
  transition: transform .24s ease;
}
.is-stuck .site-header{
  background:
    linear-gradient(180deg, rgba(6,8,10,.88), rgba(6,8,10,.75));
  backdrop-filter: saturate(130%) blur(10px);
}
/* Auto-hide header on downward scroll */
.header-hidden .site-header{ transform: translateY(-100%); }

.header-inner{
  display: grid;
  grid-template-columns: auto 1fr auto; /* brand | nav | lang rail */
  gap: 14px;
  align-items: center;
  min-height: 56px;
}

/* Brand block */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: .2px;
}
.brand-logo{
  position: relative;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.24);
  box-shadow:
    inset 0 0 0 1px rgba(0,247,0,.32),
    0 6px 18px -10px rgba(0,247,0,.35);
}
.brand-logo img{
  width: 100%; height: 100%;
  display: block;
  border-radius: 6px;
}

/* Lottie overlay inside brand logo */
.brand-logo-lottie{
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  mix-blend-mode: screen;
}
.brand:hover .brand-logo-lottie,
.brand:focus .brand-logo-lottie{ opacity: .95; }

/* Neon halo (subtle, respects reduced motion) */
.brand-logo::after{
  content:"";
  position: absolute;
  inset: -9px;
  border-radius: 12px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0,247,0,.18), rgba(0,0,0,0) 65%);
  opacity: .35;
  transition: opacity .2s ease, transform .2s ease;
}
.brand:hover .brand-logo::after,
.brand:focus .brand-logo::after{
  opacity: .6; transform: scale(1.02);
}
@media (prefers-reduced-motion: no-preference){
  .brand-logo::after{ animation: brandPulse 3.8s ease-in-out infinite; }
}
@keyframes brandPulse{
  0%,100%{ opacity:.25; transform: scale(0.98); }
  50%{    opacity:.6;  transform: scale(1.03); }
}

.brand-name{ font-weight: 700; }
.brand-tag{
  display: none;
  color: var(--muted);
  font-size: 12px;
  padding-left: 10px;
  margin-left: 8px;
  border-left: 1px solid #2a2b31;
}
@media (min-width: 1080px){
  .brand-tag{ display: inline-flex; }
}

/* Primary nav */
.site-nav{ position: relative; justify-self: center; } /* centered in middle column */
.site-nav .nav-list,
.lang-switch{
  display: flex; gap: 14px; align-items: center; margin: 0; padding: 0;
}
.site-nav .nav-list li,
.lang-switch li{ list-style: none; }

.site-nav a{ color: var(--fg); opacity: 0.9; }
.site-nav a[aria-current="page"]{
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Nav indicator (sliding underline) */
.nav-indicator{
  position: absolute;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(0,247,0,.35);
  transition: transform .25s ease, width .25s ease, opacity .25s ease;
  opacity: .8;
  pointer-events: none;
}

/* Contact CTA styling */
.nav-cta a{
  padding: 7px 12px;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  color: var(--fg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5) inset;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.nav-cta a:hover, .nav-cta a:focus{
  background: var(--brand);
  color: #041104;
  transform: translateY(-1px);
  box-shadow: 0 0 24px -8px rgba(0,247,0,.55);
  text-decoration: none;
}

/* Footer */
.site-footer{
  border-top: 1px solid #1f2024;
  margin-top: 48px;
}
.footer-inner{
  padding-block: 24px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.footer-inner a{ color: var(--link); }

/* ===========================
   Page sections
   =========================== */

.hero{
  padding-block: 56px 28px;
  background: linear-gradient(180deg, rgba(0,247,0,0.08), rgba(0,0,0,0));
}
.hero h1{
  margin: 0 0 8px 0;
  font-size: clamp(28px, 6vw, 48px);
  line-height: 1.15;
}
.hero p{
  margin: 0; color: var(--muted);
  font-size: clamp(16px, 3.5vw, 20px);
}

/* --- Hero typography polish (legibility during distortion) --- */
.hero h1,
.hero p{
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "clig" 1, "calt" 1;
  letter-spacing: 0.2px;
  text-shadow: 0 0 14px rgba(0,247,0,0.08);
}

/* --- Soft reveal on load (respects reduced motion) --- */
@keyframes riseFade {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.matrix-overlay .hero h1 { animation: riseFade 680ms ease-out 80ms both; }
.matrix-overlay .hero p  { animation: riseFade 680ms ease-out 160ms both; }
@media (prefers-reduced-motion: reduce){
  .matrix-overlay .hero h1,
  .matrix-overlay .hero p{
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.section{
  padding-block: 28px;
}
.card{
  background: var(--card);
  border: 1px solid #202228;
  border-radius: 10px;
  padding: 16px;
}

/* ===========================
   Responsive tweaks
   =========================== */

@media (max-width: 720px){
  .header-inner{
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 8px;
  }
  .site-nav .nav-list{ flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
  .lang-switch{ justify-self: start; }
}

/* ===========================
   Utility
   =========================== */

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.center{ text-align: center; }

/* ===========================
   Language Switcher — Rail UI
   =========================== */

.lang-rail{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  position: relative;
}

.lang-rail .lang-switch{
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;                /* horizontal scroll when needed */
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* IE/Edge legacy */
  scroll-snap-type: x proximity; /* nicer keyboard/touch */
}
.lang-rail .lang-switch::-webkit-scrollbar{ display: none; } /* WebKit */

.lang-nav{
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.lang-nav:hover, .lang-nav:focus{ transform: translateY(-1px); color: var(--fg); }
.lang-nav[hidden]{ display: none !important; }
.lang-rail:not(.is-overflowing) .lang-nav{ display: none !important; } /* hide arrows if not needed */

/* Chip look (overrides the basic .lang-switch a rules above) */
.lang-rail .lang-switch a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  background:
    /* slightly brighter face for legibility on glass header */
    linear-gradient(rgba(20,22,26,.92), rgba(20,22,26,.92)) padding-box,
    linear-gradient(135deg, rgba(0,247,0,0.24), rgba(0,247,0,0.06)) border-box;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5) inset, 0 6px 18px -12px rgba(0,0,0,.6);
  scroll-snap-align: center;
  transition: transform .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap; /* avoid multi-line chips */
}
.lang-rail .lang-switch a:hover,
.lang-rail .lang-switch a:focus{
  color: var(--fg);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5) inset, 0 10px 26px -12px rgba(0,0,0,.7);
}
.lang-rail .lang-switch a[aria-current="true"]{
  border-color: var(--brand);
  color: var(--brand);
  text-shadow: 0 0 8px rgba(0,247,0,.45);
  /* inner glow + subtle outer lift */
  box-shadow:
    0 0 0 1px rgba(0,0,0,.55) inset,
    0 0 0 1px rgba(0,247,0,.35),
    0 0 24px -10px rgba(0,247,0,.45);
}

/* Edge fades to suggest scroll */
.lang-rail::before,
.lang-rail::after{
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to right, rgba(11,12,16,1), rgba(11,12,16,0));
}
.lang-rail::before{ left: 0; }
.lang-rail::after{ right: 0; transform: scaleX(-1); }
.lang-rail .lang-nav{ z-index: 2; } /* arrows over fades */

/* Drag-scrolling affordance */
.lang-rail.dragging .lang-switch a{ pointer-events: none; }

/* Small-screen tweaks */
@media (max-width: 720px){
  .lang-rail{ gap: 6px; }
  .lang-rail .lang-switch a{ padding: 5px 8px; font-size: 12px; }
}

/* Higher contrast mode refinements */
@media (prefers-contrast: more){
  .site-header{ border-bottom-color: #2b2e36; }
  .lang-rail .lang-switch a{ border-color: #3a3e46; }
  .nav-indicator{ opacity: 1; }
}

.nav-cta a[aria-current="page"]{ background: var(--brand); color:#041104; border-color: var(--brand); }
.nav-cta a:hover, .nav-cta a:focus{ background: var(--brand); color:#041104; transform: translateY(-1px); box-shadow:0 8px 20px rgba(0,247,0,.22); border-color: var(--brand); }
