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

:root {
  --bg:           #f5f5f5;
  --bg-alt:       #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f0f0f0;
  --surface-3:    #e8e8e8;
  --border:       #e0e0e0;
  --text:         #1a1a1a;
  --text-2:       #555555;
  --text-3:       #888888;
  --accent:       #2563eb;
  --accent-2:     #7c3aed;
  --accent-3:     #059669;
  --accent-light: #dbeafe;
  --radius:       0px;
  --shadow:       0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --font:         'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --navbar-h:     96px;
}

html.dark {
  --bg:           #0f1117;
  --bg-alt:       #161b27;
  --surface:      #1a1f2e;
  --surface-2:    #222840;
  --surface-3:    #2a3050;
  --border:       #2e3550;
  --text:         #f0f0f0;
  --text-2:       #a0a8c0;
  --text-3:       #606880;
  --accent:       #3b82f6;
  --accent-2:     #a78bfa;
  --accent-3:     #34d399;
  --accent-light: #1e3a5f;
  --shadow:       0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  transition: background 0.3s, color 0.3s;
}

/* ===== PARTICLES ===== */
#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#particles-js canvas { display: block; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.navbar-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.navbar-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-contacts {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.navbar-contacts a,
#theme-toggle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-decoration: none;
}

.navbar-contacts a:hover { color: var(--accent); border-color: var(--accent); }
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
#theme-toggle .material-symbols-outlined { font-size: 1.1rem; }

.navbar-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.navbar-nav .nav-link {
  padding: 0.65rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.navbar-nav .nav-link:hover { color: var(--accent); }
.navbar-nav .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== BOTTOM BAR ===== */
.bottom-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  padding: 0.5rem 0;
}

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .bottom-bar { display: flex; }
  .navbar-contacts a:nth-child(n+4) { display: none; }
  .navbar-name { font-size: 0.8rem; }
}

.bottom-link {
  display: flex; flex-direction: column; align-items: center;
  color: var(--text-3);
  text-decoration: none;
  padding: 0.4rem 1rem;
  transition: color 0.2s;
}

.bottom-link.active,
.bottom-link:hover { color: var(--accent); }

/* ===== SPA VIEW ===== */
#app-view {
  position: relative;
  z-index: 1;
  padding-top: var(--navbar-h);
  padding-bottom: 4rem;
  min-height: 100dvh;
  opacity: 1;
  transition: opacity 0.18s ease;
}

#app-view.fade-out { opacity: 0; }

@media (max-width: 768px) {
  #app-view { padding-bottom: 5rem; }
}

/* ===== LAYOUT ===== */
.page { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-2);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ===== BENTO GRID ===== */
.bento { display: grid; gap: 1px; background: var(--border); }
.bento-cell {
  background: var(--surface);
  padding: 1.5rem;
  transition: background 0.2s;
}
.bento-cell:hover { background: var(--surface-2); }

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }

/* ===== CERTIFICATIONS ===== */
.cert-card { padding: 0; overflow: hidden; }
.cert-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cert-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.cert-img-placeholder .material-symbols-outlined { font-size: 3rem; }
.cert-body { padding: 1.25rem 1.5rem 1.5rem; }

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  letter-spacing: 0.03em;
}

.badge-accent { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.badge-purple { border-color: var(--accent-2); color: var(--accent-2); background: transparent; }
.badge-green  { border-color: var(--accent-3); color: var(--accent-3); background: transparent; }

/* ===== BUTTON ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); }

/* ===== FORM ===== */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-3); }

/* ===== HOME PAGE ===== */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0 3rem;
  gap: 1rem;
}

.profile-avatar {
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 3rem;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 1.6rem; font-weight: 700; }
.profile-roles { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.25rem; }

/* ===== TECH STACK ===== */
.lang-icons { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.lang-icon {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--text-2); font-weight: 500;
}
.lang-icon img { width: 48px; height: 48px; object-fit: contain; }

.fw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.fw-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.fw-card-name {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.fw-card-img {
  padding: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
  min-height: 90px;
}
.fw-card-img img { height: 52px; object-fit: contain; }
.fw-card-desc { padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--text-2); border-bottom: 1px solid var(--border); flex: 1; }
.fw-card-badges { padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ===== REALISATIONS ===== */
.project-list { display: grid; gap: 5rem; }

.project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.project-row:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }

.project-arrow {
  justify-self: center;
  display: flex; align-items: center; justify-content: center;
  height: 24px;
  margin: -2rem 0;
  color: var(--accent);
  animation: arrow-float 1.6s ease-in-out infinite;
}
.project-arrow .material-symbols-outlined { font-size: 1.5rem; }

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

.carousel {
  position: relative;
  overflow: hidden;
  height: 420px;
  max-height: 60vh;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.carousel-track { display: flex; height: 100%; transition: transform 0.35s ease; }
.carousel-slide {
  width: 100%; height: 100%; flex-shrink: 0;
  object-fit: contain;
  background: var(--surface-2);
}
.carousel-placeholder {
  width: 100%; height: 100%; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center; justify-content: center;
  color: var(--text-3); font-size: 0.85rem;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.carousel-btn:hover { color: var(--accent); border-color: var(--accent); }
.carousel-prev { left: 0.5rem; }
.carousel-next { right: 0.5rem; }
.carousel-dots {
  position: absolute; bottom: 0.6rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.4rem;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: none; padding: 0;
  background: var(--text-3); opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.carousel-dot.active { background: var(--accent); opacity: 1; }

.project-body { padding: 1.25rem 0.5rem 0.5rem; }
.project-name {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.project-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--accent);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.project-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
.project-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  margin-top: 1rem;
  line-height: 1.75;
  max-width: 70ch;
  animation: project-fade-in 0.5s ease both;
}
.project-desc ul { margin: 0.6rem 0 0.6rem 1.1rem; padding: 0; display: grid; gap: 0.3rem; }
.project-desc li { padding-left: 0.25rem; }
.project-desc li::marker { color: var(--accent); }
@keyframes project-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== TOOL CARDS ===== */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.tool-card:hover { box-shadow: var(--shadow-md); }
.tool-card-header { display: flex; align-items: center; gap: 1rem; }
.tool-icon {
  width: 44px; height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent-2);
}
.tool-name { font-weight: 700; font-size: 1rem; font-family: var(--font-mono); }
.tool-lang { font-size: 0.75rem; color: var(--text-3); margin-top: 0.2rem; }
.tool-desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.65; }
.tool-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tool-footer { margin-top: auto; padding-top: 0.5rem; border-top: 1px solid var(--border); }

/* ===== CONTACT ===== */
.social-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.social-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.social-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 2.5rem 0; }

/* ===== GRID HELPERS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grid-fw   { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .project-row { grid-template-columns: 1fr; }
  .carousel { height: 260px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar-name { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }

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

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}
