/* VSCode Dark+ Theme palette */
:root{
  /* Base surfaces */
  --bg:#1e1e1e;         /* editor background */
  --panel:#252526;       /* sidebar/panel */
  --card:#2d2d2d;        /* cards */
  --border:rgba(255,255,255,0.06);
  --shadow:0 8px 20px rgba(0,0,0,0.35);
  /* Layout */
  --header-h:56px;

  /* Text */
  --muted:#d4d4d4;       /* foreground */
  --subtle:#808080;      /* comments */

  /* Accent + VS Code token colors */
  --accent:#007acc;      /* VS Code brand blue */
  --token-keyword:#c586c0;   /* purple */
  --token-builtin:#569cd6;   /* blue */
  --token-variable:#9cdcfe;  /* light blue */
  --token-function:#dcdCAA;  /* yellow */
  --token-string:#ce9178;    /* orange */
  --token-number:#b5cea8;    /* light green */
  --token-type:#4ec9b0;      /* teal */
  --token-comment:#6a9955;   /* green */

  /* Pastel tints derived from VS Code accents */
  --tint-builtin: rgba(86,156,214,0.16);
  --tint-type: rgba(78,201,176,0.16);
  --tint-function: rgba(220,220,170,0.16);
  --tint-string: rgba(206,145,120,0.16);
  --tint-variable: rgba(156,220,254,0.16);
  --tint-keyword: rgba(197,134,192,0.16);
  --tint-number: rgba(181,206,168,0.16);
  --tint-comment: rgba(106,153,85,0.16);
}

*{box-sizing:border-box}
html,body{min-height:100%}
html{background-color:var(--bg)}
body{
  margin:0;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background-color:var(--bg);
  /* Smooth full-page gradient (ties to document height, not viewport) */
  background-image: linear-gradient(180deg, #202020 0%, #1b1b1b 35%, #161616 70%, #101010 100%);
  color:var(--muted);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overscroll-behavior-y:none;
  /* Offset for fixed header so content doesn't slide underneath */
  padding-top:var(--header-h);
}
body.lb-open{overflow:hidden}
html{scroll-behavior:smooth; scroll-padding-top:var(--header-h)}
.visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
.container{max-width:1000px;margin:0 auto;padding:2rem}
.header-inner{display:flex;align-items:center;justify-content:space-between}
.site-header{background:var(--panel);position:fixed;top:0;left:0;right:0;z-index:1100;padding:0.25rem 0;border-bottom:1px solid var(--border);box-shadow:0 1px 0 rgba(0,0,0,0.6)}
.menu-toggle{display:none;align-items:center;justify-content:center;width:36px;height:36px;border-radius:6px;border:1px solid var(--border);background:var(--panel);color:#fff;cursor:pointer}
.menu-toggle:hover{background:#2b2b2b}
.site-header .container{padding-top:0.25rem;padding-bottom:0.25rem}
.logo{margin:0;font-size:1.1rem;color:var(--accent)}
.logo a{color:inherit;text-decoration:none}
.nav{display:flex;flex-wrap:wrap;gap:0.12rem 0.28rem;align-items:center}
.nav a{color:var(--muted);text-decoration:none;padding:0.18rem 0.36rem;border-radius:4px;font-size:0.9rem}
.nav a:hover,.nav a.active{background:rgba(255,255,255,0.08)}
.resume-link{border:1px solid rgba(255,255,255,0.03);padding:0.26rem 0.46rem}

.hero{display:grid;grid-template-columns:1fr 360px;gap:2rem;align-items:center;padding:2.5rem 0}
.hero-content h2{margin:0 0 0.5rem 0;font-size:2rem;color:var(--muted)}
.lead{color:var(--subtle);margin-bottom:1rem}
.cta-row .btn{margin-right:0}
.cta-row{display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center}
.cta-row .cta-break{flex-basis:100%;height:0}
.icon-btn{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:8px;border:1px solid var(--border);background:var(--panel);color:#fff;text-decoration:none;box-shadow:var(--shadow);transition:transform .08s ease, filter .2s ease}
.icon-btn:hover{transform:translateY(-1px);filter:brightness(1.07)}
.icon-btn.linkedin{color:#0a66c2}
.hero-image img{width:100%;max-width:320px;border-radius:8px;border:1px solid var(--border);background:var(--card)}

.section{padding:2rem 0}
.about, .skills, .projects, .resume-section{margin-top:1.5rem}
/* Ensure anchor targets aren’t hidden behind fixed header */
main section[id]{scroll-margin-top:var(--header-h)}
h3{color:#f0f0f0;position:relative;margin:0 0 0.5rem 0;font-size:1.15rem}
/* Section heading accent bar like an editor gutter */
h3::before{
  content:"";display:inline-block;width:6px;height:1em;margin-right:0.6rem;vertical-align:-0.12em;border-radius:2px;
  background:linear-gradient(180deg,var(--token-keyword),var(--token-builtin),var(--token-type));
  box-shadow:0 0 0 1px rgba(0,0,0,0.15);
}

/* Apply the same accent bar to h1 and h2 */
h1, h2{color:#f0f0f0;position:relative;margin:0 0 0.5rem 0}
h1::before, h2::before{
  content:"";display:inline-block;width:6px;height:1em;margin-right:0.6rem;vertical-align:-0.12em;border-radius:2px;
  background:linear-gradient(180deg,var(--token-keyword),var(--token-builtin),var(--token-type));
  box-shadow:0 0 0 1px rgba(0,0,0,0.15);
}
/* Don't show the bar on the site header logo */
.logo::before{content:none}

/* Resume helpers */
.timeline{display:flex;flex-direction:column;gap:1rem;margin-top:1rem}
.item{background:linear-gradient(180deg,var(--card),#262626);border:1px solid var(--border);border-radius:8px;padding:1rem}
.item-header{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin-bottom:0.25rem}
.item-header h4{margin:0;font-size:1rem;color:#eaeaea}
.item-header .meta{color:var(--subtle);font-size:0.9rem;white-space:nowrap}
.item ul{margin:0.25rem 0 0.25rem 1rem}
.item li{margin:0.25rem 0}

/* Horizontal card layout for experiences */
.experience-cards{display:flex;flex-direction:column;gap:1rem;margin-top:1rem}
.hcard{display:grid;grid-template-columns:88px 1fr;gap:1rem;align-items:flex-start}
.logo-col{display:flex;align-items:center;justify-content:center}
.company-logo{width:72px;height:72px;border-radius:8px;background:#1b1b1b;border:1px solid var(--border);object-fit:contain;padding:8px}
.content-col{min-width:0}

.skill-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem;margin-top:0.5rem}
.skills h5{margin:0.5rem 0 0.25rem 0;color:#eaeaea;font-size:0.95rem}
.compact-list{margin:0.5rem 0 0 1rem}
.compact-list li{margin:0.25rem 0}

.skill-list{display:flex;flex-wrap:wrap;gap:0.5rem;list-style:none;padding:0;margin:0.5rem 0}
.skill-list li{background:var(--card);padding:0.45rem 0.7rem;border-radius:999px;border:1px solid var(--border);color:var(--muted);box-shadow:0 1px 0 rgba(0,0,0,0.4);user-select:none}
/* Add token color accents to skill chips */
.skills .skill-list li{position:relative}
.skills .skill-list li::after{
  content:"";position:absolute;inset:auto 0 0 0;height:2px;border-radius:0 0 999px 999px;
  background:linear-gradient(90deg,var(--token-builtin),var(--token-type),var(--token-keyword));
  opacity:0.8
}

/* Projects carousel (scroll-snap, arrows like reference site) */
.projects-carousel{position:relative;margin-top:1rem}
.projects-carousel{display:flex;align-items:flex-start;gap:1rem;--pinned-w:320px}
.pinned-project-container{flex:0 0 var(--pinned-w)}
.pinned-project-container .project-card{margin:0}
.pinned-project-container .project-card.pinned{position:sticky;top:calc(var(--header-h) + 1rem)}
.projects-track{flex:1;min-width:0}

/* Label for the highlighted/pinned project */
.pinned-project-container .highlight-label{margin:0 0 0.5rem 0;color:var(--subtle);font-style:italic;font-size:0.95rem}
.projects-track{display:flex;gap:1rem;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:0.25rem}
.projects-track.no-snap{scroll-snap-type:none}
.projects-track{scrollbar-width:none;}
.projects-track::-webkit-scrollbar{display:none}
.projects-track::-webkit-scrollbar{height:10px}
.projects-track::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.12);border-radius:999px}
.projects-track::-webkit-scrollbar-track{background:rgba(255,255,255,0.04);border-radius:999px}
.projects-grid{display:flex;gap:1rem}
.project-card{background:linear-gradient(180deg,var(--card),#262626);border:1px solid var(--border);border-radius:8px;overflow:hidden;display:flex;flex-direction:column;position:relative}
.project-card{min-width:280px;max-width:320px;scroll-snap-align:start;box-shadow:var(--shadow)}
.project-card img{
  width:100%;
  height:100%;
  display:block;
  object-position:center;
  background:linear-gradient(135deg,#2b2b2b,#1b1b1b);
}
/* Media frame for project thumbnails so all cards get consistent image height and letterboxing */
.project-media-wrap{height:180px;display:flex;align-items:center;justify-content:center;background:#1b1b1b;overflow:hidden}
.project-media-wrap img{width:100%;height:100%;object-fit:contain}
/* Only apply 3:2 frame to WebP thumbnails */
.project-media-wrap img.is-webp{
  aspect-ratio:3/2;
  object-fit:contain;
}

/* Full-size image mode: image participates in document flow and expands card height */
.project-card img.media-full{width:100%;height:auto;display:block;object-fit:cover}
.project-body{padding:1rem;display:flex;flex-direction:column;gap:0.5rem;flex:1}
/* Make all cards uniform height so actions align at consistent distance from bottom */
.project-card{height:100%}
/* min-height will be set dynamically via JS equalization */
.project-body p{flex:1}
.project-actions{margin-top:auto;display:flex;gap:0.5rem;padding-top:0.25rem}

/* Pastel tint overlays for project cards to add subtle color without hurting readability */
.project-card::before{content:"";position:absolute;inset:0;pointer-events:none;border-radius:8px;background:transparent}
.project-card.variant-builtin::before{background:linear-gradient(0deg,var(--tint-builtin),transparent)}
.project-card.variant-type::before{background:linear-gradient(0deg,var(--tint-type),transparent)}
.project-card.variant-function::before{background:linear-gradient(0deg,var(--tint-function),transparent)}
.project-card.variant-string::before{background:linear-gradient(0deg,var(--tint-string),transparent)}
.project-card.variant-variable::before{background:linear-gradient(0deg,var(--tint-variable),transparent)}
.project-card.variant-keyword::before{background:linear-gradient(0deg,var(--tint-keyword),transparent)}
.project-card.variant-number::before{background:linear-gradient(0deg,var(--tint-number),transparent)}
.project-card.variant-comment::before{background:linear-gradient(0deg,var(--tint-comment),transparent)}

/* Slight colored headings inside project cards */
.project-card h4{color:#f3f3f3}
.project-card.variant-keyword h4{color:var(--token-keyword)}
.project-card.variant-builtin h4{color:var(--token-builtin)}
.project-card.variant-type h4{color:var(--token-type)}
.project-card.variant-string h4{color:var(--token-string)}
.project-card.variant-variable h4{color:var(--token-variable)}
.project-card.variant-function h4{color:#e9e0a6}
.project-card.variant-number h4{color:var(--token-number)}
.project-card.variant-comment h4{color:#cfe0c7}

/* Carousel controls */
.carousel-controls{position:absolute;left:calc(var(--pinned-w) + 12px);right:-12px;top:50%;transform:translateY(-50%);display:flex;justify-content:space-between;align-items:center;pointer-events:none}
.carousel-controls button{pointer-events:auto;width:40px;height:40px;border-radius:50%;border:1px solid var(--border);background:var(--panel);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow)}
.carousel-controls button:hover{background:#2b2b2b}
.carousel-controls .next{order:2}
.carousel-controls .prev{ /* nudge the left arrow left so it overlaps the scrollable track */
  transform:translateX(-12px);
}

.project-list ul{margin:1rem 0 0 1rem}
.project-list li{margin:0.25rem 0}

/* Buttons with VS Code token colors */
.btn{display:inline-block;padding:0.55rem 0.9rem;border-radius:6px;background:var(--accent);color:#fff;text-decoration:none;border:1px solid transparent;cursor:pointer;transition:transform .08s ease, filter .2s ease, box-shadow .2s ease}
.btn:hover{transform:translateY(-1px);filter:brightness(1.05)}
.btn:active{transform:translateY(0)}
.btn.outline{background:transparent;border:1px solid rgba(255,255,255,0.12);color:var(--muted)}

/* Make the "View detailed skills" button a filled accent inside the skills section.
   This keeps .btn.outline behavior elsewhere but provides a nice filled color for
   the specific call-to-action in the skills area. */
.skills .btn.outline{
  background:var(--token-type);
  color:#061619; /* dark text for contrast against the pastel token-type */
  border:1px solid rgba(0,0,0,0.16);
  box-shadow:0 0 0 1px rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.35);
}
.skills .btn.outline:hover{
  transform:translateY(-1px);
  filter:brightness(1.04);
}
.skills .btn.outline:focus-visible{
  outline:3px solid rgba(78,201,176,0.22);
  outline-offset:2px;
  border-radius:6px;
}
.btn.primary{background:var(--accent)}
.btn.keyword{background:var(--token-keyword)}
.btn.builtin{background:var(--token-builtin)}
.btn.variable{background:var(--token-variable);color:#0e1116}
.btn.function{background:var(--token-function);color:#111}
.btn.string{background:var(--token-string)}
.btn.number{background:var(--token-number);color:#111}
.btn.type{background:var(--token-type)}
.btn.comment{background:var(--token-comment)}
/* subtle glow */
.btn.keyword,.btn.builtin,.btn.variable,.btn.function,.btn.string,.btn.number,.btn.type,.btn.comment{box-shadow:0 0 0 1px rgba(255,255,255,0.06), 0 6px 14px rgba(0,0,0,0.35)}

/* URC info section */
.urc-overview{margin-top:1.5rem;background:linear-gradient(180deg,var(--card),#262626);border:1px solid var(--border);border-radius:8px;padding:1rem}
.urc-overview h4{margin:0 0 0.5rem 0;color:#eaeaea}

.site-footer{border-top:1px solid var(--border);padding:1rem 0;margin-top:2rem;color:var(--subtle)}

/* Contact section */
.contact{margin-top:1.5rem}
.email-row{display:flex;align-items:center;gap:0.5rem;margin:0.5rem 0 1rem 0}
.email{background:var(--card);border:1px solid var(--border);padding:0.45rem 0.6rem;border-radius:6px;color:#eaeaea}
.copy-btn{padding:0.45rem 0.6rem}
.nowrap{white-space:nowrap}
.contact-form{background:linear-gradient(180deg,var(--card),#262626);border:1px solid var(--border);border-radius:8px;padding:1rem}
.contact-form .form-row{display:flex;flex-direction:column;gap:0.35rem;margin-bottom:0.75rem}
.contact-form label{color:#eaeaea}
.contact-form input,.contact-form textarea{background:#1b1b1b;border:1px solid var(--border);border-radius:6px;padding:0.6rem;color:#eaeaea}
.contact-form input:focus,.contact-form textarea:focus{outline:2px solid rgba(86,156,214,0.35);outline-offset:2px}
.contact-form .form-actions{display:flex;align-items:center;gap:0.75rem}
.contact-form .form-hint{color:var(--subtle);font-size:0.9rem}

/* Make the contact CTA in the header stand out slightly */
.nav .contact-cta{margin-left:0.25rem}

/* Generic gallery grid for project pages */
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:0.75rem;margin-top:0.5rem}
.gallery-grid figure{margin:0;background:linear-gradient(180deg,var(--card),#262626);border:1px solid var(--border);border-radius:8px;padding:0.5rem}
.gallery-grid img{width:100%;height:200px;object-fit:cover;border-radius:6px;border:1px solid var(--border);background:#1b1b1b;cursor:zoom-in}
.gallery-grid figcaption{font-size:0.85rem;color:var(--subtle);margin-top:0.35rem}

/* Auto-discovered gallery styles */
.gallery-container{margin-top:0.75rem}
.gallery-header{font-weight:600;color:#edf2f7;margin-bottom:0.5rem}
.gallery-track{display:flex;gap:0.75rem;overflow-x:auto;padding:0.5rem 0 0.5rem 0;scroll-snap-type:x proximity}
.gallery-track::-webkit-scrollbar{height:10px}
.gallery-track::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.08);border-radius:999px}
.gallery-card{min-width:260px;max-width:360px;flex:0 0 auto;background:linear-gradient(180deg,var(--card),#232323);border-radius:8px;padding:0.45rem;border:1px solid var(--border);box-shadow:var(--shadow)}
.gallery-card img{width:100%;height:200px;object-fit:cover;border-radius:6px;cursor:zoom-in}
.gallery-card .gallery-media-wrap{position:relative;height:200px;border-radius:6px;overflow:hidden;background:#1b1b1b}
.gallery-card .gallery-video{width:100%;height:100%;display:block;object-fit:cover;background:#1b1b1b}
/* Optional mode: add data-fit="contain" on .auto-gallery to pillarbox portrait media */
.gallery-card .media-fit-contain{object-fit:contain !important;background:#1b1b1b}
.gallery-controls{display:flex;gap:0.5rem;justify-content:flex-end;margin-top:0.5rem}
.gallery-controls button{background:var(--panel);color:var(--muted);border:1px solid var(--border);padding:0.4rem 0.6rem;border-radius:6px;cursor:pointer}
.gallery-empty{color:var(--subtle);font-size:0.9rem;padding:0.5rem;background:linear-gradient(180deg,var(--card),#262626);border-radius:6px;border:1px solid var(--border)}

/* Lightbox overlay for gallery images */
.lightbox{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:2000}
.lightbox.open{display:flex}
.lightbox-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.6);opacity:0;transition:opacity .18s ease}
.lightbox.open .lightbox-backdrop{opacity:1}
.lightbox-content{position:relative;z-index:1;max-width:92vw;max-height:92vh;display:flex;align-items:center;justify-content:center}
.lightbox-content img{max-width:100%;max-height:92vh;border-radius:8px;box-shadow:0 16px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);transform:scale(0.97);opacity:0;transition:transform .2s ease, opacity .2s ease}
.lightbox.open .lightbox-content img{transform:scale(1);opacity:1}
.lightbox-close{position:absolute;top:8px;right:8px;background:rgba(0,0,0,0.6);color:#fff;border:1px solid var(--border);border-radius:8px;padding:6px 10px;cursor:pointer;z-index:2}
.lightbox-close:hover{background:rgba(0,0,0,0.7)}

/* Lightbox fullscreen button */
.lightbox-fs{position:absolute;top:8px;left:8px;background:rgba(0,0,0,0.6);color:#fff;border:1px solid var(--border);border-radius:8px;padding:6px 10px;cursor:pointer;z-index:2}
.lightbox-fs:hover{background:rgba(0,0,0,0.7)}

/* Ensure uncropped rendering in fullscreen modes */
.lightbox-content:fullscreen{display:flex;align-items:center;justify-content:center}
.lightbox-content:fullscreen img{width:100vw;height:100vh;object-fit:contain}
.lightbox-content:-webkit-full-screen{display:flex;align-items:center;justify-content:center}
.lightbox-content:-webkit-full-screen img{width:100vw;height:100vh;object-fit:contain}

/* Videos should also show uncropped in fullscreen */
.gallery-video:fullscreen{width:100vw !important;height:100vh !important;object-fit:contain !important;background:black}
.gallery-video:-webkit-full-screen{width:100vw !important;height:100vh !important;object-fit:contain !important;background:black}

@media (max-width:720px){
  .gallery-card img{height:160px}
  .gallery-card .gallery-media-wrap{height:160px}
  .gallery-card{min-width:220px}
}

@media (max-width:900px){
  :root{ --header-h:60px; }
  .hero{grid-template-columns:1fr;}
  .hero-image{order:-1}
  .container{padding:1rem}
  .hcard{grid-template-columns:64px 1fr}
  .company-logo{width:56px;height:56px}
  /* On narrower screens, show the highlighted project above the carousel as a full-width block
     instead of keeping it as a pinned column which would squish the carousel. */
  .projects-carousel{flex-direction:column}
  .pinned-project-container{display:block;flex:0 0 auto;width:100%;order:-1;margin-bottom:0.75rem}
  .pinned-project-container .project-card{max-width:none;width:100%}
  /* Ensure the scroll track stays constrained to container width and remains horizontally scrollable
     (prevents the page from expanding to the width of all cards side-by-side). */
  .projects-track{width:100%;min-width:0;overflow-x:auto}

  /* When pinned column is stacked above, keep carousel controls inside the track bounds */
  .carousel-controls{left:12px; right:12px}
  /* Hide arrow buttons on touch devices to avoid redundancy with swipe */
  .carousel-controls{display:none}
}

@media (max-width:560px){
  .item-header{flex-direction:column;align-items:flex-start;gap:0.25rem}
  .item-header .meta{white-space:normal}
}

/* Mobile navigation */
@media (max-width:860px){
  .menu-toggle{display:inline-flex}
  .nav{position:fixed;top:var(--header-h);left:0;right:0;background:var(--panel);border-bottom:1px solid var(--border);box-shadow:0 8px 20px rgba(0,0,0,0.35);display:none;flex-direction:column;gap:0;padding:0.5rem}
  .nav a{padding:0.6rem 1rem;border-radius:6px}
  .site-header.nav-open + main{pointer-events:none}
  body.nav-open{overflow:hidden}
  .site-header.nav-open .nav{display:flex}
}

/* Responsive type and components */
@media (max-width:720px){
  .hero-content h2{font-size:1.6rem}
  .lead{font-size:0.95rem}
  .btn{padding:0.5rem 0.8rem}
  .icon-btn{width:32px;height:32px}
  .project-card{min-width:260px}
  /* no fixed height; aspect ratio handled by classes */
}
@media (max-width:440px){
  .hero-content h2{font-size:1.4rem}
  .lead{font-size:0.9rem}
  .project-card{min-width:240px}
  /* no fixed height; aspect ratio handled by classes */
}
