/* ============================================
   HERO — Mobile First
   ============================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
}

.hero__content {
  max-width: 800px;
  will-change: transform, opacity;
}

.hero__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
}

.hero__separator {
  color: var(--text-accent);
  margin: 0 6px;
  opacity: 0.5;
}

.hero__tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__scroll {
  position: absolute;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: var(--accent-gradient);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================
   ABOUT — Mobile First
   ============================================ */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.about__text p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.about__lead {
  font-size: 1.1rem !important;
  color: var(--text-primary) !important;
  font-weight: 500;
  margin-bottom: 20px !important;
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card__number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ============================================
   TIMELINE — Mobile First
   ============================================ */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline__line {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
}

.timeline__item {
  position: relative;
  padding-left: 40px;
  padding-bottom: 36px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--timeline-dot);
  box-shadow: 0 0 0 4px var(--bg-primary), 0 0 20px rgba(var(--particle-primary), 0.3);
  z-index: 1;
}

.timeline__card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.3s ease;
}

.timeline__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.timeline__role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline__company {
  font-size: 0.85rem;
  color: var(--text-accent);
  margin-top: 2px;
}

.timeline__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline__progression {
  font-size: 0.75rem;
  color: var(--text-accent);
  margin-top: 4px;
  font-weight: 500;
  opacity: 0.8;
}

.timeline__list { list-style: none; }
.timeline__list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.5;
}

/* ============================================
   SKILLS — Mobile First
   ============================================ */
.skills__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.skills__category {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.3s ease;
}

.skills__category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 12px;
}
.skills__category-title svg { flex-shrink: 0; opacity: 0.7; }

.skills__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-block;
  padding: 5px 12px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--chip-text);
  transition: all 0.25s ease;
}

/* ============================================
   PROJECTS — Mobile First
   ============================================ */
.projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 22px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card--featured {
  border-color: var(--border-accent);
}
.project-card--featured::before { opacity: 0.5; }

.project-card__badge {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.project-card__tech span {
  padding: 3px 9px;
  background: var(--chip-bg);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--chip-text);
  font-weight: 500;
}

.project-card__demo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   CHAT — Mobile First
   ============================================ */
.chat {
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  /* Mobile: fixed width, responsive height */
  width: calc(100vw - 32px);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  height: min(520px, 65vh);
}

.chat__messages {
  padding: 14px;
  flex: 1;
  min-height: 0; /* flex child scrolling fix */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat__message {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: messageIn 0.3s ease;
}

.chat__message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat__avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--accent-gradient);
  color: var(--bg-primary);
}

.chat__message--user .chat__avatar {
  background: var(--text-muted);
  color: var(--bg-primary);
}

.chat__bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
}

.chat__message--ai .chat__bubble {
  background: var(--chat-ai-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-top-left-radius: 4px;
}

.chat__message--user .chat__bubble {
  background: var(--chat-user-bg);
  color: var(--text-primary);
  border-top-right-radius: 4px;
}

.chat__suggestions {
  padding: 0 16px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  scrollbar-width: none;
}
.chat__suggestions::-webkit-scrollbar { display: none; }

.chat__suggestion-chip {
  padding: 8px 14px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 16px;
  font-size: 0.75rem;
  color: var(--chip-text);
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat__input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
  flex-shrink: 0;
}

.chat__input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chat__input {
  width: 100%;
  padding: 12px 50px 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 16px; /* prevents iOS zoom */
  outline: none;
  transition: border-color 0.3s ease;
  min-height: 48px;
  -webkit-appearance: none;
}
.chat__input:focus { border-color: var(--border-accent); }
.chat__input::placeholder { color: var(--text-muted); }

.chat__char-count {
  position: absolute;
  right: 10px;
  font-size: 0.6rem;
  color: var(--text-muted);
  pointer-events: none;
}

.chat__send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: var(--bg-primary);
  transition: all 0.3s ease;
}
.chat__send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat__typing { display: flex; gap: 4px; padding: 8px 0; }
.chat__typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.4s infinite;
}
.chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.chat__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CONTACT — Mobile First
   ============================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.contact__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 48px;
}

.contact__card svg { color: var(--text-accent); }

.contact__label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contact__value {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
}

.contact__note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   SECURITY & PERFORMANCE — Mobile First
   ============================================ */
.security__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.security__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.security__icon {
  color: var(--text-accent);
  margin-bottom: 14px;
}

.security__card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.security__grade {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  line-height: 1;
}

.security__desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.security__link {
  font-size: 0.78rem;
  color: var(--text-accent);
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 32px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   TABLET+ (768px)
   ============================================ */
@media (min-width: 768px) {
  .hero__name { font-size: 4rem; }
  .hero__title { font-size: 1.2rem; }
  .hero__tagline { font-size: 0.85rem; margin-bottom: 40px; }
  .hero__actions { flex-direction: row; justify-content: center; gap: 16px; }
  .hero__scroll { bottom: 36px; }

  .about__grid { grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .about__lead { font-size: 1.2rem !important; }

  .timeline__line { left: 18px; }
  .timeline__item { padding-left: 52px; padding-bottom: 44px; }
  .timeline__dot { left: 11px; }
  .timeline__header { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; }
  .timeline__card { padding: 24px; }
  .timeline__role { font-size: 1.1rem; }
  .timeline__list li { font-size: 0.9rem; }

  .skills__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .skills__category { padding: 24px; }

  .projects__grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .project-card--featured { grid-column: 1 / -1; }
  .project-card { padding: 26px; }

  .chat { width: auto; height: 560px; }
  .chat__messages { padding: 20px; }
  .chat__input { font-size: 0.9rem; padding: 14px 50px 14px 16px; }
  .chat__message { max-width: 85%; }
  .chat__suggestions { flex-wrap: wrap; overflow-x: visible; }

  .contact__grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

  .security__grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* ============================================
   DESKTOP (1024px)
   ============================================ */
@media (min-width: 1024px) {
  .hero__name { font-size: 5.5rem; }
  .hero__title { font-size: 1.4rem; }
  .hero__tagline { font-size: 0.95rem; }

  .about__grid { gap: 60px; }
  .about__stats { gap: 20px; align-content: center; }
  .stat-card { padding: 28px 20px; }
  .stat-card__number { font-size: 2.5rem; }
  .stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
  }

  .timeline__card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
  }

  .skills__grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .skills__category:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
  }
  .chip:hover {
    background: var(--chip-hover-bg);
    border-color: var(--border-accent);
    transform: translateY(-1px);
  }

  .projects__grid { gap: 24px; }
  .project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
  }
  .project-card:hover::before { opacity: 1; }

  .chat__messages { padding: 24px; max-height: 450px; }

  .security__grid { grid-template-columns: repeat(4, 1fr); }

  .contact__card:hover,
  .security__card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
  }

  .chat__send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
  }

  .chat__suggestion-chip:hover {
    background: var(--chip-hover-bg);
    border-color: var(--border-accent);
  }
}
