/* ============================================
   LUCAS MOROSOV — PORTFOLIO
   ============================================ */

/* --- TOKENS --- */
:root {
  --bg: #0A0F1E;
  --bg-alt: #0D1526;
  --surface: #111827;
  --accent: #63D2BE;
  --accent-warm: #F4A354;
  --text: #E8F0FE;
  --text-muted: #7A8BA8;
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --max-w: 1120px;
  --nav-h: 64px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- GRID BACKGROUND --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 210, 190, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 210, 190, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(99, 210, 190, 0.08);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.5px;
}
.nav-logo .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  background: rgba(99, 210, 190, 0.1);
  border: 1px solid rgba(99, 210, 190, 0.25);
  padding: 0.4rem 1rem !important;
  border-radius: var(--radius-sm);
  color: var(--accent) !important;
}
.nav-cta:hover { background: rgba(99, 210, 190, 0.18) !important; }
.nav-cta::after { display: none !important; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- LAYOUT --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}
.section {
  padding: 6rem 0;
}
.section-alt {
  background: var(--bg-alt);
}

/* --- TYPOGRAPHY --- */
.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: -0.5px;
}
.section-title-large {
  font-size: 3rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 0.75rem;
}
.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: -1.5rem;
  margin-bottom: 3rem;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(99, 210, 190, 0.3); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(232, 240, 254, 0.15);
}
.btn-secondary:hover { border-color: rgba(232, 240, 254, 0.35); }

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 2rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: center;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  min-height: 1.7em;
}
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 540px;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #4ade80;
  margin-bottom: 1.75rem;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.hero-metrics {
  display: flex;
  gap: 2.5rem;
}
.metric {
  display: flex;
  flex-direction: column;
}
.metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.metric-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hero photo */
.photo-frame {
  width: 280px;
  height: 280px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(99, 210, 190, 0.03);
  position: relative;
  overflow: hidden;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

/* --- ABOUT --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.85;
}
.about-text p:first-child {
  color: var(--text);
  font-size: 1.05rem;
}
.facts-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.facts-list li {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.facts-list .arrow {
  color: var(--accent);
  margin-right: 0.5rem;
}

/* --- NWCONNECT --- */
.nw-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: -1.5rem;
  margin-bottom: 1.5rem;
}
.nw-desc {
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.85;
  margin-bottom: 2.5rem;
}
.nw-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.nw-metric-card {
  background: var(--surface);
  border: 0.5px solid rgba(99, 210, 190, 0.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.nw-metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 210, 190, 0.35);
}
.nw-metric-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.nw-metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.nw-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.stack-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: rgba(99, 210, 190, 0.08);
  border: 0.5px solid rgba(99, 210, 190, 0.15);
  border-radius: 6px;
  color: var(--accent);
}

.screenshot-frame {
  width: 100%;
  max-width: 800px;
  height: 450px;
  margin: 0 auto;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(99, 210, 190, 0.03);
  overflow: hidden;
}
.screenshot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

/* --- STACK --- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.stack-card {
  background: var(--surface);
  border: 0.5px solid rgba(232, 240, 254, 0.06);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}
.stack-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 210, 190, 0.3);
}
.stack-card-icon {
  margin-bottom: 1rem;
}
.stack-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.stack-card-list {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- PROJECTS --- */
.project-card {
  display: block;
  background: var(--surface);
  border: 0.5px solid rgba(232, 240, 254, 0.06);
  border-radius: var(--radius);
  transition: transform 0.2s, border-color 0.2s;
  overflow: hidden;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 210, 190, 0.3);
}
.project-card-featured {
  border-color: rgba(99, 210, 190, 0.25);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 210, 190, 0.04) 100%);
}
.project-card-inner {
  padding: 1.75rem;
}
.project-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.project-card-stack {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.project-card-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  transition: color 0.2s;
}
.project-card-link:hover { color: var(--accent-warm); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* --- CONSULTING --- */
.consulting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.consulting-card {
  background: var(--surface);
  border: 0.5px solid rgba(232, 240, 254, 0.06);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}
.consulting-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 163, 84, 0.35);
}
.consulting-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.consulting-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.consulting-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.consulting-card-metrics span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: rgba(244, 163, 84, 0.1);
  border: 0.5px solid rgba(244, 163, 84, 0.2);
  border-radius: 6px;
  color: var(--accent-warm);
}

/* --- CONTACT --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact-text p {
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 1.05rem;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border: 0.5px solid rgba(232, 240, 254, 0.06);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.contact-link:hover {
  color: var(--accent);
  border-color: rgba(99, 210, 190, 0.25);
  background: rgba(99, 210, 190, 0.04);
}
.contact-icon {
  display: flex;
  flex-shrink: 0;
}

/* --- FOOTER --- */
.footer {
  border-top: 0.5px solid rgba(232, 240, 254, 0.06);
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --- REVEAL ANIMATION --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { order: -1; justify-self: center; }
  .photo-frame { width: 200px; height: 200px; }
  .about-grid { grid-template-columns: 1fr; }
  .nw-metrics { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .consulting-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 15, 30, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 0.5px solid rgba(99, 210, 190, 0.1);
  }
  .nav-links.open { display: flex; }
  .nav-links a::after { display: none; }

  .section { padding: 4rem 0; }
  .section-title { font-size: 1.75rem; }
  .section-title-large { font-size: 2.25rem; }
  .hero-name { font-size: 2.25rem; }
  .hero-metrics { gap: 1.25rem; flex-wrap: wrap; }
  .metric-value { font-size: 1.25rem; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { text-align: center; justify-content: center; }

  .nw-metrics { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: 1fr; }
  .screenshot-frame { height: 220px; }
}
