:root{
  --bg: #f3faf7; /* page background - very light green */
  --card: #ffffff; /* card background */
  --muted: #386754; /* muted green-gray text */
  --text: #05281f; /* main text - dark green */
  --accent: #16a34a; /* emerald accent */
  --glass: rgba(6,50,38,0.03);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.wrap{max-width:1100px;margin:28px auto;padding:0 20px}
.site-header{padding:28px 0 8px}
.site-header h1{margin:0;font-size:30px;font-weight:600}
.lead{margin:10px 0 0;color:var(--muted);line-height:1.5}
.projects{display:flex;flex-direction:column;gap:12px;margin-top:18px}
.project{background:var(--card);border-radius:12px;padding:0;overflow:hidden;box-shadow:0 6px 18px rgba(17,24,39,0.06);border:1px solid rgba(16,24,40,0.06)}
.project-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;cursor:pointer;gap:12px}
.project-header h2{margin:0;font-size:18px;font-weight:600;color:var(--text);flex:1 1 auto;min-width:0}
.project-toggle{all:unset;display:flex;align-items:center;gap:12px;width:100%}
.project-toggle:focus{outline:2px solid rgba(37,99,235,0.16);outline-offset:3px;border-radius:6px}
.project-meta{color:var(--muted);font-size:13px;flex:0 0 230px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-content{padding:0 20px;max-height:0;overflow:hidden;transition:max-height 320ms ease, padding 220ms ease}
.project-content.open{padding:16px 20px 20px}
.tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tag{background:var(--glass);padding:6px 8px;border-radius:999px;font-size:13px;color:var(--muted)}
.links{margin-top:12px}
.links a{color:var(--accent);text-decoration:none;margin-right:12px}
.summary{color:var(--muted);margin-top:8px}

/* Split layout for skills/challenges */
.split{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:14px;align-items:start}
.split .left strong, .split .right strong{display:block;margin-bottom:8px;color:var(--muted)}
.split ul{margin:0;padding-left:20px;color:var(--muted)}
.split li{margin-bottom:6px}

@media (max-width:720px){
  .split{grid-template-columns:1fr}
  .project-header{flex-direction:column;align-items:flex-start}
  .project-meta{flex:auto;text-align:left;width:100%;white-space:normal;margin-top:8px}
}

@media (max-width:520px){.wrap{padding:0 12px}.site-header h1{font-size:22px}}

/* Screenshots gallery: responsive grid so images fit the container width */
.gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:16px}
.thumb{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;cursor:pointer;box-shadow:0 6px 18px rgba(16,24,40,0.06);transition:transform 160ms ease,box-shadow 160ms ease;border:1px solid rgba(16,24,40,0.04)}
.thumb:hover{transform:translateY(-6px);box-shadow:0 18px 36px rgba(16,24,40,0.08)}

/* Single-image galleries should span the full content width */
.gallery.single{grid-template-columns:1fr;border-radius:10px;overflow:hidden}
.gallery.single .thumb{aspect-ratio:21/9;max-height:520px;object-fit:contain;display:block;width:100%}
/* wrapper ensuring rounded corners for media */
.media-item{border-radius:8px;overflow:hidden;border:1px solid rgba(16,24,40,0.04);box-shadow:0 6px 18px rgba(16,24,40,0.06)}
.media-item img,.media-item video{display:block;width:100%;height:100%;object-fit:cover}
.media-item img{height:auto}
/* Force rounded clipping on video across browsers */
.media-item, .media-item img, .media-item video{
  border-radius:8px;
  -webkit-clip-path: inset(0 round 8px);
  clip-path: inset(0 round 8px);
}
.media-item video{background:transparent}
/* ensure video thumbnails respect rounded container */
.gallery.single video.thumb{display:block;width:100%;height:auto}

/* Extra Chrome fixes: force compositing and masking so video respects border-radius */
.media-item video{
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  transform: translateZ(0);
}

/* Lightbox */
.lightbox{position:fixed;inset:0;background:rgba(3,6,15,0.75);display:flex;align-items:center;justify-content:center;z-index:1200;padding:20px}
.lightbox img{max-width:100%;max-height:100%;border-radius:8px;box-shadow:0 18px 60px rgba(3,6,15,0.6)}
.lightbox video{max-width:100%;max-height:100%;border-radius:8px;box-shadow:0 18px 60px rgba(3,6,15,0.6)}
.lightbox .close{position:absolute;right:18px;top:18px;background:transparent;border:0;color:#fff;font-size:26px;cursor:pointer}
.lightbox .caption{position:absolute;left:20px;bottom:20px;color:var(--muted);font-size:14px}

/* subtle adjustments for headings inside content */
.project-content h3{margin-top:12px;margin-bottom:6px;font-size:15px;color:var(--text)}
.project-content p, .project-content .desc{color:var(--muted);line-height:1.6}

