:root{
  --bg:#0b0c10;
  --text:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.65);
  --border:rgba(255,255,255,0.14);
  --panel:rgba(170, 23, 23, 0.03);
  --max: 1292px; /* allow three 420px cards + 2*16px gaps */
  --cards-max: calc(420px * 3 + 16px * 2);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:var(--bg);
  color:var(--text);
}
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

.page{
  max-width:var(--max);
  margin:0 auto;
  padding:90px 18px 60px;
}
@media (min-width: 900px){
  .page{
    /* shift content slightly left by removing side padding on wide screens */
    padding-left: 0;
    padding-right: 0;
  }
}

/* Top bar */
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(11,12,16,0.88);
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:12px 18px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
}
.brand{ font-weight:650; }

.links{ display:flex; gap:10px; }
.link{
  color:var(--muted);
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.link:hover{
  text-decoration:underline;
  border-color:transparent;
  background:transparent;
}
.link-icon{
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

/* Pills */
.pills{
  display:flex;
  gap:10px;
  justify-content:center;
  overflow-x:auto;
  scrollbar-width:none;
  padding:2px 2px;
}
.pills::-webkit-scrollbar{ display:none; }

.pill{
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:14px;
  color:var(--muted);
  white-space:nowrap;
  background:rgba(255,255,255,0.02);
}
.pill:hover{
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,0.06);
}
.pill.active{
  color:var(--text);
  background:rgba(255,255,255,0.10);
}

/* Intro */
.intro{
  width: min(100%, min(var(--max), var(--cards-max)));
  margin: 0 auto;
}
.intro h1{
  margin:0 0 8px;
  font-size:34px;
  letter-spacing:-0.6px;
}
.sub{
  margin:0;
  color:var(--muted);
}

/* Cards (home) */
.cards{
  margin-top:22px;
  display:grid;
  grid-template-columns:repeat(3, minmax(200px, 1fr));
  gap:16px;
  width: min(100%, min(var(--max), var(--cards-max)));
  margin-left:auto;
  margin-right:auto;
}
@media (max-width:860px){
  .cards{ grid-template-columns:1fr; }
  .topbar-inner{ grid-template-columns:1fr; justify-items:center; }
  .links{ justify-content:center; }
}

.card{
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  background:var(--panel);
}
.card:hover{ border-color:rgba(255,255,255,0.22); }

.card-media{
  aspect-ratio:16/9;
  background:rgba(255,255,255,0.05);
}
.card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.card-body{ padding:14px; }
.card-title{ font-weight:650; margin-bottom:6px; }
.card-sub{ color:var(--muted); font-size:14px; line-height:1.4; }

/* Project page head */
.project-head h2{
  margin:0 0 10px;
  font-size:28px;
  letter-spacing:-0.4px;
}
.one-liner{
  margin:0 0 12px;
  color:var(--muted);
  line-height:1.4;
}
.tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.tags span{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.02);
  color:rgba(255,255,255,0.78);
}

/* Content grid blocks */
.grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:18px;
  align-items:start;
}
@media (max-width:860px){
  .grid{ grid-template-columns:1fr; }
}

.media, .block{
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:16px;
  padding:12px;
  margin:0;
}
.wide{ grid-column:1 / -1; }

.block h3{ margin:0 0 8px; font-size:16px; }
.block p{ margin:0 0 10px; color:var(--muted); line-height:1.45; }
.block ul{ margin:0; padding-left:18px; color:rgba(255,255,255,0.80); line-height:1.5; }
.block li{ margin:6px 0; }

.img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
}

.media figcaption{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

/* Placeholder image*/
.ph{
  border-radius:12px;
  border:1px dashed rgba(255,255,255,0.22);
  background:rgba(255,255,255,0.03);
  min-height:260px;
  display:grid;
  place-items:center;
  padding:18px;
}
.wide .ph{ min-height:340px; }
.ph::before{
  content: attr(data-ph);
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
  line-height: 1.35;
}

/* Carousel */
.carousel-wrap{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  background:var(--panel);
}
.carousel-head h3{ margin:0 0 6px; font-size:16px; }
.carousel-note{ margin:0 0 12px; color:var(--muted); font-size:14px; }

.carousel{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(280px, 1fr);
  gap:14px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  padding-bottom:6px;
  scrollbar-width:thin;
}
.carousel-item{ margin:0; scroll-snap-align:start; }
.carousel-item figcaption{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.footer{
  margin-top:60px;
  border-top:1px solid var(--border);
  padding-top:18px;
  color:var(--muted);
  font-size:14px;
}

/* ===== Arrow carousel (single frame) ===== */
.carousel2-wrap{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  background:var(--panel);
  outline: none;
}
.carousel2-head h3{ margin:0 0 6px; font-size:16px; }
.carousel2-note{ margin:0 0 12px; color:var(--muted); font-size:14px; }

.carousel2-frame{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.35);
  padding: 14px;
}

.carousel2-viewport{
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
}

.carousel2-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* side cards height match */
.grid > .block{
  height: 100%;
}

.carousel2-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(0,0,0,0.35);
  color:rgba(255,255,255,0.92);
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.carousel2-btn:hover{ background:rgba(0,0,0,0.55); }
.carousel2-btn:disabled{ opacity:0.4; cursor:default; }
.carousel2-btn.left{ left:12px; }
.carousel2-btn.right{ right:12px; }

.carousel2-caption{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.carousel2-dots{
  margin-top:10px;
  display:flex;
  gap:8px;
}
.carousel2-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.25);
  background:transparent;
  cursor:pointer;
}
.carousel2-dot.active{
  background:rgba(255,255,255,0.8);
  border-color:rgba(255,255,255,0.8);
}

/* video block */
.video-wrap{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  background:var(--panel);
}
.video-head{
  margin:0 0 10px;
  font-size:16px;
}
.video{
  width:100%;
  border-radius:14px;
  display:block;
  background:black;
  aspect-ratio:16/9;
}
.video-caption{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

/* Global 80% visual scale */
html { zoom: 0.8; }

/* Fallback for browsers without zoom (e.g., Firefox) */
@supports not (zoom: 1){
  body{
    transform: scale(0.8);
    transform-origin: top center;
  }
}
