/* ── FONTS ── */
@font-face {
  font-family: 'TT Firs Neue';
  src: url('fonts/tt-firs-neue-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'TT Firs Neue';
  src: url('fonts/tt-firs-neue-demibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

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

:root {
  --bg: #000;
  --card-bg: #111;
  --card-bg-hover: #161616;
  --text: #fff;
  --text-dim: rgba(255,255,255,0.55);
  --radius: 20px;
  --gap: 10px;
  --font: 'TT Firs Neue', system-ui, -apple-system, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  height: 72px;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #222;
  overflow: hidden;
  flex-shrink: 0;
}

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

.header-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-name .name {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.header-name .role {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-clock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #111;
  border-radius: 36px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 400;
  max-width: 240px;
  margin: 0 auto;
}

#clock-time { color: var(--text); }
#clock-date { color: var(--text-dim); }

.menu-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.2);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
  transition: border-color 0.2s;
}

.menu-btn:hover { border-color: rgba(255,255,255,0.5); }

.menu-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── NAV OVERLAY ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.nav-overlay.open { opacity: 1; pointer-events: all; }

.nav-overlay a {
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── PAGE WRAPPER ── */
.page {
  padding: 12px;
}

/* ── HOME GRID ── */
.home-grid {
  display: grid;
  grid-template-columns: 265px 1fr 370px;
  grid-template-areas:
    "bio    projects  stack"
    "bio    center-b  video";
  gap: var(--gap);
}

.bio-col {
  grid-area: bio;
  display: flex;
  flex-direction: column;
  padding: 4px 8px 4px 4px;
}

.bio-col p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
}

.cv-btn {
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 400;
  font-family: var(--font);
  margin-top: 4px;
  width: fit-content;
  transition: border-color 0.2s, background 0.2s;
}

.cv-btn:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05);
}

.social-links {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.social-btn:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
}

.social-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.25s ease;
}

.card:hover { transform: scale(1.003); }

.arrow-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  z-index: 2;
  transition: transform 0.25s;
}

.card:hover .arrow-btn { transform: rotate(45deg); }

/* Projects card */
.projects-card {
  grid-area: projects;
  min-height: 540px;
}

.projects-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  gap: 0;
  overflow: hidden;
}

.mosaic-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: scroll-up 20s linear infinite;
}

.mosaic-col:nth-child(2) {
  animation: scroll-down 22s linear infinite;
}

.mosaic-col:nth-child(3) {
  animation: scroll-up 18s linear infinite;
}

@keyframes scroll-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes scroll-down {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.mosaic-col img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.projects-label {
  position: absolute;
  bottom: 20px;
  left: 24px;
  font-size: 30px;
  font-weight: 600;
  z-index: 2;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}

/* Stack card */
.stack-card {
  grid-area: stack;
  min-height: 310px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.stack-icons-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-bottom: 40px;
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tool-icon img { width: 34px; height: 34px; object-fit: contain; }

/* Video card */
.video-card {
  grid-area: video;
  min-height: 265px;
  background: #0a0a0a;
}

.video-inner {
  position: absolute;
  inset: 0;
}

.video-inner iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius);
}

.video-label {
  position: absolute;
  bottom: 14px;
  left: 20px;
  font-size: 18px;
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}

/* Center bottom */
.center-bottom {
  grid-area: center-b;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.contacts-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.backlog-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.globe-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
}

.globe-wrap img {
  width: 100%;
  max-width: 220px;
  opacity: 0.7;
}

canvas#globe { display: block; }

.qr-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-wrap svg { max-width: 120px; }

/* ── PROJECTS PAGE ── */
.projects-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--gap);
}

.projects-list { display: flex; flex-direction: column; gap: var(--gap); }

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, transform 0.15s;
  position: relative;
  min-height: 96px;
}

.project-card:hover { background: var(--card-bg-hover); transform: translateX(2px); }

.project-thumb {
  width: 90px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1a;
}

.project-info { flex: 1; min-width: 0; }

.project-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.project-tag {
  font-size: 12px;
  color: var(--text-dim);
}

.project-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.project-card:hover .project-arrow { background: rgba(255,255,255,0.15); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: var(--gap); }

.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.sidebar-card .card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ── STACK PAGE ── */
.stack-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--gap);
}

.stack-list-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-radius: 12px;
  transition: background 0.15s;
}

.stack-item:hover { background: rgba(255,255,255,0.04); }

.stack-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.stack-item-icon img { width: 28px; height: 28px; object-fit: contain; }
.stack-item-name { font-size: 16px; font-weight: 400; }

/* ── PAGE HEADING ── */
.page-heading {
  font-size: 34px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "projects"
      "bio"
      "stack"
      "center-b"
      "video";
  }
  .bio-col { padding: 16px 0; }
  .projects-page, .stack-page { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
