:root {
  /* 🌑 Background */
  /* --color-bg-main: #0F172A;        /* deepest background */
  /*--color-bg-secondary: #1E293B;   /* hover / subtle panels */
  /*--color-bg-card: #273449;        /*cards / sections */

  --color-bg-main: #121314;
  --color-bg-secondary: #191a1b;
  --color-bg-card: #191a1b;

  /* ✨ Accent */
  --color-accent: #8B5CF6;         /* primary accent (buttons, highlights) */

  /* 📝 Text */
  --color-text-main: #E2E8F0;      /* main readable text */
  --color-text-highlight: #C4B5FD; /* highlighted / important text */
  --color-text-muted: #94A3B8;     /* secondary / muted text */

  /* spacing scale — use instead of one-off inline margins */
  --space-xs: 0.25rem;
  --space-s: 0.5rem;
  --space-m: 1rem;
  --space-l: 2rem;
  --space-xl: 3rem;
}

body {
  background: var(--color-bg-main);
  color: var(--color-text-main);
  padding: var(--space-l);
}
.main-body {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (max-width: 750px) {
  .main-body {
    padding: 0 0;
  }
  body {
    padding: var(--space-m);
  }
}
a {
  color: var(--color-accent);
}
p {
  color: var(--color-text-muted);
}
.page-title {
  font-size: clamp(1.8rem, 4vw + 1rem, 2.5rem);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}
h3 {
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.3rem);
  color: var(--color-text-highlight);
  margin-bottom: var(--space-sm);
}
h2 {
  font-size: 1.75rem;
  color: var(--color-text-highlight);
  border-bottom: 1px solid var(--color-text-muted);
  padding-bottom: 2px;
}
h1 {
  font-size: 2.5rem;
  color: var(--color-accent);
}
/* Small caption text under a figure/image */
.fig-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-xs);
  opacity: 0.85;
}
/* Simple spacing utilities — replaces scattered inline margin-top: Npx */
.mt-xs { margin-top: var(--space-xs); }
.mt-s  { margin-top: var(--space-s); }
.mt-m  { margin-top: var(--space-m); }
.mt-l  { margin-top: var(--space-l); }
.mt-xl { margin-top: var(--space-xl); }


/* header styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--color-bg-secondary);
  padding: 2rem 1rem 1.5rem;
  z-index: 1000;
  transition: all 0.3s ease;

  border-bottom: 2px solid #2a2b2c;
}
header h1 {
  margin-bottom: 0rem;
}
/* header scroll effect */
header .subtitle {
  opacity: 1;
  max-height: 100px;
  transition: all 0.3s ease;
}
/* collapsed state */
header.shrink .subtitle {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}
header.shrink {
  padding: 0.5rem 1rem 0.75rem;
}
header a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.header-icon {
  margin-top: 0px;
  height: 80px;  
  width: auto;
  transition: all 0.3s ease;
}
@media (max-width: 750px) {
  .header-icon {
    display: none;
  }
}
header.shrink .header-icon {
  height: 40px;
  margin-top: 5px;
}
.row {
    display: flex;
    gap: var(--space-l);
}
/* special right and left for keycap sizing section */
.special-left {
    flex: 1;
}
.special-right {
    flex: 2;
}
@media (max-width: 750px) {
  .row {
    flex-direction: column;
  }
  .spec-left,
  .spec-right {
    flex: 1 1 100%;
    width: 100%;
  }
}
.left {
    flex: 1;
}
.right {
    flex: 2;
}
.left,
.right {
    width: 0;
    height: auto;
    object-fit: contain;
}


/* now working on widget */
.now-working {
    display: inline-flex;
    align-items: center;
    gap:  var(--space-sm);

    background: var(--color-bg-card);
    color: var(--color-text-main);

    padding: 0.5rem 0.9rem;
    border-radius: 999px;

    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.05);

    font-size: 0.9rem;
    font-weight: 500;
}
.now-working .label {
    color: var(--color-text-muted);
}
.now-working .value {
    color: var(--color-text-highlight);
    position: relative;
    display: inline-0.5;
    align-items: center;
}
/* subtle animated dot */
.now-working .value::after {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    margin-bottom: 2px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}




/* Footer styles */
footer {
  margin-top: 4rem;
  opacity: 0.6;
  font-size: 0.9rem;
  z-index: 100;
}
.mini-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;

  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(8px);

  color: #aaa;
  font-size: 12px;
  text-align: center;

  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);

  letter-spacing: 0.5px;
}
.mini-footer p {
  margin: 0;
  transition: color 0.2s ease;
}

.mini-footer p:hover {
  color: #fff;
}





/* hero image styles */
.blog-hero-image {
  margin-bottom: var(--space-l);
  overflow: hidden;
  margin-top: 130px;
}
.blog-hero-image img {
  width: 100%;
  max-height: 700px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
@media (max-width: 750px) {
  .blog-hero-image img {
    max-height: 220px;
    border-radius: 8px;
  }
}




/* code block styles */
.code-wrapper {
  position: relative;
  margin: 10px 0;
}
/* Collapsible */
details {
  border-radius: 6px;
  overflow: hidden;
}

/* Click header */
summary {
  cursor: pointer;
  padding: 8px 10px;
  background: #2d2d2d;
  color: #fff;
  font-weight: bold;
}

/* Remove default triangle spacing */
summary::-webkit-details-marker {
  display: none;
}

/* Code block */
pre {
  margin: 0;
  font-size: 13px;
  max-height: 300px;
  overflow: auto;
  border-radius: 0 0 6px 6px;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 40px; /* adjusted so it sits inside details */
  right: 25px;
  background: #3a3a3a;
  color: white;
  border: none;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
}

.copy-btn:hover {
  background: #555;
}

/* KEY FIX: remove only top margin, keep structure intact */
details {
  margin: 0;
  padding: 0;
}

/* Header */
summary {
  margin: 0;
  padding: 8px 10px;
  background: #2d2d2d;
  color: #fff;
  cursor: pointer;
}

/* KEY FIX: remove only top margin, keep structure intact */
pre[class*="language-"] {
  margin: 0 !important;
  padding: 12px;
  max-height: 600px;
  overflow: auto;
}




/* Download Button */
.download-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

.download-btn:hover {
    background: var(--color-accent); /* slightly darker purple */
    transform: translateY(-2px);
}








/* ============================================
   IMAGESTACK — horizontal on desktop, vertical on mobile
   ============================================ */
/* important for all images */
.imagestack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-m);
  width: 100%;
}

.imagestack img,
.imagestack video {
  flex: 1 1 0;
  min-width: 0;       /* allows flex items to shrink below content size */
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 750px) {
  .imagestack {
    flex-direction: column;
    align-items: center;
  }
  .imagestack img,
  .imagestack video {
    max-height: 260px;
    width: 100%;
  }
}
/* ============================================
   Text with image
   ============================================ */
/* text box with image */
.text-with-image {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  width: 100%;
}
.text-with-image.reverse {
  flex-direction: row-reverse;
}
.text-with-image > img,
.text-with-image > .imagestack {
  flex: 1 1 45%;
  min-width: 0;
}
.text-with-image > img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.text-with-image > div,
.text-with-image > p {
  flex: 1 1 33%;
  min-width: 0;
}
.text-with-image > .row {
    flex: 1 1 45%;
    min-width: 0;
}
@media (max-width: 750px) {
  .text-with-image,
  .text-with-image.reverse {
    flex-direction: column;
  }
}
/* ============================================
   Lone image
   ============================================ */
.lone-image {
  display: flex;
  justify-content: center;
}
.lone-image img{
  width: 100%;
  height: auto;
  border-radius: 8px; 
  margin-top: var(--space-s);
  margin-bottom: var(--space-s);
}
/* ============================================
   Image Row
   ============================================ */
.image-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--space-m);
}
.image-row img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
@media (max-width: 750px) {
    .stack-mobile {
        grid-template-columns: 1fr !important;
    }
}




/* ============================================
   Keyboard Spec
   ============================================ */
/* Unordered list css*/
ul.keyboard-spec {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
ul.keyboard-spec li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--color-text-main);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
/* subtle spacing between rows */
ul.keyboard-spec li + li {
  margin-top: 4px;
}
/* left side (key name) */
ul.keyboard-spec li span:first-child {
  color: var(--color-text-main);
}
/* right side (size) */
ul.keyboard-spec li span:last-child {
  color: var(--color-text-muted);
  font-family: monospace;
  border-bottom: none;
}

