/* =========================================
   Base Styles & CSS Custom Properties
   ========================================= */

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

:root {
  --bg: #080810;
  --bg-chat: #0c0c18;
  --text-primary: #e8e8e8;
  --text-secondary: #888;
  --text-tertiary: #666;
  --accent: #00d2b4;
  --accent-subtle: rgba(0, 210, 180, 0.06);
  --accent-subtle-2: rgba(99, 102, 241, 0.06);
}

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

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: auto;
}

/* =========================================
   Content Column
   ========================================= */

.content-column {
  max-width: 1000px;
  margin: 0 auto;
}

/* =========================================
   Hero Section
   ========================================= */

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 80px 24px 48px;
  overflow: hidden;
}

.hero-label {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 3px;
  font-weight: 500;
  font-variant: small-caps;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--text-primary);
  margin-top: 8px;
  line-height: 1.2;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 24px auto 0;
}

/* Hero Chat Panel */
.hero-chat-panel {
  max-width: 640px;
  width: 100%;
  margin-top: 32px;
  border-radius: 16px;
  border: 1px solid #333;
  background: rgba(12, 12, 24, 0.8);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  position: relative;
  z-index: 2;
}

.hero-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-chat-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.hero-chat-header-text {
  display: flex;
  flex-direction: column;
}

.hero-chat-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.hero-chat-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stat {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.hero-stat-sep {
  width: 1px;
  height: 16px;
  background: var(--text-tertiary);
}

/* Scroll Hint */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  animation: scroll-bounce 2s infinite ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scroll-hint-text {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-tertiary);
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Ambient Glow */
.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 180, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* =========================================
   Section Shared Styles + About + Skills
   ========================================= */

section {
  padding: 48px 10vw;
}

.content-column section {
  padding: 48px 24px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 3px;
  margin-bottom: 24px;
}

/* About Section */
.about-row {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.about-text {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text-primary);
  max-width: 600px;
  line-height: 1.8;
  flex: 1;
}

.about-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(0, 210, 180, 0.3);
  box-shadow: 0 0 40px rgba(0, 210, 180, 0.1);
  flex-shrink: 0;
}

.stats-bar {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}

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

.stat-item-value {
  display: flex;
  align-items: baseline;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 200;
  color: var(--accent);
  line-height: 1;
}

.stat-suffix {
  font-size: 2rem;
  font-weight: 200;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  max-width: 140px;
}

/* =========================================
   Career Journey Timeline
   ========================================= */

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--text-tertiary));
}

.timeline-chapter {
  position: relative;
  margin-bottom: 48px;
  padding-left: 24px;
}

.timeline-chapter::before {
  content: '';
  position: absolute;
  left: calc(-31px - var(--dot-size, 12px) / 2);
  top: 6px;
  width: var(--dot-size, 12px);
  height: var(--dot-size, 12px);
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-chapter:last-child {
  margin-bottom: 0;
}

.timeline-date {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-hook {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.timeline-highlights {
  list-style: none;
  padding: 0;
}

.timeline-highlights li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
  line-height: 1.5;
}

.timeline-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-secondary);
}

/* =========================================
   Case Study Cards
   ========================================= */

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.case-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--text-tertiary);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.case-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 210, 180, 0.08);
}

.case-card.open {
  border-color: var(--accent);
}

.case-number {
  font-size: 2rem;
  font-weight: 200;
  color: var(--accent);
  margin-bottom: 12px;
}

.case-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.case-teaser {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.case-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
}

.case-card.open .case-detail {
  max-height: 500px;
  margin-top: 20px;
}

.case-section {
  margin-bottom: 16px;
}

.case-section:last-child {
  margin-bottom: 0;
}

.case-label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 4px;
}

.case-section p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =========================================
   Builds / Projects Grid
   ========================================= */

.builds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.builds-grid > .case-card {
  display: flex;
  flex-direction: column;
}

.builds-grid > .case-card > .case-teaser {
  margin-bottom: 20px;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tech-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  letter-spacing: 0.5px;
}

.chat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 12px;
}
.chat-trigger:hover {
  background: var(--accent);
  color: var(--bg);
}
.chat-trigger svg { flex-shrink: 0; }
.case-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 12px;
}
.case-link:hover {
  background: var(--accent);
  color: var(--bg);
}
.case-link svg { flex-shrink: 0; }
.case-link.coming-soon {
  border-color: var(--text-muted);
  color: var(--text-muted);
  cursor: default;
}
.case-link.coming-soon:hover {
  background: transparent;
  color: var(--text-muted);
}

/* =========================================
   Leadership Philosophy
   ========================================= */

.philosophy-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 600px;
}

.philosophy-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.philosophy-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
}

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

.philosophy-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

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

.skill-group-label {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 2px;
}

.skill-group-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.skill-icon {
  color: var(--accent);
  display: flex;
  margin-bottom: 4px;
}

.cv-download {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent) !important;
  font-size: 12px;
  letter-spacing: 1px;
  transition: background 0.15s ease, color 0.15s ease;
}

.cv-download:hover {
  background: var(--accent);
  color: var(--bg) !important;
}

.skill-separator {
  width: 1px;
  height: 36px;
  background: var(--text-tertiary);
  align-self: center;
}

/* =========================================
   Chat Styles (shared between hero and float)
   ========================================= */

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: 300px;
}

.chat-messages:empty {
  display: flex;
}

.chat-msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.chat-msg.user {
  align-self: flex-end;
  background: rgba(0, 210, 180, 0.12);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

#chat-suggestions.fade {
  opacity: 0;
}

.chip {
  background: rgba(0, 210, 180, 0.08);
  border: 1px solid rgba(0, 210, 180, 0.2);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 24px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.chip:hover {
  background: rgba(0, 210, 180, 0.15);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--text-tertiary);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-input::placeholder {
  color: var(--text-tertiary);
}

#chat-send {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  transition: opacity 0.15s ease;
}

#chat-send:hover {
  opacity: 0.85;
}

#chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================
   Chat Markdown + Typing Indicator
   ========================================= */

.chat-msg.assistant code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.chat-msg.assistant pre {
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 6px 0;
}

.chat-msg.assistant pre code {
  background: none;
  padding: 0;
}

.chat-msg.assistant ul {
  margin: 4px 0;
  padding-left: 18px;
}

.chat-msg.assistant li {
  margin: 2px 0;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

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

/* =========================================
   Floating Chat Pill + Panel
   ========================================= */

.chat-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 210, 180, 0.3);
  z-index: 300;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.chat-pill:hover {
  transform: scale(1.05);
}

.chat-float-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 400px;
  max-height: 500px;
  background: rgba(12, 12, 24, 0.95);
  border: 1px solid #333;
  border-radius: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.chat-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-float-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.chat-float-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.chat-float-close:hover {
  color: var(--text-primary);
}

/* When chat is inside float panel, constrain messages height */
.chat-float-panel .chat-messages {
  max-height: 280px;
}

/* =========================================
   Scroll Reveal Animations
   ========================================= */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.hero-animate {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* =========================================
   Contact + Footer
   ========================================= */

.contact-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.contact-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  transition: color 0.15s ease;
}

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

.contact-separator {
  width: 1px;
  height: 16px;
  background: var(--text-tertiary);
}

footer {
  padding: 32px 24px;
  border-top: 1px solid var(--text-tertiary);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 900px) {
  #hero {
    padding: 60px 16px 48px;
    min-height: auto;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-chat-panel {
    padding: 16px;
  }

  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .scroll-hint {
    display: none;
  }

  .content-column section {
    padding: 60px 16px;
  }

  /* About: photo stacks above text */
  .about-row {
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
  }

  .about-photo {
    width: 160px;
    height: 160px;
  }

  .about-text {
    text-align: center;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-chapter {
    padding-left: 16px;
  }

  .philosophy-block {
    flex-direction: column;
    gap: 12px;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .skill-separator {
    display: none;
  }

  .skills-grid {
    flex-direction: column;
    gap: 16px;
  }

  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .contact-separator {
    display: none;
  }

  /* Floating panel: full width on mobile */
  .chat-float-panel {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 80px;
    max-height: 60vh;
  }

  .chat-pill {
    right: 16px;
    bottom: 16px;
  }
}
