:root {
  --bg: #f8f6f1;
  --bg-alt: #edeae3;
  --surface: #ffffff;
  --border: #dedad3;
  --text: #1a1814;
  --muted: #666260;
  --accent: #2c5f8a;
  --accent-bg: #e8f0f7;
  --nav-bg: rgba(248,246,241,0.96);
  --t: 0.2s ease;
}
[data-theme="dark"] {
  --bg: #111210;
  --bg-alt: #1a1917;
  --surface: #222220;
  --border: #2e2c2a;
  --text: #f0ece4;
  --muted: #9a9590;
  --accent: #5b9fd4;
  --accent-bg: #1a2d3e;
  --nav-bg: rgba(17,18,16,0.96);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background var(--t), color var(--t);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  padding: 0 60px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--t), background var(--t);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-bg);
}
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: background var(--t), color var(--t);
}
.theme-btn:hover { background: var(--accent-bg); color: var(--accent); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* SECTIONS */
.section {
  width: 100%;
  padding: 70px 60px;
  text-align: center;
}
.section.alt {
  width: 100%;
  background: var(--bg-alt);
  padding: 70px 60px;
  text-align: center;
}

/* HOME */
.home-section { text-align: center; }
.home-section {
  padding-top: 130px;
  padding-bottom: 70px;
}
.home-section h1 {
  font-size: 4.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.home-section h3 {
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 18px;
}
.home-section p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 860px;
  margin: 0 auto 28px auto;
  font-size: 1.15rem;
}
.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}
.home-links a {
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  transition: background var(--t), transform var(--t);
}
.home-links a:hover { background: #1e4468; transform: translateY(-1px); }
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
  justify-content: center;
}
.social-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--t);
}
.social-links a:hover { color: var(--accent); }

/* HEADINGS */
h2 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.divider {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto 24px auto;
}

/* ABOUT */
#about p {
  color: var(--muted);
  font-size: 1.2rem;
  margin-bottom: 14px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
#about strong { color: var(--text); }

/* TAG ROW */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}
.tag-row span {
  padding: 5px 13px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* SKILLS */
.skill-cat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  margin-top: 24px;
}
.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  justify-content: center;
}
.skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color var(--t), color var(--t);
  cursor: default;
}
.skill-item:hover { border-color: var(--accent); color: var(--accent); }
.skill-item i { color: var(--accent); font-size: 1.05rem; }

/* EXPERIENCE CARDS */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  justify-items: center;
  max-width: 1400px;
  margin: 0 auto;
}
.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  animation: fadeUp 0.4s both;
}
.exp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
  border-color: var(--accent);
}
.exp-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.exp-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--accent);
}
.exp-top h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.exp-co { font-size: 0.82rem; color: var(--accent); font-weight: 500; margin-top: 2px; }
.exp-date { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.exp-blurb { font-size: 0.95rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.exp-more { font-size: 0.8rem; color: var(--accent); font-weight: 500; display: flex; align-items: center; gap: 4px; }

/* PROJECTS — card grid */
.proj-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 28px;
  text-align: left;
  max-width: 1400px;
  margin: 0 auto;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.4s both;
  padding: 16px;
}
.proj-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.proj-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
}
.proj-body {
  padding: 24px 28px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.proj-card h3 { font-size: 1.2rem; font-weight: 600; }
.proj-card p { color: var(--muted); font-size: 1rem; flex: 1; }
.proj-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; justify-content: center; }
.proj-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  transition: background var(--t), color var(--t);
}
.proj-btn:hover { background: var(--accent); color: #fff; }
.proj-btn-live {
  background: var(--accent);
  color: #fff;
}
.proj-btn-live:hover { background: #1e4468; }

/* CONTACT */
#contact p { color: var(--muted); margin-bottom: 24px; font-size: 1rem; text-align: center; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.contact-form input,
.contact-form textarea {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.97rem;
  transition: border-color var(--t);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted); }
.contact-form button {
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  transition: background var(--t);
}
.contact-form button:hover { background: #1e4468; }
.form-msg { font-size: 0.88rem; font-weight: 500; }
.form-msg.ok { color: #2e7d32; }
.form-msg.err { color: #c62828; }

/* FOOTER */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer p { font-size: 0.88rem; color: var(--muted); }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--muted); font-size: 1.1rem; transition: color var(--t); }
.footer-links a:hover { color: var(--accent); }

/* MODAL */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 28px;
  max-width: 540px;
  width: 100%;
  position: relative;
  transform: translateY(14px);
  transition: transform 0.2s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-alt); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; color: var(--muted); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--accent-bg); color: var(--accent); }
.modal-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 2px; }
.modal-list {
  padding-left: 18px; list-style: disc;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.modal-list li { font-size: 0.92rem; color: var(--muted); line-height: 1.6; }

/* ANIMATION */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 58px; left: 0; right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .home-section h1 { font-size: 2rem; }
  .exp-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; text-align: center; }
}