/* ===== GOOGLE FONT FALLBACK / VARIABLES ===== */
:root {
  --color-cream: #fffaf7;
  --color-peach: #f8d8cc;
  --color-terracotta: #c97963;
  --color-clay: #b86b57;
  --color-amber: #d9a441;
  --color-rose: #e8b3b3;
  --color-mauve: #8f6f78;
  --color-deep: #2f2626;
  --color-muted: #6d5f5f;
  --color-white: #ffffff;
  --color-border: rgba(201, 121, 99, 0.14);

  --bg-primary: #fffdfb;
  --bg-secondary: #f9f3ef;
  --bg-card: rgba(255, 255, 255, 0.78);

  --text-primary: #2f2626;
  --text-secondary: #6f6262;
  --text-light: #ffffff;

  --accent-primary: #c97963;
  --accent-secondary: #d9a441;

  --shadow-sm: 0 8px 24px rgba(121, 78, 67, 0.08);
  --shadow-md: 0 15px 40px rgba(121, 78, 67, 0.12);
  --shadow-lg: 0 25px 60px rgba(121, 78, 67, 0.18);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;

  --transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 1180px;
}

body.dark-mode {
  --bg-primary: #171315;
  --bg-secondary: #211b1e;
  --bg-card: rgba(35, 28, 31, 0.86);

  --text-primary: #f8efed;
  --text-secondary: #c8b8b6;

  --color-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 15px 40px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.38);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(248, 216, 204, 0.35), transparent 30%),
    radial-gradient(circle at bottom right, rgba(217, 164, 65, 0.12), transparent 30%),
    var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  transition: var(--transition);
}

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

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

section {
  scroll-margin-top: 90px;
}

/* smoother rendering */
.project-card,
.skill,
.btn,
.testimonial-card,
.entry,
.skills-category,
.testimonial-btn,
#theme-toggle {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

/* ===== GLOBAL SECTION STYLING ===== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.section h2 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.section > p:first-of-type {
  max-width: 820px;
  font-size: 1.02rem;
  color: var(--text-secondary);
}

/* ===== HEADER / NAV ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 253, 251, 0.75);
  border-bottom: 1px solid var(--color-border);
}

body.dark-mode header {
  background: rgba(23, 19, 21, 0.72);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--accent-primary);
  background: rgba(201, 121, 99, 0.08);
  transform: translateY(-1px);
}

#theme-toggle {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

#theme-toggle:hover {
  transform: translateY(-2px) rotate(10deg) scale(1.03);
  box-shadow: var(--shadow-md);
}

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - 78px);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(201, 121, 99, 0.14), transparent 70%);
  top: 2rem;
  left: -5rem;
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.12), transparent 70%);
  bottom: 1rem;
  right: -4rem;
  border-radius: 50%;
  pointer-events: none;
}

.hero-img {
  width: min(300px, 75vw);
  height: min(300px, 75vw);
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
  margin: 0 auto 2rem;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-img:hover {
  transform: scale(1.02);
}

.hero h2 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  letter-spacing: -0.05em;
}

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

.hero p {
  max-width: 760px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  font-size: 1.08rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  padding: 0.95rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-md);
}

/* ===== ABOUT ===== */
#about p {
  max-width: 900px;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

/* ===== SKILLS ===== */
#skills h2 {
  margin-bottom: 2rem;
}

.skills-category {
  margin-bottom: 2.5rem;
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.skills-category:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.skills-category h3 {
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.skill {
  padding: 1rem 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

body.dark-mode .skill {
  background: rgba(255, 255, 255, 0.03);
}

.skill:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-sm);
}

.skill span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.skill-bar {
  width: 100%;
  height: 10px;
  background: rgba(201, 121, 99, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.project-img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Featured first card */
.project-card:first-child {
  grid-column: span 2;
}

.project-card:first-child .project-img {
  height: 290px;
}

.project-card:first-child h3 {
  font-size: 1.35rem;
}

/* Dashboard screenshot only */
.dashboard-img {
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: top center;
  display: block;
  background: #f8f6f4;
  padding: 12px;
  border-radius: 0;
  aspect-ratio: auto;
}

.project-card h3 {
  padding: 1.3rem 1.3rem 0.4rem;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.project-card p {
  padding: 0 1.3rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.97rem;
}

/* ===== EXPERIENCE ===== */
.timeline {
  position: relative;
  max-width: 920px;
  margin-top: 2rem;
  padding-left: 1.25rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), rgba(201, 121, 99, 0.18));
}

.entry {
  position: relative;
  margin-bottom: 1.4rem;
  padding: 1.35rem 1.35rem 1.35rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  margin-left: 1rem;
  transition: var(--transition);
}

.entry:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.entry::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 1.55rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(201, 121, 99, 0.12);
}

.entry h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.entry span {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: var(--accent-primary);
  font-size: 0.92rem;
  font-weight: 600;
}

.entry p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* ===== TESTIMONIALS ===== */
.testimonials-section {
  text-align: center;
}

.testimonials-subtitle {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
}

.testimonial-carousel {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 1rem;
  max-width: 900px;
  margin: 2rem auto 1.5rem;
}

.testimonial-slider {
  overflow: hidden;
}

.testimonial-track {
  position: relative;
  min-height: 360px;
}

.testimonial-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.testimonial-card.active {
  display: block;
}

.testimonial-img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 4px solid rgba(201, 121, 99, 0.14);
}

.testimonial-card h3 {
  margin-bottom: 0.55rem;
  color: var(--text-primary);
}

.stars {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  color: var(--color-amber);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.testimonial-card p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1rem;
}

.testimonial-btn {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.testimonial-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-md);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(201, 121, 99, 0.25);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  width: 30px;
  border-radius: 999px;
  background: var(--accent-primary);
}

/* ===== CONTACT ===== */
#contact > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-form {
  max-width: 760px;
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.contact-form:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font: inherit;
  transition: var(--transition);
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  background: rgba(255, 255, 255, 0.03);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9c8c8c;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(201, 121, 99, 0.5);
  box-shadow: 0 0 0 4px rgba(201, 121, 99, 0.12);
  transform: translateY(-1px);
}

/* ===== SUCCESS POPUP ===== */
.success-popup {
  position: fixed;
  top: 24px;
  right: 24px;
  left: auto;
  transform: translateY(-24px);
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.success-popup.show {
  opacity: 1;
  transform: translateY(0);
}

.success-popup span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}

/* ===== FOOTER ===== */
footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #2f2626, #4a3938);
  color: rgba(255, 255, 255, 0.85);
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .projects-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-card:first-child {
    grid-column: span 1;
  }

  .project-card:first-child .project-img {
    height: 230px;
  }

  .project-card:first-child .dashboard-img {
    height: auto !important;
  }

  .testimonial-carousel {
    grid-template-columns: 1fr;
  }

  .testimonial-btn {
    display: none;
  }
}

@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .logo {
    width: 100%;
    text-align: center;
  }

  .nav-links {
    justify-content: center;
    gap: 0.2rem;
  }

  .nav-links a {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
  }

  .hero {
    padding-top: 4rem;
    min-height: auto;
  }

  .section {
    padding: 4.5rem 1rem;
  }

  .contact-form,
  .skills-category,
  .testimonial-card,
  .entry {
    padding: 1.3rem;
  }

  .project-img {
    height: 210px;
  }

  .dashboard-img {
    height: auto !important;
    padding: 8px;
  }
}

@media (max-width: 520px) {
  .hero-img {
    width: 220px;
    height: 220px;
  }

  .hero h2 {
    font-size: 2.3rem;
  }

  .hero p {
    font-size: 0.98rem;
  }

  .section h2 {
    font-size: 1.9rem;
  }

  .testimonial-track {
    min-height: 420px;
  }

  .success-popup {
    right: 14px;
    left: 14px;
    top: 16px;
  }
}

.reveal-base {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
}

.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
