:root{
  --bg: #0b0e14;
  --panel: #0f1420;
  --text: #e9eef7;
  --muted: rgba(233,238,247,.72);
  --border: rgba(233,238,247,.14);
  --accent: #8cf0ff;
  --shadow: 0 10px 35px rgba(0,0,0,.35);

  --radius: 14px;
  --container: 1100px;
  --space: 16px;

  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="light"]{
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #121826;
  --muted: rgba(18,24,38,.68);
  --border: rgba(18,24,38,.12);
  --accent: #006dff;
  --shadow: 0 10px 35px rgba(18,24,38,.12);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a{color:inherit}
code{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 18px;
}

.narrow{max-width: 860px}

.site-header{
  position: sticky;
  top:0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}
.brand-mark{
  width: 34px;
  height: 34px;
  display:grid;
  place-items:center;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.brand-text{font-weight: 650; letter-spacing: .2px}

.nav{display:flex; gap: 14px}
.nav-link{
  text-decoration:none;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
}
.nav-link:hover{background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--text)}
.nav-link.is-active{background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--text); border: 1px solid var(--border)}

.header-actions{display:flex; gap:10px; align-items:center}

.icon-btn{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.icon-btn:hover{background: color-mix(in srgb, var(--panel) 70%, transparent)}

.mobile-menu-btn{display:none}

.mobile-nav{
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav-inner{padding: 12px 18px; display:grid; gap:10px}
.mobile-link{padding: 10px 12px; border-radius: 12px; text-decoration:none; border:1px solid var(--border)}
.mobile-link:hover{background: color-mix(in srgb, var(--panel) 70%, transparent)}

.site-main{min-height: 70vh}

.hero{padding: 46px 0 10px}
.hero-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}
.kicker{color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 12px}
.h1{font-size: clamp(34px, 4vw, 52px); line-height: 1.05; margin: 10px 0}
.h2{font-size: 22px; margin: 0 0 10px}
.h3{font-size: 18px; margin: 10px 0}
.lead{font-size: 18px; color: var(--muted); margin: 0 0 18px}

.hero-actions{display:flex; gap: 10px; flex-wrap: wrap}
.hero-cta{margin-top: 14px; display:flex; gap: 10px; align-items:center; flex-wrap: wrap}

.section{padding: 30px 0}
.section-head{display:flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px}

.grid{display:grid; gap: 14px}
.cards-3{grid-template-columns: repeat(3, minmax(0,1fr))}
.cards-2{grid-template-columns: repeat(2, minmax(0,1fr))}

.card{
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.meta{color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase}
.muted{color: var(--muted)}
.small{font-size: 13px}

.tags{display:flex; gap:8px; flex-wrap: wrap; margin-top: 10px}
.tag{
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #001018;
  text-decoration:none;
  font-weight: 650;
  cursor:pointer;
}
.btn:hover{filter: brightness(0.98)}
.btn-ghost{
  background: transparent;
  color: var(--text);
}
.link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border));
}
.link:hover{border-bottom-style: solid}

.bullets{margin: 10px 0 0 18px; color: var(--muted)}
.spacer{height: 14px}

.cta-band{
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.cta-title{font-weight: 750; margin-bottom: 4px}
.cta-actions{display:flex; gap: 10px; flex-wrap: wrap}

.pixel-line{
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 55%, transparent) 0px,
    color-mix(in srgb, var(--accent) 55%, transparent) 6px,
    transparent 6px,
    transparent 10px
  );
  margin: 12px 0;
}

.writing-head{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filters{display:flex; gap: 8px; flex-wrap: wrap}
.chip{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor:pointer;
}
.chip.is-active{
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.post-details summary{
  margin-top: 12px;
  cursor: pointer;
  color: var(--text);
}
.prose p{color: var(--muted); margin: 10px 0 0}

.about-grid{grid-template-columns: 1fr 1fr}
.avatar{display:flex; gap: 12px; align-items:center}
.avatar-placeholder{
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--border);
  display:grid;
  place-items:center;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.contact-form{display:grid; gap: 12px}
.contact-form label span{display:block; font-size: 13px; color: var(--muted); margin-bottom: 6px}
.contact-form input, .contact-form textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
}
.contact-actions{display:flex; gap: 10px; flex-wrap: wrap; margin-top: 4px}

.site-footer{
  border-top: 1px solid var(--border);
  padding: 26px 0;
  margin-top: 30px;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 14px;
}
.footer-title{font-weight: 700; margin-bottom: 6px}
.footer-links{display:grid; gap: 8px}
.footer-links a{color: var(--muted); text-decoration:none}
.footer-links a:hover{color: var(--text)}
.footer-bottom{margin-top: 16px}

@media (max-width: 900px){
  .hero-grid{grid-template-columns: 1fr}
  .cards-3{grid-template-columns: 1fr}
  .cards-2{grid-template-columns: 1fr}
  .about-grid{grid-template-columns: 1fr}
  .nav{display:none}
  .mobile-menu-btn{display:grid}
  .footer-grid{grid-template-columns: 1fr}
}
/* =========================
   About page + Highlights (consolidated)
   ========================= */

/* Global safety: images should never overflow their containers */
img{
  max-width: 100%;
  height: auto;
}

/* About layout: keep columns top-aligned and slightly favor the right column */
.about-grid{
  grid-template-columns: 0.95fr 1.05fr;
  align-items: start;
}

/* Make the left card feel intentional instead of "empty space" */
.about-sticky{
  position: sticky;
  top: calc(64px + 16px); /* header height (64px) + spacing */
}

/* Highlights shelf */
.highlights-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

/* Each tile must be allowed to shrink inside the grid */
.highlight{
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.highlight-figure{
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Hard lock the media to the tile so it can’t spill out */
.highlight-figure img{
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.highlight-figure figcaption{
  padding-top: 8px;
}

.highlight-quote{
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}

.highlight-quote p{ margin: 0 0 10px 0; }
.highlight-quote cite{ font-style: normal; }

/* Mobile */
@media (max-width: 900px){
  .about-grid{ grid-template-columns: 1fr; }
  .about-sticky{ position: static; }
  .highlights-grid{ grid-template-columns: 1fr; }
}
/* About + Highlights: hard clamp to prevent overflow */
.highlights-grid,
.highlight,
.highlight-figure{
  min-width: 0;
  overflow: hidden;
}

.highlights-grid img,
.highlight img,
.highlight-figure img,
img.highlight-img{
  display: block;
  max-inline-size: 100%;
  width: 100%;
  height: auto;
}

/* Optional: make all highlight images uniform tiles */
.highlight-figure img,
img.highlight-img{
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Sticky only on desktop */
.about-sticky{
  position: sticky;
  top: calc(64px + 16px);
}
@media (max-width: 900px){
  .about-sticky{ position: static; }
  .highlights-grid{ grid-template-columns: 1fr; }
}
.avatar-img{
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
@media (max-width: 1100px){
  .highlights-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .highlights-grid{ grid-template-columns: 1fr; }
}
/* About top section polish */
.avatar{
  align-items: center;
  gap: 14px;
}

.avatar .kicker{
  margin-bottom: 2px;
}

/* Make the tags feel a bit tighter and less “floaty” */
.tags{ margin-top: 12px; }
.tag{ padding: 4px 10px; }

/* Highlights: slightly tighter captions and nicer spacing */
.highlight-figure figcaption{
  margin-top: 8px;
  line-height: 1.35;
}

/* Optional: make the topic label lighter inside tiles */
.highlight .kicker{
  font-size: 11px;
  letter-spacing: .16em;
}

/* Optional: subtle hover lift on highlight tiles */
.highlight{
  transition: transform .12s ease, filter .12s ease;
}
.highlight:hover{
  transform: translateY(-2px);
  filter: brightness(1.03);
}
