/* ============================================================
   NEURONS.fi — Visual Design System
   ============================================================ */

/* Custom Properties */
:root {
  --black:      #050508;
  --navy:       #080c1a;
  --navy-mid:   #0d1428;
  --navy-light: #111a35;
  --accent:     #50e87a;
  --accent-dim: rgba(80, 232, 122, 0.15);
  --accent-mid: rgba(80, 232, 122, 0.4);
  --accent-glow:rgba(80, 232, 122, 0.08);
  --text:       #e8e4f0;
  --text-dim:   #8b8ea8;
  --text-faint: #4a4d66;
  --border:     rgba(80, 232, 122, 0.12);
  --border-hover: rgba(80, 232, 122, 0.3);

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --nav-height: 72px;
  --section-pad: clamp(80px, 12vw, 140px);
  --container-max: 1200px;
  --container-pad: clamp(24px, 5vw, 60px);

  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--black);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

img, svg { display: block; max-width: 100%; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad);
  position: relative;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding-inline: var(--container-pad);
  transition: background 0.4s var(--ease-smooth), backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.9;
  transition: opacity 0.2s;
}

.nav-logo:hover { opacity: 1; }

.nav-links {
  display: flex;
  gap: clamp(24px, 3vw, 48px);
  margin-left: auto;
  margin-right: 0;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.lang-btn:hover { color: var(--text); }

.lang-btn--active {
  color: var(--accent);
}

.lang-sep {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #081a0f 0%, var(--black) 70%);
}

#neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-inline: var(--container-pad);
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 12vw, 10rem);
  line-height: 0.9;
  color: var(--text);
  margin-bottom: 32px;
}

/* Inner span is inline-block so text-align:center measures it at its true visual width,
   avoiding the phantom trailing-letter-spacing offset that miscenters block text */
.hero-title-inner {
  display: inline-block;
  letter-spacing: -0.03em;
  padding-right: 0.03em;
}

.hero-dot {
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.hero-subtitle em {
  font-style: italic;
  color: var(--text);
}

.hero-intro {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  color: var(--text-dim);
  line-height: 2;
  margin-bottom: 48px;
}

.hero-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.hero-cta:hover { opacity: 1; }

.cta-arrow {
  width: 20px;
  height: 20px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(80,232,122,0.4));
  animation: grow 2s ease-in-out infinite;
}

@keyframes grow {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   Section Header
   ============================================================ */
.section-header {
  margin-bottom: clamp(48px, 7vw, 80px);
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: var(--text);
}

/* ============================================================
   About
   ============================================================ */
.about {
  background: linear-gradient(180deg, var(--black) 0%, var(--navy) 50%, var(--black) 100%);
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 80% 50%, rgba(80,232,122,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
  margin-bottom: clamp(48px, 7vw, 80px);
}

.about-text p {
  color: var(--text-dim);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.about-lead {
  font-family: var(--font-display) !important;
  font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
  font-weight: 400;
  color: var(--text) !important;
  line-height: 1.6 !important;
  margin-bottom: 28px !important;
}

.about-text em {
  color: var(--accent);
  font-style: normal;
  font-family: var(--font-display);
}

.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.neuron-video {
  width: 100%;
  max-width: 320px;
  border-radius: 4px;
  display: block;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat {
  background: var(--navy);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============================================================
   Team
   ============================================================ */
.team {
  background: linear-gradient(180deg, var(--black) 0%, var(--navy) 100%);
}

.team::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 80%, rgba(80,232,122,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.team-photo {
  position: relative;
  margin-bottom: clamp(40px, 6vw, 72px);
  border-radius: 4px;
  overflow: hidden;
}

.team-photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: grayscale(20%);
}

.photo-credit {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 64px);
}

.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.portrait {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-initials {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.portrait::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 35%, var(--navy-light), var(--navy-mid));
  border: 1px solid rgba(80,232,122,0.2);
}

.portrait-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.member-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.member-role {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 20px;
}

.member-bio-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 16px;
}

.member-bio {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.85;
}

.member-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.member-social a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.member-social a:hover {
  opacity: 1;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--black);
  border-top: 1px solid var(--border);
  padding-block: clamp(60px, 8vw, 100px) 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(32px, 4vw, 60px);
  margin-bottom: 60px;
}

.footer-logo {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.7;
  max-width: 260px;
}

.footer-section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 16px;
}

.footer-info p,
.footer-contact p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.footer-contact a {
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer-contact a:hover { color: var(--accent); }

.social-links {
  display: flex;
  gap: 16px;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ============================================================
   Scroll Reveal Animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in grids */
.team-grid .team-member:nth-child(2) { transition-delay: 0.1s; }
.team-grid .team-member:nth-child(3) { transition-delay: 0.2s; }

.about-stats .stat:nth-child(2) { transition-delay: 0.06s; }
.about-stats .stat:nth-child(3) { transition-delay: 0.12s; }
.about-stats .stat:nth-child(4) { transition-delay: 0.18s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    order: -1;
  }

.about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 90;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
    letter-spacing: 0.15em;
  }

  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .lang-switch {
    margin-left: 0;
    margin-right: 8px;
    z-index: 101;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .hero-intro br {
    display: none;
  }
}

/* ============================================================
   Process / Build Gallery Section
   ============================================================ */

.process-intro {
  max-width: 640px;
  color: var(--text-dim);
  margin-top: 40px;
  margin-bottom: 0;
}

.gallery-strip-wrapper {
  margin-top: 56px;
  position: relative;
  overflow: hidden;
}

.gallery-strip-wrapper::before,
.gallery-strip-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 24px;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.gallery-strip-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--black), transparent);
}

.gallery-strip-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--black), transparent);
}

.gallery-strip {
  display: flex;
  gap: 10px;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  padding: 0 var(--container-pad) 24px;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-strip::-webkit-scrollbar {
  display: none;
}

.gallery-strip.grabbing {
  cursor: grabbing;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 320px;
  height: 240px;
  scroll-snap-align: start;
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0;
  transition: border-color 0.25s var(--ease-smooth);
}

.gallery-thumb:hover {
  border-color: var(--border-hover);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-smooth);
}

.gallery-thumb:hover img {
  transform: scale(1.04);
}

.gallery-thumb figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(5,5,8,0.75) 0%, transparent 100%);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ── Lightbox ───────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 8, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s var(--ease-smooth);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.lb-visible {
  opacity: 1;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--accent);
  border-color: var(--border-hover);
}

.lightbox-close {
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 640px) {
  .gallery-thumb {
    width: 260px;
    height: 195px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}
