/* ================================================
   Oshadha Kavintha — Portfolio
   Minimalist Flat Design
   ================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --accent:       #d92cf9;
  --accent-dark:  #b620d8;
  --dark:         #1a1d2e;
  --body:         #4a4e6a;
  --muted:        #8b90aa;
  --border:       #e8edf4;
  --bg-alt:       #f8fafc;
  --white:        #ffffff;
  --shadow:       0 2px 20px rgba(26,29,46,.08);
  --shadow-lg:    0 8px 40px rgba(26,29,46,.14);
  --radius:       8px;
  --ease:         0.28s ease;
  --font:         'Poppins', sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--body);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea { font-family: var(--font); }

/* ---------- Container ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

.section-header { text-align: center; margin-bottom: 64px; }
.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 18px;
}
.section-line {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: var(--ease);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--white);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--white);
  color: var(--white);
}
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ================================================
   NAVIGATION
   ================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--ease);
}
#navbar.scrolled { box-shadow: var(--shadow); }

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}
.nav-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
  padding: 8px 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 6px;
  transition: var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); background: rgba(217,44,249,.06); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--ease);
}

/* ================================================
   HERO
   ================================================ */
#hero {
  position: relative;
  min-height: 100vh;
  background: url('../images/about/welcome-banner.jpg') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,29,46,.74);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 100px 24px 80px;
  max-width: 800px;
}
.hero-greeting {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-content h1 {
  font-size: clamp(44px, 8vw, 78px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.hero-content h1 span:first-child { color: var(--white); }
.hero-content h1 span.accent-dot { color: var(--accent); }
.hero-subtitle {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,.75);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 52px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: 28px;
  z-index: 1;
  animation: scrollBounce 2s infinite;
  transition: color var(--ease);
}
.hero-scroll:hover { color: var(--accent); }
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ================================================
   ABOUT
   ================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  align-items: center;
}
.about-image-wrap img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 4/5;
}
.about-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.about-social a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 16px;
  transition: var(--ease);
}
.about-social a:hover { border-color: var(--accent); color: var(--accent); }

.about-text h3 {
  font-size: 21px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 20px;
  text-transform: none;
}
.about-text p {
  font-size: 15px;
  color: var(--body);
  line-height: 1.85;
  margin-bottom: 16px;
}
.about-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.info-value { font-size: 14px; color: var(--dark); font-weight: 400; }

/* ================================================
   EDUCATION
   ================================================ */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -36px;
  top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,44,249,.2);
}
.timeline-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: var(--ease);
}
.timeline-content:hover { box-shadow: var(--shadow-lg); border-color: rgba(217,44,249,.3); }
.timeline-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.timeline-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  text-transform: none;
}
.timeline-content h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  margin-bottom: 6px;
  text-transform: none;
}
.timeline-content p { font-size: 13px; color: var(--muted); }

/* ================================================
   SKILLS
   ================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.skill-category {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--ease);
}
.skill-category:hover { box-shadow: var(--shadow); }
.skill-category h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 20px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-block;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: var(--ease);
  cursor: default;
}
.tag:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* ================================================
   EXPERIENCE
   ================================================ */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.exp-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--ease);
  display: flex;
  flex-direction: column;
}
.exp-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.exp-img { overflow: hidden; height: 190px; }
.exp-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--ease); }
.exp-card:hover .exp-img img { transform: scale(1.05); }
.exp-img-icon {
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
}
.exp-img-icon i { font-size: 56px; color: var(--accent); opacity: .25; }
.exp-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.exp-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(217,44,249,.08);
  border: 1px solid rgba(217,44,249,.2);
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}
.exp-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  text-transform: none;
}
.exp-body p { font-size: 13px; color: var(--muted); line-height: 1.75; flex: 1; margin-bottom: 18px; }
.exp-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--ease);
  align-self: flex-start;
}
.exp-link:hover { color: var(--accent-dark); gap: 8px; }

/* ================================================
   PORTFOLIO
   ================================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.portfolio-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--ease);
  display: flex;
  flex-direction: column;
}
.portfolio-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.portfolio-img {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: var(--bg-alt);
}
.portfolio-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--ease); }
.portfolio-card:hover .portfolio-img img { transform: scale(1.06); }
.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(217,44,249,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--ease);
}
.portfolio-card:hover .portfolio-overlay { opacity: 1; }
.overlay-btn {
  width: 50px; height: 50px;
  border: 2px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 22px;
  transition: var(--ease);
}
.overlay-btn:hover { background: var(--white); color: var(--accent); }
.portfolio-body { padding: 22px; flex: 1; }
.portfolio-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  text-transform: none;
}
.portfolio-body p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 16px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tags span {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(217,44,249,.07);
  border: 1px solid rgba(217,44,249,.18);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ================================================
   CERTIFICATES
   ================================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cert-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--ease);
  background: var(--white);
}
.cert-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.cert-img-wrap { position: relative; overflow: hidden; height: 190px; }
.cert-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: var(--ease); }
.cert-card:hover .cert-img-wrap img { transform: scale(1.05); }
.cert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(217,44,249,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--ease);
  color: var(--white);
  font-size: 30px;
}
.cert-card:hover .cert-overlay { opacity: 1; }
.cert-label {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark);
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid var(--border);
}

/* Certificate Lightbox */
.cert-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(26,29,46,.88);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cert-modal.open { display: flex; }
.cert-modal-inner {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 36px;
}
.cert-modal-close {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  transition: var(--ease);
  padding: 4px 8px;
}
.cert-modal-close:hover { color: var(--dark); }
#certModalTitle {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 20px;
  padding-right: 48px;
  text-transform: none;
}
#certModalImg { width: 100%; border-radius: 4px; }

/* ================================================
   CONTACT
   ================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.contact-info h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 16px;
  text-transform: none;
}
.contact-info > p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 40px;
}
.contact-details { display: flex; flex-direction: column; gap: 22px; margin-bottom: 40px; }
.contact-item { display: flex; align-items: center; gap: 16px; }
.contact-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(217,44,249,.08);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.contact-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.contact-val { display: block; font-size: 14px; color: var(--dark); margin-top: 2px; }
.contact-social { display: flex; gap: 10px; }
.contact-social a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 16px;
  transition: var(--ease);
}
.contact-social a:hover { border-color: var(--accent); color: var(--accent); }

/* Contact form */
#contactForm .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
#contactForm .form-group { margin-bottom: 16px; }
#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: var(--ease);
  resize: none;
}
#contactForm input:focus,
#contactForm textarea:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(217,44,249,.1); }
#contactForm input::placeholder,
#contactForm textarea::placeholder { color: var(--muted); }
.form-msg { font-size: 14px; margin-top: 14px; text-align: center; padding: 12px; border-radius: var(--radius); }
.form-msg.success { color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0; }
.form-msg.error   { color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; }

/* ================================================
   FOOTER
   ================================================ */
#footer {
  background: var(--dark);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
#footer p { font-size: 13px; color: rgba(255,255,255,.4); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,.4); transition: var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* Scroll-to-top */
.scroll-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--ease);
  z-index: 999;
  box-shadow: 0 4px 16px rgba(217,44,249,.35);
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* ================================================
   RESPONSIVE
   ================================================ */

/* Large tablets / small desktops */
@media (max-width: 1100px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablets portrait & small laptops */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    justify-items: center;
    text-align: left;
  }
  .about-image-wrap {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }
  .about-social { justify-content: center; }
  .about-info { margin-top: 28px; padding-top: 28px; }

  .skills-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* Tablet / large mobile — nav collapses */
@media (max-width: 767px) {
  .section { padding: 72px 0; }
  .section-title { font-size: 22px; }

  /* Mobile nav */
  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 10px 14px; border-radius: 6px; }
  .nav-toggle { display: flex; }

  /* Grids */
  .portfolio-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .exp-grid { grid-template-columns: 1fr; }

  /* Contact form */
  #contactForm .form-row { grid-template-columns: 1fr; }

  /* Timeline — tighter on small screens */
  .timeline { padding-left: 28px; }
  .timeline-marker { left: -29px; }
  .timeline-content { padding: 22px 24px; }
}

/* Mobile */
@media (max-width: 480px) {
  .section { padding: 56px 0; }
  .section-title { font-size: 20px; letter-spacing: 2px; }
  .section-header { margin-bottom: 44px; }

  .hero-content h1 { letter-spacing: 1px; }
  .hero-subtitle { letter-spacing: 3px; font-size: 13px; }
  .hero-actions { flex-direction: column; align-items: center; width: 100%; }
  .hero-actions .btn { width: 100%; max-width: 280px; justify-content: center; }

  .about-image-wrap { max-width: 100%; }
  .about-info { grid-template-columns: 1fr; gap: 16px; }

  .timeline { padding-left: 22px; }
  .timeline-marker { left: -23px; width: 8px; height: 8px; }
  .timeline-content { padding: 18px 20px; }
  .timeline-content h3 { font-size: 15px; }

  .skill-category { padding: 24px; }
  .tag { font-size: 12px; padding: 6px 12px; }

  .exp-body { padding: 18px; }

  .portfolio-body { padding: 18px; }

  .cert-grid { grid-template-columns: 1fr; }
  .cert-img-wrap { height: 220px; }
  .cert-modal-inner { padding: 20px 16px; }
  #certModalTitle { font-size: 15px; }

  .contact-info h3 { font-size: 19px; }
  .contact-details { gap: 16px; }

  .scroll-top { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 18px; }

  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
  .footer-links { justify-content: center; }
}

/* Very small phones */
@media (max-width: 360px) {
  .container { padding: 0 16px; }
  .nav-container { padding: 0 16px; }
  .hero-content { padding: 90px 16px 60px; }
  .btn { padding: 12px 24px; font-size: 12px; }
}
