/* --- Variables --- */
:root {
  --bg: #0a0e12;
  --bg-card: #141a21;
  --bg-alt: #0f1419;
  --text: #e8eef4;
  --text-muted: #8896a6;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-soft: rgba(6, 182, 212, 0.18);
  --accent-glow: rgba(6, 182, 212, 0.25);
  --border: #1e2832;
  --radius: 14px;
  --radius-lg: 22px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

/* Scroll-in animation: sections fade + slide up when they enter viewport */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Skip link: hidden until focused (accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  text-decoration: none;
}

/* Focus visible for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  text-decoration: none;
}

button:focus-visible {
  outline-offset: 4px;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 1.5rem;
  background: rgba(10, 14, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s, transform 0.2s;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
  transform: scale(1.05);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
  opacity: 1;
}

.nav a {
  transition: color 0.2s, opacity 0.2s;
}

.nav-cta {
  color: var(--accent) !important;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  background: var(--accent-soft);
  text-decoration: none;
  box-shadow: 0 0 20px var(--accent-soft);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

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

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    padding: 0.75rem;
    border-radius: var(--radius);
  }
}

/* --- Main --- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* --- Hero --- */
.hero {
  padding: 3rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero-profile {
  margin-bottom: 1.25rem;
  position: relative;
}

.hero-profile::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(32px);
  opacity: 0.8;
  pointer-events: none;
}

.hero-avatar {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  display: block;
  margin: 0 auto 0.75rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  position: relative;
}

.hero-avatar:hover {
  border-color: var(--accent);
  box-shadow: 0 0 36px var(--accent-soft), 0 0 60px rgba(6, 182, 212, 0.1);
  transform: scale(1.02);
}

.hero-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-social-link {
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.hero-social-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-2px);
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.hero-roles {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-roles .dot {
  margin: 0 0.5rem;
  opacity: 0.6;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 60%, rgba(6, 182, 212, 0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 1rem;
}

.hero-bio {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.hero-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s;
}

.hero-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-soft);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

/* --- Explore cards --- */
.explore {
  padding: 2rem 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 1px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-soft);
  background: rgba(20, 26, 33, 0.95);
}

.card-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Sections --- */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--bg-alt);
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: max(1.5rem, calc(50vw - 450px));
  padding-right: max(1.5rem, calc(50vw - 450px));
  position: relative;
}

.section-alt::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  opacity: 0.6;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  max-width: 480px;
}

/* --- Timeline (Experience) --- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.timeline-item h3 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.company {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.timeline-item p:last-child {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 600px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-year {
    margin-bottom: 0.25rem;
  }
}

/* --- Projects --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.project-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), 0 0 24px var(--accent-soft);
  transform: translateY(-2px);
}

.project-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.project-link:hover {
  text-decoration: none;
}

/* --- Article list --- */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  border-bottom: 1px solid var(--border);
}

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

.article-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0;
  color: var(--text);
  text-decoration: none;
}

.article-list a {
  transition: color 0.2s, padding-left 0.2s;
}

.article-list a:hover {
  color: var(--accent);
  text-decoration: none;
  padding-left: 0.5rem;
}

.article-list strong {
  font-size: 1rem;
}

.article-list span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Open Source (Personal + Contributions) --- */
.opensource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.opensource-block {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.opensource-block:hover {
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.opensource-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.opensource-cta {
  margin-top: 1.75rem;
  margin-bottom: 0;
  text-align: center;
}

.opensource-cta .btn {
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
}

/* --- Certificates --- */
.certificates-section .section-desc {
  margin-bottom: 2rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.cert-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
}

.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.cert-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--accent-soft);
  transform: translateY(-4px);
}

.cert-card:hover::before {
  opacity: 1;
}

.cert-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.cert-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  color: var(--text);
}

.cert-issuer {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 0.5rem;
}

.cert-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cert-note {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* --- Fiverr Reviews --- */
.reviews-section .section-desc {
  margin-bottom: 2rem;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.review-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
}

.review-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--accent-soft);
  transform: translateY(-3px);
}

.review-stars {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 1rem;
}

.review-stars .star {
  color: #fbbf24;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.review-quote {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 1rem;
  flex: 1;
  font-style: normal;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.review-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.review-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1dbf73;
  padding: 0.25rem 0.6rem;
  background: rgba(29, 191, 115, 0.12);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.review-badge:hover {
  background: rgba(29, 191, 115, 0.2);
  color: #1dbf73;
  text-decoration: none;
}

.reviews-cta {
  margin-top: 2rem;
  margin-bottom: 0;
  text-align: center;
}

.reviews-cta .btn {
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
}

/* --- Coming soon --- */
.coming-soon {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* --- Contact --- */
.contact {
  text-align: center;
  padding: 3.5rem 0;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  filter: blur(48px);
  opacity: 0.5;
  pointer-events: none;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.contact-link {
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
}

.contact-link {
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: scale(1.05);
}

.contact-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 1.5rem;
  border-radius: 1px;
  opacity: 0.5;
}

.footer p {
  margin: 0;
}
