:root{
  --bg:#0f1220;
  --surface:#151a2e;
  --surface-2:#1b2140;
  --text:#e6e8ef;
  --muted:#9aa3b2;
  --brand:#6aa6ff;
  --brand-2:#82ffd8;
  --ring: 0 0 0 3px rgba(106,166,255,0.35);
}

/* Light mode (auto if user prefers) */
@media (prefers-color-scheme: light) {
  :root{
    --bg:#f6f7fb;
    --surface:#ffffff;
    --surface-2:#f1f3f8;
    --text:#202433;
    --muted:#5c6273;
    --brand:#2b6cff;
    --brand-2:#00b894;
    --ring: 0 0 0 3px rgba(43,108,255,0.25);
  }
}

*{ box-sizing:border-box; }
html { scroll-behavior:smooth; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Layout */
.menu-btn{
  position:fixed; top:14px; left:14px;
  z-index:40;
  background:var(--surface);
  border:1px solid var(--surface-2);
  color:var(--text);
  padding:8px 12px; border-radius:10px;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.2);
}
.menu-btn:hover{ outline:var(--ring); }

.side-nav{
  width:220px; background:var(--surface); border-right:1px solid var(--surface-2);
  position:fixed; inset:0 auto 0 0; padding:18px; z-index:30;
  transition:all .28s ease;
}
.side-nav.closed{ transform:translateX(-100%); }
.side-nav ul{ list-style:none; margin:0; padding:0; }
.side-nav li{ margin:10px 0; }
.side-nav a{
  color:var(--text); text-decoration:none; padding:10px 12px; display:block; border-radius:10px;
}
.side-nav a:hover{ background:var(--surface-2); }

.content{
  margin-left:240px; padding:28px; max-width:1100px;
}

/* Mobile */
@media (max-width: 860px){
  .content{ margin-left:0; padding:18px; }
  .side-nav{ transform:translateX(-100%); }
  .side-nav.active{ transform:translateX(0); }
  .menu-btn{ left:auto; right:14px; }
}

/* Hero */
.hero{
  display:grid; grid-template-columns:120px 1fr; gap:18px; align-items:center;
  background:linear-gradient(135deg, var(--surface), var(--surface-2));
  padding:22px; border-radius:18px; box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.title{ margin:0 0 6px; font-weight:800; letter-spacing:.2px; }
.subtitle{ margin:0 0 10px; }
.muted{ color:var(--muted); }
.inline-link{ color:var(--brand); text-decoration:none; }
.inline-link:hover{ text-decoration:underline; }

.circle-image{
  width:110px; height:110px; border-radius:50%;
  object-fit:cover; border:2px solid rgba(255,255,255,.35);
  box-shadow:0 6px 18px rgba(0,0,0,.3);
  transition:transform .2s ease;
}
.circle-image:hover{ transform:scale(1.02); }

.typed-wrap{ margin:.5rem 0 0; font-weight:500; color:var(--brand-2); }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface); color:var(--text);
  border:1px solid var(--surface-2);
  padding:10px 14px; border-radius:12px; text-decoration:none; font-weight:600;
  transition:transform .05s ease, background .2s ease;
}
.btn:hover{ background:var(--surface-2); }
.btn:active{ transform:translateY(1px); }
.btn.primary{ background:var(--brand); color:#fff; border-color:transparent; }
.btn.primary:hover{ filter:brightness(.95); }
.btn.ghost{ background:transparent; border:1px dashed var(--brand); color:var(--brand); }
.cta-row{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }

/* Sections */
.section{ margin:36px 0; }
.section-title{ margin:0 0 12px; font-size:1.6rem; }
.section-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.divider{ border:0; height:1px; background:var(--surface-2); margin:28px 0; }

/* Inputs */
.input{
  background:var(--surface); color:var(--text);
  border:1px solid var(--surface-2);
  padding:10px 12px; border-radius:10px; min-width:220px;
}
.input:focus{ outline:var(--ring); border-color:transparent; }

.filter-row{ display:flex; gap:10px; flex-wrap:wrap; }

/* Card grid */
.card-grid{
  display:grid; gap:14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top:14px;
}
.card{
  background:var(--surface); border:1px solid var(--surface-2);
  border-radius:14px; padding:14px;
  transition:transform .08s ease, box-shadow .15s ease;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}
.card:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.22); }
.card h3{ margin:0 0 8px; font-size:1.05rem; }
.card p{ margin:6px 0; }
.meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--muted); font-size:.93rem; }
.badge{
  display:inline-block; padding:4px 8px; border-radius:999px;
  background:var(--surface-2); color:var(--text); font-size:.75rem; font-weight:600;
}
.link-row{ display:flex; gap:10px; margin-top:8px; flex-wrap:wrap; }
.card a.link{ color:var(--brand); text-decoration:none; font-weight:600; }
.card a.link:hover{ text-decoration:underline; }

/* Contact */
.socials{ display:flex; gap:14px; flex-wrap:wrap; }
.social{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; background:var(--surface); border:1px solid var(--surface-2);
  border-radius:10px; color:var(--text); text-decoration:none;
}
.social:hover{ background:var(--surface-2); }

/* Footer */
.footer{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  margin-top:28px; color:var(--muted);
}
.to-top{ color:var(--brand); text-decoration:none; }
.to-top:hover{ text-decoration:underline; }

/* === PROJECTS SECTION === */
#projects {
  text-align: left;
  margin-top: 50px;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

/* One project per row, image left, text right */
.project-card {
  display: grid;
  grid-template-columns: 1.3fr 2fr; /* image 40%, text 60% */
  gap: 24px;
  align-items: start; /* Changed from stretch to start */
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  border-color: var(--brand);
}

/* Image wrapper keeps aspect and adds nice crop */
.project-card .thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
  width: 100%; /* Ensure full width */
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block; /* Removes any inline spacing */
  transition: transform .25s ease;
}

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

/* Text side */
.project-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Changed from center */
  gap: 10px;
  min-width: 0; /* Prevents text overflow issues */
}

.project-content h3 {
  margin: 0 0 8px 0;
  font-weight: 600;
  font-size: 1.15rem;
}

.project-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Links as small buttons */
.project-links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-links .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--brand);
  transition: background .12s ease, border-color .12s ease;
  font-size: 0.9rem;
}

.project-links .btn:hover {
  background: var(--surface-2);
  border-color: var(--brand);
}

.project-links .btn.ghost {
  background: transparent;
  border: 1px dashed var(--brand);
  color: var(--brand);
}

.project-links .btn.ghost:hover {
  background: var(--surface-2);
}

/* Mobile: stack image on top */
@media (max-width: 768px) {
  .project-card {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 16px;
  }
  
  .project-card .thumb {
    aspect-ratio: 16 / 9;
  }
}