:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --card: #ffffff;
  --border: #e1e6eb;
  --text: #1f2430;
  --text-muted: #5b6470;
  --accent: #1f7a3d;
  --accent-dim: #16632f;
  --accent-soft: rgba(31, 122, 61, 0.08);
  --accent-border: rgba(31, 122, 61, 0.3);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width 0.1s linear;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(16, 24, 40, 0.08);
}

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

.logo {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
}

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

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 160px 0 100px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 10%, rgba(31, 122, 61, 0.07), transparent),
    var(--bg);
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(31, 122, 61, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 122, 61, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 1;
  pointer-events: none;
}

.blob-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: #34d399;
  animation: blobFloat 16s ease-in-out infinite;
}

.blob-2 {
  width: 360px;
  height: 360px;
  top: 60px;
  right: -120px;
  background: #3b82f6;
  animation: blobFloat 20s ease-in-out infinite reverse;
}

.blob-3 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: 40%;
  background: var(--accent);
  animation: blobFloat 24s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ---------- Staggered entrance ---------- */
.fade-up {
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero .fade-up:nth-child(1) { animation-delay: 0.05s; }
.hero .fade-up:nth-child(2) { animation-delay: 0.15s; }
.hero .fade-up:nth-child(3) { animation-delay: 0.25s; }
.hero .fade-up:nth-child(4) { animation-delay: 0.35s; }
.hero .fade-up:nth-child(5) { animation-delay: 0.45s; }
.hero .fade-up:nth-child(6) { animation-delay: 0.55s; }

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

.hero-photo {
  display: inline-block;
  margin-bottom: 24px;
}

.hero-photo img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.15);
  display: block;
}

.hero-photo-fallback {
  display: none;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--accent);
  border: 4px solid var(--accent);
}

.hero-eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 780px;
  margin-bottom: 8px;
}

.accent {
  background: linear-gradient(90deg, var(--accent), #34d399, #3b82f6, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.hero-typed {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--accent);
  min-height: 1.6em;
  margin-bottom: 14px;
}

.typed-caret {
  display: inline-block;
  width: 2px;
  background: var(--accent);
  animation: caretBlink 0.9s step-end infinite;
}

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

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(31, 122, 61, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 10px 24px rgba(31, 122, 61, 0.4);
}

.btn:hover::after {
  left: 130%;
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(31, 122, 61, 0.12);
}

/* ---------- Sections ---------- */
.section {
  padding: 100px 0;
}

.section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 48px;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 2px;
  margin-top: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.1);
}

/* ---------- Skill bars ---------- */
.bars-card {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 18px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.bar-value {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
}

.bar-track {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 20px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.stat-number {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-suffix {
  font-size: 1.4rem;
  color: var(--accent);
  margin-left: 2px;
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

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

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.skill-card ul {
  list-style: none;
}

.skill-card li {
  color: var(--text-muted);
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 0.95rem;
}

.skill-card li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Experience ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(31, 122, 61, 0.4);
  animation: markerPulse 2.4s ease-out infinite;
}

@keyframes markerPulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 122, 61, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(31, 122, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 122, 61, 0); }
}

.timeline-item h3 {
  font-size: 1.15rem;
}

.meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 4px 0 14px;
}

.timeline-item ul {
  padding-left: 20px;
}

.timeline-item li {
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
}

.project-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.project-card h3 {
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 4px 10px;
  border-radius: 20px;
}

.cert-tags span {
  font-size: 0.72rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
}

.contact-intro {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.contact-list {
  list-style: none;
}

.contact-list li {
  margin-bottom: 14px;
}

.contact-label {
  display: inline-block;
  min-width: 70px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.contact-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-bottom: 18px;
  resize: vertical;
  transition: border-color 0.2s;
}

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

.form-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--accent);
}

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

.heart {
  color: #ff5f56;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s;
  box-shadow: 0 6px 18px rgba(31, 122, 61, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-dim);
  transform: translateY(-3px);
}

/* ---------- Feed ---------- */
.composer textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.composer textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.composer-file-btn {
  font-size: 0.85rem;
  padding: 10px 18px;
  cursor: pointer;
}

.composer-file {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
  min-width: 120px;
}

.feed-list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post {
  padding: 22px 24px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.post-meta h4 {
  font-size: 0.95rem;
  line-height: 1.2;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.post-text {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}

.post-image {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.post-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.post-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.post-delete:hover {
  color: #d64545;
  border-color: #d64545;
}

.feed-empty {
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
}

/* ---------- Reveal animation ---------- */
.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: 820px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .bars-card {
    grid-template-columns: 1fr;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 0 80px;
  }
}
