/* ==========================================
   NUTILAPSED.EE — Design System
   Dark navy, electric blue + cyan accents
   ========================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #030712;
  --bg-1: #0d1117;
  --bg-2: #111827;
  --bg-3: #1a2233;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(99,179,237,0.3);

  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-green: #22c55e;

  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================
   NAV
   ========================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-logo .dot { color: var(--blue); }

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

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

.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  transition: all 0.2s;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
}

.lang-btn:hover { color: var(--text-1); }
.lang-btn.active {
  background: var(--blue);
  color: #fff;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(3, 7, 18, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
}

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

.nav-mobile a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--text-1); }

/* ==========================================
   HERO
   ========================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: -100px; left: -100px;
  animation: orb-drift 12s ease-in-out infinite alternate;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: -80px; right: -80px;
  animation: orb-drift 16s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(40px, 30px); }
}

.hero-inner {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 60px;
  padding-top: 100px;
  padding-bottom: 60px;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-light);
  margin-bottom: 24px;
}

.live-dot {
  width: 7px; height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.1); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.hero-name .accent {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 16px;
  color: var(--text-2);
  max-width: 480px;
  margin-bottom: 28px;
  line-height: 1.7;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.hero-tag {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}

/* ==========================================
   HERO VISUAL / AVATAR
   ========================================== */
.hero-visual {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-wrap {
  position: relative;
  width: 280px;
  height: 280px;
}

.avatar-ring-outer {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.2);
  animation: spin-ring 20s linear infinite;
}

.avatar-ring-outer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--blue);
}

.avatar-ring-inner {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(6, 182, 212, 0.15);
  animation: spin-ring 14s linear infinite reverse;
}

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

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-2);
  position: relative;
  z-index: 1;
}

.avatar-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 48px; height: 48px;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 2;
}

/* ==========================================
   SCROLL HINT
   ========================================== */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--blue));
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
  padding: 96px 0;
}

.section-header {
  margin-bottom: 56px;
  text-align: center;
}

.section-header.left {
  text-align: left;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto;
}

.section-header.left p {
  margin: 0;
}

/* ==========================================
   SUBJECTS GRID
   ========================================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.subject-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.subject-card.accent-blue::before { background: var(--blue); }
.subject-card.accent-orange::before { background: var(--accent-orange); }
.subject-card.accent-red::before { background: var(--accent-red); }
.subject-card.accent-purple::before { background: var(--accent-purple); }
.subject-card.accent-green::before { background: var(--accent-green); }

.subject-card:hover {
  transform: translateY(-3px);
}

.subject-card.accent-blue:hover { border-color: rgba(59,130,246,0.35); }
.subject-card.accent-orange:hover { border-color: rgba(249,115,22,0.35); }
.subject-card.accent-red:hover { border-color: rgba(239,68,68,0.35); }
.subject-card.accent-purple:hover { border-color: rgba(168,85,247,0.35); }
.subject-card.accent-green:hover { border-color: rgba(34,197,94,0.35); }

.subject-icon {
  font-size: 28px;
  line-height: 1;
}

.subject-body {
  flex: 1;
}

.subject-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.subject-body p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

.subject-grade {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  align-self: flex-start;
}

/* ==========================================
   NUTILAPSED FEATURED
   ========================================== */
.nuti-section {
  padding: 24px 0 80px;
}

.nuti-card {
  background: linear-gradient(135deg, #0d1b2e 0%, #0a1628 50%, #06101f 100%);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-xl);
  padding: 56px 60px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 60px;
}

.nuti-glow {
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 70%);
  pointer-events: none;
}

.nuti-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
}

.nuti-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.nuti-badge {
  display: inline-block;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.nuti-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #fff, var(--blue-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.nuti-sub {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 20px;
}

.nuti-desc {
  font-size: 15px;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.nuti-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nuti-tags span {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.nuti-visual {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.nuti-emoji {
  font-size: 96px;
  line-height: 1;
  filter: drop-shadow(0 0 30px rgba(59,130,246,0.4));
  animation: float-robot 3s ease-in-out infinite;
}

@keyframes float-robot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ==========================================
   PROJECTS GRID
   ========================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card:hover {
  border-color: rgba(99,179,237,0.25);
  transform: translateY(-3px);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-icon {
  font-size: 32px;
  line-height: 1;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-active { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.status-dev { background: rgba(59,130,246,0.12); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.2); }
.status-pause { background: rgba(234,179,8,0.12); color: #fde047; border: 1px solid rgba(234,179,8,0.2); }
.status-closed { background: rgba(148,163,184,0.08); color: var(--text-3); border: 1px solid rgba(148,163,184,0.12); }

.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.project-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.project-tag {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ==========================================
   ABOUT
   ========================================== */
.about-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  max-width: 720px;
}

.about-text {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.75;
}

.about-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==========================================
   CONTACT
   ========================================== */
.contact-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 600px;
}

.contact-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 220px;
  transition: border-color 0.2s;
}

.contact-card.link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.contact-card.link:hover {
  border-color: var(--border-hover);
}

.contact-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.contact-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.contact-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-arrow {
  color: var(--text-3);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
}

.contact-card.link:hover .contact-arrow {
  transform: translateX(3px);
  color: var(--blue-light);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.footer-logo .dot { color: var(--blue); }

.footer-inner span {
  font-size: 13px;
  color: var(--text-3);
}

/* ==========================================
   DIVIDERS
   ========================================== */
.section + .section {
  border-top: 1px solid var(--border);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .menu-toggle {
    display: flex;
    margin-left: auto;
  }

  .lang-switcher { margin-left: 0; }

  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 90px;
    gap: 32px;
  }

  .hero-content { display: flex; flex-direction: column; align-items: center; }

  .hero-tagline { max-width: 100%; }

  .avatar-wrap { width: 200px; height: 200px; }

  .nuti-card {
    flex-direction: column;
    padding: 36px 28px;
    gap: 32px;
    text-align: center;
  }

  .nuti-tags { justify-content: center; }

  .about-stats { gap: 28px; }

  .section { padding: 64px 0; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 500px) {
  .subjects-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-cards { flex-direction: column; }
}

/* ==========================================
   ANIMATIONS (fade-in on scroll)
   ========================================== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   FOCUS VISIBLE
   ========================================== */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
