:root {
  --bg: #0F1417;
  --panel: #161D21;
  --border: #262F35;
  --text: #E8E6E1;
  --text-dim: #8B959B;
  --green: #3EA35E;
  --green-dim: #2B8C4A;
  --amber: #D9A441;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--green-dim);
  color: #fff;
}

.wrap {
  max-width: 820px;
  width: min(92%, 820px);
  margin: 0 auto;
  padding: 0 24px;
}

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.back-link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-link:hover {
  color: var(--green);
}

.proj-hero {
  padding: 56px 0 0;
}

.proj-hero .wrap {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.proj-hero-desc {
  color: var(--text-dim);
  font-size: clamp(14px, 1.6vw, 17px);
  max-width: 100%;
  margin-bottom: 22px;
  overflow: hidden;
}

.proj-hero-desc p {
  margin-bottom: 12px;
}

.proj-hero-desc ul,
.proj-hero-desc ol {
  padding-left: 24px;
  margin-bottom: 12px;
}

.proj-hero-desc blockquote {
  border-left: 3px solid var(--green-dim);
  padding: 4px 16px;
  margin-bottom: 12px;
}

.tech-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  background: rgba(217, 164, 65, 0.08);
  border: 1px solid rgba(217, 164, 65, 0.25);
  padding: 3px 9px;
  border-radius: 20px;
}

.hero-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
}

.btn:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--green-dim);
  border-color: var(--green-dim);
  color: #fff;
}

.btn.primary:hover {
  background: var(--green);
  color: #fff;
}

.thumb-wrap {
  width: 100%;
  margin-top: 28px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

.thumb-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.sections {
  padding: 30px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-block {
  position: relative;
  padding-left: 26px;
}

.section-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.section-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 14px;
}

.section-text {
  color: var(--text-dim);
  font-size: clamp(14px, 1.5vw, 15.5px);
  line-height: 1.8;
  max-width: 100%;
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
}

.section-text p {
  margin-bottom: 14px;
}

.section-text a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-text ul,
.section-text ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.section-text li {
  margin-bottom: 4px;
}

.section-text h1,
.section-text h2,
.section-text h3,
.section-text h4,
.section-text h5,
.section-text h6 {
  color: var(--text);
  line-height: 1.5;
  margin: 18px 0 10px;
}

.section-text blockquote {
  border-left: 3px solid var(--green-dim);
  padding: 6px 16px;
  margin-bottom: 14px;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.image-gallery.single {
  grid-template-columns: 1fr;
}

.gallery-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 8px 12px;
  overflow: hidden;
}

.image-gallery.single .media-frame {
  position: relative;
  width: 100%;
  min-height: 320px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}

.image-gallery:not(.single) .media-frame {
  position: relative;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.gallery-item img:hover {
  opacity: 0.85;
}

.gallery-item .caption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  padding: 0 4px;
  text-align: center;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.video-embed.media-loaded iframe {
  opacity: 1;
}

.video-expand {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}

.video-embed.media-loaded .video-expand {
  opacity: 1;
}

.video-expand:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.video-caption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  text-align: center;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color .15s ease, transform .15s ease;
}

.section-link:hover {
  border-color: var(--green-dim);
  transform: translateY(-2px);
}

.section-link .arrow {
  color: var(--green);
  font-family: var(--mono);
}

.media-loading {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-loading iframe {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.media-loading.media-loaded iframe {
  opacity: 1;
}

.media-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(110deg,
      rgba(255, 255, 255, 0.025) 8%,
      rgba(255, 255, 255, 0.07) 18%,
      rgba(255, 255, 255, 0.025) 33%);
  background-size: 200% 100%;
  animation: mediaShimmer 1.6s linear infinite;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.media-loaded .media-skeleton,
.media-error .media-skeleton {
  opacity: 0;
  visibility: hidden;
}

.media-loader {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: currentColor;
  opacity: 0.7;
  animation: mediaSpin 0.8s linear infinite;
}

.media-error {
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01));
}

@keyframes mediaSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mediaShimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.section-text figure {
  margin: 0;
  padding: 0;
  display: block;
  max-width: 100%;
}

.section-text figure.table {
  overflow-x: auto;
  max-width: 100%;
  display: block;
}

.section-text table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  margin: 16px 0;
}

.section-text table td,
.section-text table th {
  border: 1px solid var(--border);
  padding: 8px 12px;
  vertical-align: top;
}

.section-text figure.image {
  display: inline-block;
  max-width: 100%;
  margin: 8px auto;
  text-align: center;
}

.section-text figure.image_resized {
  display: inline-block;
  max-width: 100% !important;
  margin: 8px auto;
  text-align: center;
}

.section-text figure.image img,
.section-text figure.image_resized img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.section-text img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.section-text img:hover {
  opacity: 0.85;
}

.section-text figure.image .media-loading img,
.section-text td .media-loading img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain;
  transform: none !important;
  opacity: 1 !important;
}

.section-text figure.image .media-loading,
.section-text td .media-loading {
  aspect-ratio: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.section-text figure.media .media-loading {
  border-radius: 8px;
}

.section-text .text-tiny {
  font-size: 0.7em;
}

.section-text .text-small {
  font-size: 0.85em;
}

.section-text .text-big {
  font-size: 1.4em;
}

.section-text .text-huge {
  font-size: 1.8em;
}

.section-text figure.image-style-align-left,
.proj-hero-desc figure.image-style-align-left {
  display: block !important;
  float: left !important;
  margin: 12px 24px 16px 0 !important;
  max-width: 50% !important;
}

.section-text figure.image-style-align-right,
.proj-hero-desc figure.image-style-align-right {
  display: block !important;
  float: right !important;
  margin: 12px 0 16px 24px !important;
  max-width: 50% !important;
}

.section-text figure.image-style-align-center,
.proj-hero-desc figure.image-style-align-center {
  display: block !important;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  clear: both !important;
}

.section-text .text-align-left,
.proj-hero-desc .text-align-left {
  text-align: left !important;
}

.section-text .text-align-center,
.proj-hero-desc .text-align-center {
  text-align: center !important;
}

.section-text .text-align-right,
.proj-hero-desc .text-align-right {
  text-align: right !important;
}

.section-text .text-align-justify,
.proj-hero-desc .text-align-justify {
  text-align: justify !important;
}

.section-text p,
.section-text h1,
.section-text h2,
.section-text h3,
.section-text h4,
.section-text h5,
.section-text h6,
.section-text ul,
.section-text ol,
.section-text blockquote {
  clear: both;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 10, 12, 0.94);
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.lightbox-video-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  padding-bottom: 50.6%;
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

.lightbox-video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-caption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 18px;
  transition: border-color .15s ease, color .15s ease;
}

.lightbox-close:hover {
  border-color: var(--green);
  color: var(--green);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  font-family: var(--mono);
  transition: border-color .15s ease, color .15s ease;
  z-index: 201;
}

.lightbox-nav:hover {
  border-color: var(--green);
  color: var(--green);
}

.lightbox-nav.prev {
  left: 24px;
}

.lightbox-nav.next {
  right: 24px;
}

.lightbox-counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.end-nav {
  border-top: 1px solid var(--border);
  padding: 36px 0 60px;
}

.end-nav .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
}

.floating-btn {
  position: fixed;
  bottom: 24px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  padding: 14px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.floating-back {
  left: 24px;
}

.floating-back:hover {
  transform: translateY(-3px) translateZ(0);
  border-color: var(--green);
  color: var(--green);
}

.floating-demo {
  right: 24px;
  background: var(--green-dim);
  border-color: var(--green-dim);
  color: #fff;
  padding: 14px 22px 14px 16px;
}

.floating-demo:hover {
  transform: translateY(-3px) translateZ(0);
  background: var(--green);
  border-color: var(--green);
}

.floating-demo span {
  font-weight: 600;
}

@media (min-width: 1600px) {
  .wrap {
    max-width: 1000px;
    width: min(70%, 1000px);
  }
}

@media (max-width: 768px) {

  .image-gallery.single .gallery-item,
  .video-embed {
    min-height: 220px;
    border-radius: 12px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 26px;
  }

  .proj-hero {
    padding: 40px 0 28px;
  }

  .sections {
    padding: 36px 0 60px;
    gap: 44px;
  }

  .floating-btn {
    bottom: 16px;
    padding: 12px;
  }

  .floating-back {
    left: 16px;
  }

  .floating-demo {
    right: 16px;
    padding: 12px 18px 12px 14px;
  }

  .floating-demo span {
    display: none;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .lightbox-nav.prev {
    left: 8px;
  }

  .lightbox-nav.next {
    right: 8px;
  }

  .lightbox-overlay {
    padding: 50px 12px;
  }

  .section-text figure.table,
  .section-text table {
    width: 100% !important;
    display: block;
    overflow-x: visible;
  }

  .section-text table tbody,
  .section-text table tr {
    display: block;
    width: 100% !important;
  }

  .section-text table td,
  .section-text table th {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    padding: 0 0 16px !important;
    border: none !important;
  }

  .section-text td figure.image,
  .section-text td figure.image_resized {
    width: 100% !important;
  }

  .section-text td img {
    width: 100% !important;
  }
}

@media (max-width: 480px) {

  .image-gallery.single .gallery-item,
  .video-embed {
    min-height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #bgCanvas {
    display: none;
  }

  .media-skeleton {
    animation: none;
  }

  .media-loader {
    animation: none;
  }
}