/* ─────────────────────────────────────────
   Prageesha Galagedara — Portfolio Styles
   ───────────────────────────────────────── */

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

/* ─── TOKENS ─── */
:root {
  --bg:       #0f1623;
  --bg2:      #161f30;
  --bg3:      #1d2a40;
  --border:   #243047;
  --border2:  #2e3d5a;
  --fg:       #e8edf8;
  --muted:    #7b90b8;
  --muted2:   #3d5070;
  --accent:   #4fffb0;
  --accent2:  #00d084;
  --blue:     #4da6ff;
  --amber:    #ffca5a;
  --mono:     'JetBrains Mono', monospace;
  --display:  'Outfit', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 3rem;
  background: rgba(15,22,35,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.3s;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.nav-logo span { color: var(--muted); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  padding: 0.45rem 1.1rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-family: var(--mono);
  transition: background 0.2s !important;
}
.nav-cta:hover { background: rgba(79,255,176,0.1) !important; }

/* ─── HERO ─── */
#hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?w=1920&q=80&fit=crop') center/cover no-repeat;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15,22,35,0.97) 0%,
    rgba(15,22,35,0.88) 50%,
    rgba(15,22,35,0.75) 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
  width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(79,255,176,0.08);
  border: 1px solid rgba(79,255,176,0.25);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.2s forwards;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
h1 {
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}
.hero-handle {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.6s forwards;
}
.hero-handle span { color: var(--accent); }
.hero-desc {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 2.25rem;
  font-weight: 300;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.75s forwards;
}
.hero-btns {
  display: flex; gap: 1rem; flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.9s forwards;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--fg); transform: translateY(-1px); }

.hero-scroll {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: var(--muted2); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  opacity: 0; animation: fadeIn 0.5s ease 1.5s forwards;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease infinite;
}

/* ─── SECTION LAYOUT ─── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 3rem;
}
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-heading {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.section-sub {
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  max-width: 480px;
  line-height: 1.7;
}

/* ─── ABOUT ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  margin-top: 3.5rem;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  font-weight: 300;
  margin-bottom: 1.1rem;
}
.about-text p:last-child { margin-bottom: 0; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 2rem;
}
.stat-box {
  background: var(--bg2);
  padding: 1.5rem;
  text-align: center;
}
.stat-num {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

/* ─── TERMINAL ─── */
.terminal-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.terminal-topbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot.r { background: #ff6b6b; }
.tdot.y { background: #ffd93d; }
.tdot.g { background: #6bcb77; }
.tbar-title { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 0.4rem; }
.terminal-body { padding: 1.4rem 1.5rem; font-family: var(--mono); font-size: 12.5px; line-height: 2; }
.t-prompt { color: var(--accent); }
.t-cmd    { color: var(--fg); }
.t-out    { color: var(--muted); padding-left: 0.5rem; }
.t-val    { color: var(--blue); }
.t-key    { color: var(--amber); }
.t-blank  { display: block; height: 0.6rem; }

/* ─── PROJECTS ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3.5rem;
}
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.project-card:hover { border-color: var(--border2); background: var(--bg3); transform: translateY(-3px); }
.project-card:hover::before { transform: scaleX(1); }
.project-num { font-family: var(--mono); font-size: 10px; color: var(--muted2); margin-bottom: 1rem; letter-spacing: 0.1em; }
.project-name {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.project-desc { color: var(--muted); font-size: 13.5px; line-height: 1.75; margin-bottom: 1.5rem; flex: 1; font-weight: 300; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.project-tags span {
  font-family: var(--mono);
  font-size: 10px;
  padding: 0.2rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--muted);
}
.project-card.featured {
  grid-column: span 2;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
}
.project-card.featured .project-main { flex: 1; }
.project-card.featured .project-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 0.2rem 0.6rem;
  background: rgba(79,255,176,0.1);
  border: 1px solid rgba(79,255,176,0.2);
  border-radius: 3px;
  color: var(--accent);
  width: fit-content;
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}

/* ─── SKILLS ─── */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-top: 3.5rem;
}
.skill-group-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.skill-item { margin-bottom: 1.1rem; }
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.skill-name { font-size: 13.5px; color: var(--fg); font-weight: 400; }
.skill-pct { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.skill-bar { height: 3px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 99px;
  width: 0;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ─── EXPERIENCE ─── */
.exp-list { margin-top: 3.5rem; display: flex; flex-direction: column; gap: 0; }
.exp-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }
.exp-meta { display: flex; flex-direction: column; gap: 0.4rem; }
.exp-period { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.exp-loc { font-size: 12px; color: var(--muted2); font-weight: 300; }
.exp-curr {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 0.15rem 0.55rem;
  background: rgba(79,255,176,0.08);
  border: 1px solid rgba(79,255,176,0.2);
  border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0.06em;
  width: fit-content;
}
.exp-role { font-family: var(--display); font-size: 1.15rem; font-weight: 500; margin-bottom: 0.2rem; letter-spacing: -0.01em; }
.exp-company { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 1rem; }
.exp-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.exp-bullets li {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
  font-weight: 300;
}
.exp-bullets li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 10px; top: 0.25rem; }
.exp-tech { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.exp-tech span {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 0.2rem 0.55rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--muted);
}

/* ─── BLOG ─── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 3.5rem;
}
.blog-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.blog-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.blog-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}
.blog-title { font-family: var(--display); font-size: 1.05rem; font-weight: 500; margin-bottom: 0.6rem; letter-spacing: -0.01em; line-height: 1.35; }
.blog-excerpt { color: var(--muted); font-size: 13px; line-height: 1.75; font-weight: 300; flex: 1; }
.blog-meta { font-family: var(--mono); font-size: 11px; color: var(--muted2); margin-top: 1.25rem; }

/* ─── CERTIFICATIONS ─── */
.certs-row {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  margin-top: 3.5rem;
}
.cert-card {
  flex: 1; min-width: 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex; gap: 1.25rem; align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}
.cert-card:hover { border-color: var(--accent); }
.cert-logo-wrap {
  width: 52px; height: 52px;
  background: white;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}
.cert-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.cert-date { font-family: var(--mono); font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.cert-name { font-size: 14px; font-weight: 500; line-height: 1.35; }

/* ─── CONTACT ─── */
#contact-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.contact-links-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }
.contact-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.contact-link:hover { border-color: var(--accent); background: rgba(79,255,176,0.04); color: var(--accent); }
.contact-link-left { display: flex; align-items: center; gap: 1rem; }
.contact-icon { font-size: 15px; color: var(--accent); width: 20px; text-align: center; }
.contact-arrow { color: var(--muted2); font-size: 12px; }
.contact-side { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-availability {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(79,255,176,0.05);
  border: 1px solid rgba(79,255,176,0.15);
  border-radius: 6px;
  font-size: 14px;
  color: var(--fg);
}
.avail-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
  flex-shrink: 0;
}

/* ─── FOOTER ─── */
footer {
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted2); font-family: var(--mono); font-size: 11px;
}
footer a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }
@keyframes scrollPulse { 0%, 100% { transform: scaleY(1); opacity: 1; } 50% { transform: scaleY(0.6); opacity: 0.4; } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.25rem; }
  .section { padding: 5rem 1.5rem; }
  .hero-content { padding: 0 1.5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .project-card.featured { grid-column: span 2; }
  .skills-layout { grid-template-columns: 1fr 1fr; }
  .exp-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .blog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: span 1; flex-direction: column; }
  .skills-layout { grid-template-columns: 1fr; }
  nav .nav-links { display: none; }
}