@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --bg: #080b12;
  --surface: #112240;
  --accent: #e8622a;
  --text: #ccd6f6;
  --heading: #e6f1ff;
  --muted: #8892b0;
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --accent: #c44d1a;
  --text: #334155;
  --heading: #1e293b;
  --muted: #64748b;
}

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

html { transition: background var(--transition), color var(--transition); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

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

/* ---- Background blobs ---- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.bg-blobs span:nth-child(1) {
  width: 500px;
  height: 500px;
  top: -10%;
  left: -10%;
  background: #e8622a;
  opacity: 0.12;
  animation: drift1 32s ease-in-out infinite;
}
.bg-blobs span:nth-child(2) {
  width: 420px;
  height: 420px;
  bottom: -10%;
  right: -8%;
  background: #7c3aed;
  opacity: 0.1;
  animation: drift2 28s ease-in-out infinite;
}

[data-theme="light"] .bg-blobs span:nth-child(1) { opacity: 0.06; }
[data-theme="light"] .bg-blobs span:nth-child(2) { opacity: 0.05; }

@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40px, 30px) scale(1.06); }
  66%  { transform: translate(-20px, 50px) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-35px, -25px) scale(1.04); }
  66%  { transform: translate(20px, -40px) scale(1.08); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ---- Theme toggle ---- */
#theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  border-radius: 8px;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  z-index: 100;
}
#theme-toggle:hover {
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
#theme-toggle svg { width: 18px; height: 18px; }

/* ---- Shared ---- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ---- Hero (index.html) ---- */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.4rem;
  padding: 4rem 2rem;
  text-align: center;
}

.hero > * {
  animation: fadeUp 0.5s ease both;
}
.hero > *:nth-child(1) { animation-delay: 0.1s; }
.hero > *:nth-child(2) { animation-delay: 0.2s; }
.hero > *:nth-child(3) { animation-delay: 0.3s; }
.hero > *:nth-child(4) { animation-delay: 0.4s; }
.hero > *:nth-child(5) { animation-delay: 0.5s; }
.hero > *:nth-child(6) { animation-delay: 0.6s; }
.hero > *:nth-child(7) { animation-delay: 0.7s; }

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

.profile-ring {
  padding: 4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 25%, transparent);
}

.profile-photo {
  display: block;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-text { display: flex; flex-direction: column; gap: 0.5rem; }

.name {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.15;
}
.name::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width 0.4s ease;
  margin-top: 4px;
}
.name:hover::after { width: 100%; }

.subtitle {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  min-height: 1.7em;
}

.subtitle-cursor::after {
  content: '|';
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-blurb {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 480px;
}

/* ---- Skill chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 360px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  letter-spacing: 0.04em;
  transition: background var(--transition), box-shadow var(--transition);
}
.chip:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 20%, transparent);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-icons {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}
.social-icons a {
  color: var(--muted);
  display: flex;
  transition: color var(--transition), transform var(--transition);
}
.social-icons a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}
.social-icons svg { width: 22px; height: 22px; }

/* ---- About page ---- */
.page-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  max-width: 760px;
  margin: 0 auto;
}

.back-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

.about-content {
  position: relative;
  z-index: 1;
  max-width: 740px;
  margin: 0 auto;
  padding: 1rem 2rem 6rem;
}

.about-content > h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--heading);
  margin: 1rem 0 2.5rem;
  line-height: 1.2;
}

.about-intro {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

/* ---- Section headings ---- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::before {
  content: '▸';
  font-size: 0.65rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

.tl-item {
  position: relative;
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.tl-item.visible {
  opacity: 1;
  transform: translateX(0);
}
.tl-item:nth-child(1) { transition-delay: 0.05s; }
.tl-item:nth-child(2) { transition-delay: 0.15s; }
.tl-item:nth-child(3) { transition-delay: 0.25s; }
.tl-item:nth-child(4) { transition-delay: 0.35s; }
.tl-item:nth-child(5) { transition-delay: 0.45s; }
.tl-item:nth-child(6) { transition-delay: 0.55s; }

.tl-item:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 8%, transparent);
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -1.875rem;
  top: 1.4rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tl-item:hover::before {
  transform: scale(1.35);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* pulsing dot on first (current) role */
.tl-item:first-child::before {
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50%       { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.tl-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.tl-company {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--heading);
  transition: color 0.2s ease;
}
.tl-item:hover .tl-company { color: var(--accent); }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0.8;
}

.tl-role {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
  font-style: italic;
}

.tl-bullets {
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.93rem;
}
.tl-bullets li {
  margin-bottom: 0.3rem;
  position: relative;
}
.tl-bullets li::marker { color: var(--accent); }

/* ---- Skills grid ---- */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}
.skills-grid.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Education / certs ---- */
.edu-block {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.edu-block.visible {
  opacity: 1;
  transform: translateY(0);
}
.edu-block + .edu-block { margin-top: 1.25rem; }

.edu-block strong {
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 600;
}
.edu-block span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 0.5rem;
}
.edu-block p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

.about-cta {
  margin-top: 3.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
.about-cta.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero { gap: 1.2rem; padding: 3rem 1.5rem; }
  .profile-photo { width: 120px; height: 120px; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .about-content { padding: 1rem 1.5rem 4rem; }
  .page-header { padding: 1.25rem 1.5rem; }
  .tl-date { font-size: 0.68rem; }
}
