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

:root {
  --black: #0d0d0d;
  --white: #f0efe9;
  --gray: #888;
  --green: #c8d5b9;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
}

/* NAV */
nav {
  position: fixed; top: 0; width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 60px;
  z-index: 100;
  transition: background 0.3s, padding 0.3s;
}

nav.scrolled {
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(20px);
  padding: 18px 60px;
  border-bottom: 1px solid #222;
}

.logo-img { height: 32px; filter: invert(1); }

.nav-links { display: flex; gap: 48px; }

.nav-links a {
  color: var(--gray); text-decoration: none;
  font-size: 13px; letter-spacing: 0.08em;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--white);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.menu-icon { font-size: 13px; color: var(--gray); cursor: pointer; display: none; }

/* MOBILE MENU */
.mobile-menu {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  background: var(--black); z-index: 99;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 40px; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}

.mobile-menu.open { opacity: 1; pointer-events: all; }

.mobile-menu a {
  color: var(--white); text-decoration: none;
  font-size: 40px; font-weight: 700;
}

/* SCROLL REVEAL */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-delay {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

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

/* HERO */
.hero-scroll-container {
  height: 250vh;
  position: relative;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 120px 60px 60px;
  overflow: hidden;
  z-index: 2;
}

.hero-line-wrap {
  overflow: hidden;
  line-height: 1;
}

.hero-line {
  font-size: clamp(80px, 13vw, 200px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--white);
  will-change: transform;
}

#line1b, #line2b {
  margin-top: calc(clamp(80px, 13vw, 200px) * -0.95);
}

.hero-tag {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 3;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* PHOTO */
.hero-photo-section {
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(100%);
}

.hero-photo-text {
  position: absolute;
  bottom: 48px;
  left: 60px;
  display: flex;
  gap: 40px;
}

.hero-photo-text span {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* CHATBOT */
.chat-btn {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 56px; height: 56px;
  background: var(--white);
  color: var(--black);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.3s, background 0.3s;
}

.chat-btn:hover, .chat-btn.active { transform: scale(1.1); background: #e0e0e0; }

.chat-window {
  position: fixed;
  bottom: 100px; right: 32px;
  width: 360px;
  background: #1a1a1a;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

.chat-window.open { display: flex; }

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #2a2a2a;
  background: #111;
}

.chat-avatar {
  width: 40px; height: 40px;
  background: var(--white);
  color: var(--black);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}

.chat-name { font-size: 14px; font-weight: 600; color: var(--white); }
.chat-status { font-size: 11px; color: #4CAF50; }

.chat-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--gray); cursor: pointer;
  font-size: 16px; padding: 4px;
}

.chat-messages {
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-msg.bot {
  background: #2a2a2a;
  color: var(--white);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--white);
  color: var(--black);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  display: flex; gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #2a2a2a;
}

.chat-input-area input {
  flex: 1;
  background: #2a2a2a;
  border: none; border-radius: 12px;
  padding: 10px 16px;
  color: var(--white);
  font-size: 14px; font-family: inherit;
  outline: none;
}

.chat-input-area input::placeholder { color: #666; }

.chat-input-area button {
  background: var(--white); color: var(--black);
  border: none; border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer; font-size: 18px;
  font-weight: 700;
  transition: opacity 0.2s;
}

.chat-input-area button:hover { opacity: 0.8; }

/* SECTIONS */
.section { padding: 120px 60px; }
.section-dark { background: #111; }

.section-label {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gray); margin-bottom: 24px;
}

.section-title {
  font-size: clamp(40px, 5vw, 80px);
  font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 80px; line-height: 1.05;
}

/* PROJECTS */
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
}

.project-card {
  text-decoration: none; color: inherit;
  background: #161616; border-radius: 16px;
  overflow: hidden; transition: transform 0.4s ease;
}

.project-card:hover { transform: translateY(-12px); }

.project-img {
  position: relative; overflow: hidden;
  aspect-ratio: 16/10;
}

.project-img img {
  width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.6s ease;
}

.project-card:hover .project-img img { transform: scale(1.05); }

.project-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 500;
  opacity: 0; transition: opacity 0.3s;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-info { padding: 28px; }

.project-tag {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gray);
}

.project-info h3 {
  font-size: 22px; font-weight: 600;
  margin: 10px 0 8px;
}

.project-info p { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* ABOUT */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
}

.about-desc {
  font-size: 17px; line-height: 1.8;
  color: var(--gray); margin-bottom: 40px;
}

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

.skills span {
  padding: 8px 20px; border: 1px solid #333;
  border-radius: 100px; font-size: 13px; color: var(--gray);
  transition: border-color 0.3s, color 0.3s;
}

.skills span:hover { border-color: var(--white); color: var(--white); }

.about-img img {
  width: 100%; border-radius: 16px;
  object-fit: cover; aspect-ratio: 3/4;
  filter: grayscale(20%);
}

/* TIMELINE */
.timeline { display: flex; flex-direction: column; }

.timeline-item {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 40px; padding: 40px 0;
  border-bottom: 1px solid #1e1e1e;
  transition: background 0.3s;
}

.timeline-item:first-child { border-top: 1px solid #1e1e1e; }
.timeline-item:hover { padding-left: 12px; }

.timeline-date { font-size: 13px; color: var(--gray); margin-top: 4px; }

.timeline-content h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.timeline-content p { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* CONTACT */
.contact-section { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
.contact-big { font-size: clamp(50px, 8vw, 120px); line-height: 1; margin-bottom: 60px; }

.contact-links { display: flex; flex-wrap: wrap; gap: 40px; }

.contact-links a {
  color: var(--gray); text-decoration: none;
  font-size: 16px; border-bottom: 1px solid #333;
  padding-bottom: 6px;
  transition: color 0.3s, border-color 0.3s;
}

.contact-links a:hover { color: var(--white); border-color: var(--white); }

/* FOOTER */
footer {
  padding: 40px 60px; border-top: 1px solid #1e1e1e;
  display: flex; justify-content: space-between; align-items: center;
}

footer p { font-size: 13px; color: var(--gray); }

/* RESPONSIVE */
@media (max-width: 900px) {
  nav { padding: 20px 24px; }
  nav.scrolled { padding: 16px 24px; }
  .nav-links { display: none; }
  .menu-icon { display: block; }
  .hero-sticky { padding: 80px 24px 32px; }
  .hero-photo-section { height: 60vh; }
  .section { padding: 80px 24px; }
  .projects-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 32px 24px; }
}
