/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #0a0d11;
  --bg-alt: #12161b;
  --surface: #181d24;
  --border: #2b313b;
  --text: #eef1f3;
  --text-muted: #9ea7b2;
  --accent: #3ddc97;
  --accent-dim: #2fae7a;
  --accent-glow: rgba(61, 220, 151, 0.18);
  --accent-secondary: #38bdf8;
  --font-sans: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", Verdana, sans-serif;
  --max-width: 1100px;
  --radius: 10px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em 0;
  font-weight: 700;
}

p {
  margin: 0 0 1em 0;
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  scroll-margin-top: 70px;
}

.section-alt {
  background: var(--bg-alt);
}

.section-eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5em;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 2rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.85em 1.8em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #06110c;
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 0.3em 0;
  transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 70px;
  background:
    radial-gradient(ellipse at top left, var(--accent-glow), transparent 60%),
    var(--bg);
}

.hero-content {
  text-align: center;
  max-width: 720px;
}

.hero-name {
  color: var(--accent-secondary);
  font-size: clamp(1.265rem, 2.3vw, 1.61rem);
  font-weight: 600;
  margin-bottom: 0.5em;
}

.eyebrow {
  color: var(--accent);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1em;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin-bottom: 0.4em;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2em;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-indicator span {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-bounce 1.6s infinite;
}

@keyframes scroll-bounce {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.highlight-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.highlight-number {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.highlight-card h3 {
  font-size: 1.05rem;
  margin-top: 0.4em;
}

.highlight-card p {
  margin: 0;
  font-size: 0.9rem;
}

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.skill-category {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-list li {
  padding: 0.3em 0;
  color: var(--text);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.skill-list li:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.42rem;
  top: 0.3rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
}

.timeline-current .timeline-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5em;
}

.timeline-content h3 {
  font-size: 1.15rem;
  margin-bottom: 0.2em;
}

.timeline-org {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.4em;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.contact-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-links li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-links a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
}

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

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5em;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75em 1em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Chat widget
   ========================================================================== */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
}

.chat-panel {
  width: min(360px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-header {
  padding: 1em 1.25em;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
}

.chat-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

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

.chat-close svg {
  width: 20px;
  height: 20px;
}

.chat-title {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.chat-subtitle {
  margin: 0.2em 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1em 1.25em;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.chat-message {
  max-width: 85%;
  padding: 0.6em 0.9em;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-message-bot {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-message-user {
  align-self: flex-end;
  background: var(--accent-secondary);
  color: #05161f;
}

.chat-message-error {
  align-self: flex-start;
  background: transparent;
  border: 1px solid #7a2a2a;
  color: #e08a8a;
}

.chat-message-pending {
  align-self: flex-start;
  color: var(--text-muted);
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 0.5em;
  padding: 0.75em;
  border-top: 1px solid var(--border);
}

.chat-input-row input {
  flex: 1;
  padding: 0.6em 0.9em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.chat-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-send {
  padding: 0.6em 1.1em;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .chat-panel {
    width: calc(100vw - 24px);
  }
}

.form-feedback {
  margin: 1em 0 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.form-feedback.success {
  color: var(--accent);
}

.form-feedback.error {
  color: #e5484d;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-content {
  text-align: center;
}

.footer-content p {
  margin: 0;
  font-size: 0.85rem;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 800px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 24px;
    gap: 1.2rem;
    transform: translateY(-150%);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .section {
    padding: 70px 0;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}
