:root {
  --bg: #ffffff; --text: #111416; --muted: #6b7280;
  --card: #f8f9fb; --accent: #333a45; --ring: rgba(25, 30, 38, 0.4);
}
html[data-theme="dark"] {
  --bg: #0b0e11; --text: #e5e7eb; --muted: #9ca3af;
  --card: #151922; --accent: #60a5fa; --ring: rgba(96,165,250,.4);
}
* { box-sizing: border-box; } body { margin:0; background:var(--bg); color:var(--text);
  font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Inter,sans-serif;}
.container { width:min(100%,860px); margin:0 auto; padding:0 16px; }

.accent{ color:var(--accent);} .bullets{ margin:8px 0 0; padding-left:18px;}
.stack{ padding-top:48px ; } .stack h2{ margin:0 0 6px; font-size:27px; } .muted{ color:var(--muted);} .small{ font-size:14px;}

.grid{ margin-top:16px; display:grid; gap:12px; grid-template-columns:1fr;}
@media(min-width:720px){ .grid{ grid-template-columns:repeat(3,1fr);} }

.card{ display:block; padding:14px; border-radius:14px; background:var(--card); color:var(--text);
  text-decoration:none; border:1px solid color-mix(in oklab,var(--text) 10%,transparent);}
.card h3{ margin:0 0 6px; font-size:18px;} .card p{ margin:0; color:var(--muted);} .card:hover{ outline:2px solid var(--ring); }

.post{ padding:12px 0; border-bottom:1px dashed color-mix(in oklab,var(--text) 10%,transparent);}
.post:last-of-type{ border-bottom:0;} .post h3{ margin:0; font-size:18px;} .post a{ color:var(--text); text-decoration:none;}
.post a:hover{ color:var(--accent);}

.inline-btn{ text-decoration:none; color: var(--accent);} .inline-btn:hover{ text-decoration:underline;}
.subscribe{ display:flex; gap:8px; margin-top:8px;}
.subscribe input, .subscribe button{
  padding:10px 12px; border-radius:12px; border:1px solid color-mix(in oklab,var(--text) 15%,transparent);
}
.subscribe input{ flex:1; background:var(--bg); color:var(--text);}
.subscribe button{ background:var(--card); color:var(--text); cursor:pointer;}
.subscribe button:hover{ outline:2px solid var(--ring); }

/* header + footer shells get basic styling from the components */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: background 0.3s;
}

.slider::before {
  content: "☀︎";
  position: absolute;
  height: 22px; width: 22px;
  left: 2px; top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s, content 0.3s;
}

/* Checked state = Dark mode */
.theme-switch input:checked + .slider {
  background-color: var(--accent);
}

.theme-switch input:checked + .slider::before {
  content: "⏾";
  color: black;
  transform: translateX(24px);
}

/* ===== Header ===== */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
}
.nav{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 1rem; }
.brand{ text-decoration:none; color:var(--text); font-weight:700; }
.links{ display:flex; align-items:center; gap:16px; }
.links a{ text-decoration:none; color:var(--text); opacity:.9; }
.links a:hover{ opacity:1; color:var(--accent); }

/* mobile toggle */
.menu-btn{
  display:none; cursor:pointer; padding:6px 10px; border-radius:10px;
  background:var(--card);
  border:1px solid color-mix(in oklab,var(--text) 20%,transparent);
  color:var(--text);
}

/* ===== Pure-SVG Toggle (no icon libs) ===== */
.theme-switch{ position:relative; display:inline-block; width:56px; height:30px; }
.theme-switch input{ position:absolute; inset:0; opacity:0; pointer-events:none; }
.theme-switch .track{
  position:absolute; inset:0; border-radius:30px; background:#cfd3da; transition:background .25s ease;
}
.theme-switch .knob{
  position:absolute; top:2px; left:2px; width:26px; height:26px;
  border-radius:50%; background:var(--bg);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
  transition: transform .25s ease;
  color: var(--text);
}
.theme-switch .knob svg{ display:block; }
.theme-switch input:checked + .track{ background: var(--accent); }
.theme-switch input:checked ~ .knob{ transform: translateX(26px); color: #fff; }

/* ===== Mobile overlay ===== */
.menu-panel{
  position:fixed; inset:0; background:color-mix(in oklab,var(--bg) 65%, transparent);
  backdrop-filter: blur(10px) saturate(150%);
  display:grid; place-items:center;
}
.menu-card{
  width:min(88vw,560px); background:var(--bg); border-radius:18px; padding:22px 18px;
  border:1px dashed color-mix(in oklab,var(--text) 20%, transparent);
  position:relative; box-shadow:0 10px 30px rgba(0,0,0,.06);
}
.menu-panel[hidden]{ display: none; }

.menu-close{ position:absolute; right:12px; top:10px; background:transparent; border:0; font-size:22px; color:var(--text); cursor:pointer; }
.menu-links{ display:flex; flex-direction:column; align-items:center; gap:18px; padding:10px 0 6px; }
.menu-links a{ text-decoration:none; color:var(--text); font-size:18px; font-weight:600; }

/* ===== Responsive ===== */
@media (max-width: 720px){
  .links{ display:none; }           /* hide desktop links */
  .menu-btn{ display:inline-block; }/* show hamburger */
}

@media (min-width: 721px){
  .menu-btn{ display:none; }
  .menu-panel{ display:none !important; }
}

.actions{
  margin-left:auto;                   /* pushes this group to the right */
  display:flex; align-items:center; gap:22px;
}

.menu-btn{
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  border: 1px dashed color-mix(in oklab, var(--text) 20%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

/* only show on mobile */
@media (max-width: 720px){
  .menu-btn{ display: inline-flex; }  /* show burger only on small screens */
}

/* ensure hidden on desktop */
@media (min-width: 721px){
  .menu-btn{ display: none; }         /* redundant but explicit */
}

/* Two-column hero */
.hero-split{
  display:flex;
  align-items:center;
  gap:40px;
  padding:48px 0 8px;
}

/* remove the huge offset your old .hero had */
.hero { margin:0; }

.hero-left{ flex:1; }
.hero-left h1{ font-size:clamp(28px,3vw+12px,44px); margin:0 0 12px; }
.hero-left .muted{ color:var(--muted); }

.hero-right{ flex:1; display:flex; justify-content:center; }

.image-box{
  width:100%;
  max-width:420px;
  background:var(--card);
  border:1px dashed color-mix(in oklab,var(--text) 20%,transparent);
  border-radius:18px;
  padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
}
.image-box img{ width:100%; height:auto; border-radius:12px; display:block; }

/* Stack on mobile */
@media (max-width:720px){
  .hero-split{ flex-direction:column;  }
  .hero-right{ width:100%; }
  .image-box{ 
    margin-top:12px; 
    max-width:310px;
  }
}


/* Grid: 1 column on mobile, 3 columns ≥720px */
projects-grid .grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  projects-grid .grid { grid-template-columns: repeat(3, 1fr); }
}

/* Show only 6 on the home page (3×2); remove on the /projects page */
projects-grid .project-card:nth-of-type(n+7) { display: none; }

/* Card visuals */
.card.project-card{
  padding:10px; border-radius:16px; background:var(--bg);
  border:1px dashed color-mix(in oklab,var(--text) 18%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, outline-color .15s ease;
}
.card.project-card:hover{
  transform: translateY(-1px);
  outline: 2px solid var(--ring);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* Thumbnail area */
.project-card .thumb{
  width:100%; aspect-ratio:16/10;
  border-radius:12px; overflow:hidden; background: var(--card);
  border:1px solid color-mix(in oklab,var(--text) 10%, transparent);
  display:grid; place-items:center;
}
.project-card .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.project-card .thumb-ph{ font-size:12px; color:var(--muted); }

/* Meta */
.project-card .meta{ padding:10px 6px 4px; }
.project-card h3{ margin:0 0 4px; font-size:16px; line-height:1.35; }
.project-card p{ margin:0; color:var(--muted); font-size:13.5px; }

/* Center the “View all my projects” button under the grid */
.view-more-btn {
  display:block; margin: 18px auto 0; width:fit-content;
  padding:10px 16px; border-radius:999px; text-decoration:none;
  color:var(--text);
  background: color-mix(in oklab, var(--text) 8%, transparent);
  border:1px solid color-mix(in oklab, var(--text) 15%, transparent);
}
.view-more-btn:hover { transform: translateY(-1px); }

/* ===== Footer ===== */
.site-footer{
  border-top:1px solid color-mix(in oklab, var(--text) 12%, transparent);
  margin-top:32px;
}
.footer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 1rem;
}

.footer-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.footer-brand{
  text-decoration:none;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
}
.divider{
  width:1px; height:18px;
  background: color-mix(in oklab, var(--text) 22%, transparent);
  display:inline-block;
}
.copyright{
  color:var(--muted);
  white-space:nowrap;
}

.social {
  display:flex;
  align-items:center;
  gap:12px;
}

/* Add this block (it was missing) */
.social .icon-btn{
  width:34px; height:34px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:50%;
  text-decoration:none;
  color: var(--text);
}
.social .icon-btn:hover{
  
  transform: translateY(-1px);
  outline: 1px dashed var(--muted);
}

.icon-btn img { filter: invert(var(--invert-icon, 0)); }
[data-theme="light"] .icon-btn img { --invert-icon: 1; }

/* mobile stacking */
@media (max-width: 560px){
  .footer-row{ 
    align-items:flex-start; 
    gap:10px; 
  }
  .social{ 
    margin-left:auto; 
  }
}


/* ===== Single post layout ===== */
.post-article{
  max-width: 720px;
  margin: 0 auto;
}
.post-title{
  margin: 6px 0 8px;
  font-size: clamp(24px, 3vw + 10px, 36px);
  line-height: 1.2;
}
.post-h2{
  margin: 18px 0 8px;
  font-size: 20px;
}
.post-sep{
  border: 0;
  border-top: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  margin: 18px 0 16px;
}

/* Smaller, centered figures */
.post-figure{
  width: 100%;
  max-width: 440px;           
  margin: 12px auto;
  background: var(--card);
  border: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  border-radius: 14px;
  padding: 10px;
}
.post-figure img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.post-figure.cover{
  max-width: 480px;           
}
.post-figure figcaption{
  text-align: center;
  margin-top: 6px;
}

/* ===== Mobile tweaks for single post ===== */
@media (max-width: 560px){

  /* overall post container */
  .post-article{
    max-width: 100%;
    padding: 0 10px;        /* a bit of side padding */
  }

  .post-title{
    font-size: 22px;
    line-height: 1.25;
    margin: 4px 0 6px;
  }

  .post-h2{
    font-size: 18px;
    margin: 14px 0 6px;
  }

  .post-sep{ margin: 14px 0; }

  /* figures: a bit narrower and lighter on mobile */
  .post-figure{
    max-width: 94%;         /* was 520px desktop; now % for small screens */
    margin: 10px auto;
    padding: 8px;
    border-radius: 12px;
  }
  .post-figure.cover{
    max-width: 95%;         /* cover slightly wider than inline figures */
  }
  .post-figure img{
    border-radius: 10px;
  }
  .post-figure figcaption{
    font-size: 12px;
    margin-top: 4px;
  }

  /* footer icons: keep tappable size */
  .social .icon-btn{
    width: 40px; height: 40px;   /* bigger tap target */
  }
}

/* ===== Single project layout ===== */
.project-article{
  max-width: 720px;
  margin: 0 auto;
}
.project-title{
  margin: 6px 0 8px;
  font-size: clamp(24px, 3vw + 10px, 36px);
  line-height: 1.2;
}
.project-h2{
  margin: 18px 0 8px;
  font-size: 20px;
}
.project-sep{
  border: 0;
  border-top: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  margin: 18px 0 16px;
}

/* Smaller, centered figures */
.project-figure{
  width: 100%;
  
  margin: 12px auto;
  background: var(--card);
  border: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  border-radius: 14px;
  padding: 10px;
}
.project-figure img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.project-figure.cover{
  max-width: 430px;
}
.project-figure figcaption{
  text-align: center;
  margin-top: 6px;
}

/* ===== Mobile tweaks for projects ===== */
@media (max-width: 560px){
  .project-article{
    max-width: 100%;
    padding: 0 10px;
  }
  .project-title{
    font-size: 22px;
    margin: 4px 0 6px;
  }
  .project-h2{
    font-size: 18px;
    margin: 14px 0 6px;
  }
  .project-figure{
    max-width: 94%;
    margin: 10px auto;
    padding: 8px;
  }
  .project-figure.cover{
    max-width: 96%;
  }
  .project-figure figcaption{
    font-size: 12px;
  }
}

/* ===== About page ===== */
.about { gap: 24px; }

/* Hero */
.about-hero{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: center;
}
.about-avatar{
  margin: 0;
  width: 160px;
  height: 160px;
  border-radius: 16px;
  padding: 10px;
  background: var(--card);
  border: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  display: grid; place-items: center;
}
.about-avatar img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.about-intro h1{ margin: 0 0 6px; }
.about-cta{ display:flex; gap:10px; margin-top:10px; }

/* Quick facts */
.about-facts{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}
.about-facts .fact{
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px dashed color-mix(in oklab, var(--text) 18%, transparent);
  min-height: 64px;
  display: grid; align-content: center; gap: 4px;
}
.about-facts .fact strong{ font-weight: 700; }
.about-facts .fact span{ color: var(--muted); }

/* Chips */
.chipset{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 6px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--text) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--text) 16%, transparent);
  font-size: 13px;
}
.chip.link{ text-decoration:none; color: var(--text); }

/* Timeline */
.timeline{ list-style:none; padding:0; margin:0; display:grid; gap:12px; }
.timeline li{ display:grid; grid-template-columns: 14px 1fr; gap:12px; }
.t-bullet{
  width:10px; height:10px; margin-top:10px;
  border-radius:50%;
  background: var(--text);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--text) 20%, transparent);
}
.t-content h3{ margin:0 0 2px; }
.t-content p{ margin:0 0 6px; }

/* Mobile */
@media (max-width: 720px){
  .about-hero{ grid-template-columns: 100px 1fr; }
  .about-avatar{ width:100px; height:100px; padding:8px; }
}
@media (max-width: 560px){
  .about-hero{ grid-template-columns: 1fr; }
  .about-avatar{ margin: 0 auto; }
  .about-facts{ grid-template-columns: 1fr 1fr; }
}
