
:root {
  --bg: #ffffff;
  --surface: #f6faf7;
  --text: #0f1e14;
  --muted: #4e6456;
  --primary: #2f6f4e;
  --primary-600: #2a6145;
  --primary-700: #244f39;
  --border: #dce7df;
  --success: #7dd2a8;

  --hero-bg: #0b251c;
  --hero-text: #ffffff;
  --hero-muted: #e7f2ec;
  --hero-accent: #b9e4cd;

  --dark: var(--text);
  --light: var(--bg);
  --gray: var(--muted);
}

/* ==============================
   Base
   ============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==============================
   Header (translucent over hero, solid after scroll)
   ============================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 100;
  color: var(--text);

  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);

  border-bottom: 1px solid rgba(220, 231, 223, 0.6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

body.scrolled header {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Nav links */
nav ul {
  display: flex;
  list-style: none;
}

nav ul li+li {
  margin-left: 30px;
}

nav ul li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 4px;
  position: relative;
}

nav ul li a.active,
nav ul li a:hover {
  color: var(--primary-700);
}

nav ul li a.active::after {
  content: '';
  position: absolute;
  height: 2px;
  background: var(--primary);
  left: 0;
  right: 0;
  bottom: -2px;
}

.logo {
  margin-left: auto;
  font-size: 1.8rem;
  font-weight: 700;
}

.logo span {
  color: var(--primary);
}

.mobile-menu {
  display: none;
  cursor: pointer;
  margin-left: 20px;
}

.mobile-menu .bar {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 4px 0;
}

@media (max-width: 768px) {
  .header-content {
    justify-content: space-between;
  }

  .logo {
    margin-left: 0;
  }

  .mobile-menu {
    margin-left: auto;
    display: block;
  }
}

/* ==============================
   Hero (dark moss)
   ============================== */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;

  background-color: var(--hero-bg);
  color: var(--hero-text);
}

.hero-content {
  max-width: 800px;
}

.hero h1 {
  font-size: 3.1rem;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
  color: var(--hero-text);
}

.hero p {
  font-size: 1.0rem;
  margin-bottom: 30px;
  color: var(--hero-muted);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s .2s forwards;
}

.hero .btn {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s .4s forwards;
}

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

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

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 1px;
  transition: all .3s ease;
  border: 1px solid var(--primary-600);
}

.btn:hover {
  background-color: var(--primary-700);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}

.hero .btn {
  background: var(--bg);
  color: #1a4b36;
  border: 1px solid #cfe7db;
}

.hero .btn:hover {
  background: #dff0e8;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
}

/* ==============================
   Sections / About
   ============================== */
section {
  padding: 100px 0;
}

.about {
  background-color: var(--surface);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: 2.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background-color: var(--primary);
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.about-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.about-img {
  flex: 1;
  min-width: 300px;
  padding: 0 20px;
  display: flex;
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

.about-text {
  flex: 1;
  min-width: 300px;
  padding: 0 20px;
}

.about-text h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .about-text p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
  }

  .about-text p:last-child {
    text-align-last: left;
  }
}

/* ==============================
   Skills
   ============================== */
.skills {
  background-color: var(--bg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 40px;
  padding: 50px 0;
}

.skill-item {
  background-color: var(--surface);
  padding: 40px;
  border-radius: 10px;
  border: 1px solid #e8ece9;
  transition: all .3s ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .05);
}

.skill-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .06);
}

.skill-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.skill-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.skill-line {
  margin-top: .25rem;
  line-height: 1.5;
}

/* Certifications links: dark green, underline on hover, lighter green when visited */
.skill-line a {
  color: var(--primary-700);
  text-decoration: none;
}

.skill-line a:hover,
.skill-line a:focus {
  color: var(--primary-700);
  text-decoration: underline;
}

.skill-line a:visited {
  color: var(--primary-600);
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Projects
   ============================== */
.projects {
  background-color: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all .3s ease;
}

.project-card:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, .08);
}

.project-img {
  width: 100%;
  height: 200px;
  background-color: #e6efe9;
  overflow: hidden;
  transition: height .3s ease-in-out;
}

.project-card:hover .project-img {
  height: 300px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  transform-origin: center;
}

.project-card:hover .project-img img {
  transform: scale(1.2);
}

.project-content {
  padding: 20px;
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.project-category {
  color: var(--primary-700);
  font-weight: 500;
  margin-bottom: 10px;
}

.project-desc {
  color: var(--muted);
  margin-bottom: 20px;
}

.project-links {
  display: flex;
}

.project-links a {
  margin-right: 15px;
  color: var(--text);
  transition: color .3s ease;
}

.project-links a:hover {
  color: var(--primary);
}

/* ==============================
   Contact
   ============================== */
.contact {
  background-color: var(--surface);
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
}

.contact-info {
  flex: 1;
  min-width: 300px;
  padding: 0 20px;
}

.contact-info h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.contact-info p {
  margin-bottom: 30px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 20px;
  font-size: 1.2rem;
}

/* Icon images */
.contact-icon img {
  width: 28px;
  height: 28px;
}

.contact-form {
  flex: 1;
  min-width: 300px;
  padding: 0 20px;
}

.contact-form form {
  background-color: var(--surface);
  padding: 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1rem;
  transition: border .3s ease;
  background: #fff;
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

.submit-btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all .3s ease;
  border: 1px solid var(--primary-600);
}

.submit-btn:hover {
  background-color: var(--primary-700);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}

/* ==============================
   Footer
   ============================== */
footer {
  background-color: var(--bg);
  color: var(--muted);
  padding: 50px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-text {
  flex: 1;
  min-width: 300px;
  margin-bottom: 30px;
}

.footer-text h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.footer-text h3 span {
  color: var(--primary);
}

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

/* Footer social */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  background-color: rgba(47, 111, 78, .08);
  padding: 5px 10px;
  border-radius: 30px;
  text-decoration: none;
  color: var(--text);
  transition: all .3s ease;
}

.social-links a img {
  width: 24px;
  height: 24px;
}

.social-links a span {
  margin-left: 8px;
  font-size: .9rem;
}

.social-links a:hover {
  background-color: var(--primary);
  color: #fff;
}

.footer-links {
  flex: 1;
  min-width: 300px;
  margin-bottom: 30px;
}

.footer-links h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: var(--muted);
  text-decoration: none;
  transition: color .3s ease;
}

.footer-links ul li a:hover {
  color: var(--primary);
}

.copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(0, 0, 0, .06);
  color: var(--muted);
}

/* ==============================
   Responsive nav & typography
   ============================== */
@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all .5s ease;
    border-top: 1px solid var(--border);
  }

  nav ul.active {
    left: 0;
  }

  nav ul li {
    margin: 20px 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

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

/* ==============================
   Custom Scrollbar (WebKit)
   ============================== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* ==============================
   Reveal animation
   ============================== */
.reveal {
  position: relative;
  transform: translateY(50px);
  opacity: 0;
  transition: all 1s ease;
}

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

/* Staggered transitions for skills */
.skills-grid .skill-item:nth-child(1) {
  transition-delay: .2s;
}

.skills-grid .skill-item:nth-child(2) {
  transition-delay: .4s;
}

.skills-grid .skill-item:nth-child(3) {
  transition-delay: .6s;
}

.skills-grid .skill-item:nth-child(4) {
  transition-delay: .8s;
}

.skills-grid .skill-item:nth-child(5) {
  transition-delay: 1s;
}

/* Typing accent (outside hero, e.g., about/projects) */
.primary-text {
  color: var(--primary-700);
}

.cursor {
  display: inline-block;
  font-weight: 100;
  color: var(--primary-700);
  animation: blink .7s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  
  .about-text h3 {
    margin-top: 24px;
  }

  .about-img {
    margin-bottom: 16px;
  }
}