@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root{
  --bg:#ffffff;
  --fg:#0a0a0a;
  --muted:#6b6b6b;
  --border:#e7e7e7;
  --surface-subdued:#f5f5f5;
  --card-border:rgba(11,13,17,0.08);
  --footer-bg:#0a0a0a;
  --footer-fg:#ffffff;
  --footer-muted:#9a9a9a;
  --max:1180px;
  --font-sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-mono:'Space Mono',ui-monospace,monospace;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:var(--font-sans);
  color:var(--fg);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
ul{margin:0;padding:0;}
h1,h2,h3,p{margin:0;}

.wrap{max-width:var(--max);margin:0 auto;padding:0 40px;}

/* Header */
.site-header{
  border-bottom:1px solid var(--border);
  padding:22px 0;
}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;gap:24px;}
.logo{font-weight:800;font-style:italic;font-size:16px;letter-spacing:0.02em;white-space:nowrap;}
.logo a{display:block;}

.main-nav{display:flex;gap:28px;flex:1;margin-left:48px;}
.main-nav a{
  font-size:14px;
  color:var(--muted);
  padding-bottom:4px;
  border-bottom:2px solid transparent;
  font-weight:500;
}
.main-nav a.active{color:var(--fg);border-bottom-color:var(--fg);font-weight:600;}

.lang-toggle{display:flex;border:1px solid var(--fg);border-radius:999px;overflow:hidden;flex-shrink:0;}
.lang-toggle button{
  font-family:var(--font-sans);
  font-size:13px;
  font-weight:600;
  padding:7px 16px;
  border:none;
  background:var(--bg);
  color:var(--fg);
  cursor:pointer;
}
.lang-toggle button.active{background:var(--fg);color:#fff;}

/* Footer */
.site-footer{background:var(--footer-bg);color:var(--footer-fg);padding:40px 0;margin-top:80px;}
.site-footer .wrap{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:24px;}
.footer-brand .logo{color:var(--footer-fg);font-size:18px;margin-bottom:10px;}
.footer-copy{font-size:12px;color:var(--footer-muted);font-family:var(--font-mono);}
.footer-links{display:flex;flex-direction:column;gap:8px;align-items:flex-end;}
.footer-links a{font-size:14px;display:flex;align-items:center;gap:6px;}
.footer-links a:hover{text-decoration:underline;}
.footer-links .arrow{font-size:12px;}

/* Projects grid (landing) */
.projects-page{padding:48px 0 0;}
.project-grid{display:grid;grid-template-columns:1fr 1fr;gap:32px 28px;margin-top:32px;}
.project-card{display:block;}
.project-card.featured{grid-column:1 / -1;}
/* Thumbnail card: background frame + phone-shaped mask + image, matching the Figma component */
.project-card .thumb{
  aspect-ratio:460/620;
  background:var(--surface-subdued);
  border:1px solid var(--card-border);
  border-radius:16px;
  overflow:hidden;
  margin-bottom:16px;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
}
.project-card .thumb .phone{
  width:68.26%;
  aspect-ratio:314/540;
  border-radius:24px 24px 0 0;
  overflow:hidden;
  box-shadow:0 1px 2px rgba(0,0,0,0.08),0 2px 4px rgba(0,0,0,0.1);
}
.project-card .thumb .phone img{width:100%;height:100%;object-fit:cover;display:block;}

/* Featured card: 3 overlapping phones (desktop/tablet); collapses to 1 on mobile */
.project-card.featured .thumb{aspect-ratio:960/620;}
.project-card.featured .thumb .phone-row{width:100%;display:flex;justify-content:center;}
.project-card.featured .thumb .phone{
  width:32.71%;aspect-ratio:314/540;border-radius:32px 32px 0 0;margin-right:-3.33%;
}
.project-card.featured .thumb .phone:last-child{margin-right:0;}

.project-card h3{font-size:20px;font-weight:700;margin-bottom:6px;}
.project-card .meta{font-family:var(--font-mono);font-size:12px;color:var(--muted);line-height:1.5;}
.project-card{transition:opacity .15s ease;}
.project-card:hover{opacity:0.75;}

/* Project detail page */
.project-hero{
  max-width:760px;
  margin-left:auto;margin-right:auto;
  border-radius:10px;
  overflow:hidden;
  margin-top:32px;
}
.project-hero img{width:100%;height:auto;}
.project-title{max-width:760px;margin-left:auto;margin-right:auto;font-size:40px;font-weight:800;margin-top:32px;}
.project-meta-row{
  max-width:760px;margin-left:auto;margin-right:auto;
  display:flex;gap:64px;
  margin-top:24px;padding-bottom:24px;
  border-bottom:1px solid var(--border);
  font-family:var(--font-mono);font-size:13px;
}
.project-meta-row .label{color:var(--muted);margin-bottom:6px;}
.project-meta-row .value{font-weight:700;}
.project-body{max-width:760px;margin-left:auto;margin-right:auto;margin-top:40px;}
.project-body h2{font-size:22px;font-weight:700;margin-top:44px;margin-bottom:14px;}
.project-body h2:first-child{margin-top:0;}
.project-body p{font-size:15px;color:#222;margin-bottom:14px;}
.project-body ul{margin:14px 0;padding-left:20px;}
.project-body li{font-size:15px;color:#222;margin-bottom:8px;}
.project-body li strong{color:var(--fg);}

.project-gallery{max-width:760px;margin-left:auto;margin-right:auto;margin-top:8px;display:flex;flex-direction:column;gap:28px;}
.project-gallery .figure img,
.project-gallery .figure video{width:100%;display:block;border-radius:10px;}

.project-gallery .figure{position:relative;}
.project-gallery .figure:has(img){cursor:zoom-in;}
.project-gallery .figure .expand-btn{
  position:absolute;top:14px;right:14px;
  width:38px;height:38px;border-radius:999px;
  background:rgba(10,10,10,0.6);border:none;color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  opacity:0;transition:opacity .15s ease, background .15s ease;
}
.project-gallery .figure .expand-btn svg{width:17px;height:17px;}
.project-gallery .figure:hover .expand-btn,
.project-gallery .figure .expand-btn:focus-visible{opacity:1;}
.project-gallery .figure .expand-btn:hover{background:rgba(10,10,10,0.85);}

/* Lightbox */
.lightbox-overlay{
  position:fixed;inset:0;z-index:1000;
  background:rgba(8,8,9,0.94);
  display:flex;align-items:center;justify-content:center;
  padding:64px 24px;
}
.lightbox-overlay[hidden]{display:none;}
.lightbox-media{max-width:92vw;max-height:88vh;display:flex;}
.lightbox-media img,
.lightbox-media video{max-width:92vw;max-height:88vh;width:auto;height:auto;display:block;border-radius:8px;}
.lightbox-btn{
  position:fixed;top:22px;
  width:44px;height:44px;border-radius:999px;
  background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.25);color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.lightbox-btn[hidden]{display:none;}
.lightbox-btn:hover{background:rgba(255,255,255,0.2);}
.lightbox-btn svg{width:18px;height:18px;}
.lightbox-close{right:22px;}
.lightbox-fullscreen{right:78px;}

@media (max-width:640px){
  .project-gallery .figure .expand-btn{opacity:1;}
}

.next-project{max-width:760px;margin-left:auto;margin-right:auto;margin-top:64px;}
.next-project .kicker{font-size:22px;font-weight:700;margin-bottom:20px;text-align:right;}
.next-project .project-card{max-width:420px;margin-left:auto;}

/* About page */
.about-page{padding:48px 0 0;}
.about-col{max-width:640px;margin:0 auto;}
.about-photo{border-radius:10px;overflow:hidden;margin-bottom:32px;}
.about-col h1{font-size:32px;font-weight:800;margin-bottom:20px;}
.about-col p{font-size:15px;color:#222;margin-bottom:16px;}

/* Resume page */
.resume-page{padding:48px 0 0;}
.resume-col{max-width:760px;margin:0 auto;}
.resume-col > h1{font-size:36px;font-weight:800;margin-bottom:44px;}
.resume-entry{padding-top:28px;margin-top:28px;border-top:1px solid var(--border);}
.resume-entry:first-of-type{border-top:none;margin-top:0;padding-top:0;}
.resume-entry.education-entry{border-top:none;padding-top:0;margin-top:28px;}
.resume-entry.education-entry:first-of-type{margin-top:0;}
.resume-entry h2{font-size:20px;font-weight:700;margin-bottom:10px;}
.resume-meta{display:flex;gap:48px;font-family:var(--font-mono);font-size:12px;color:var(--muted);margin-bottom:14px;}
.resume-meta .label{display:block;margin-bottom:4px;}
.resume-meta .value{color:var(--fg);font-weight:700;}
.resume-entry p{font-size:14px;color:#222;margin-bottom:12px;}
.resume-entry ul{padding-left:18px;}
.resume-entry li{font-size:14px;color:#222;margin-bottom:6px;}
.resume-section-title{font-size:26px;font-weight:800;margin-top:56px;padding-top:28px;border-top:1px solid var(--border);margin-bottom:24px;}

/* Responsive */
@media (max-width: 900px){
  .wrap{padding:0 24px;}
  .main-nav{margin-left:24px;gap:18px;}
  .project-grid{grid-template-columns:1fr;}
  .project-title{font-size:30px;}
  .resume-col > h1{font-size:28px;}
}

@media (max-width: 640px){
  .site-header .wrap{flex-wrap:wrap;row-gap:14px;}
  .main-nav{margin-left:0;order:3;flex-basis:100%;flex-grow:0;}
  .lang-toggle{margin-left:auto;}
  .project-meta-row{gap:32px;flex-wrap:wrap;}
  .site-footer .wrap{flex-direction:column;}
  .footer-links{align-items:flex-start;}
  .project-title{font-size:26px;}

  /* Featured thumb collapses from 3 phones to 1 on mobile */
  .project-card.featured .thumb{aspect-ratio:460/620;justify-content:flex-end;}
  .project-card.featured .thumb .phone{width:68.26%;border-radius:24px 24px 0 0;margin-right:0;}
  .project-card.featured .thumb .phone ~ .phone{display:none;}
}
