:root {
  --bg: #020a12;
  --bg2: #06121d;
  --card: #081522cc;
  --line: #203142;
  --line2: #2b4154;
  --text: #f5f7fb;
  --muted: #9ca9bb;
  --cyan: #20d7f2;
  --cyan2: #12b8d4;
  --green: #22c55e;
  --yellow: #f5b942;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 360px at 82% 26%, rgba(16, 209, 235, 0.23), transparent 58%),
    radial-gradient(700px 320px at 16% 20%, rgba(16, 209, 235, 0.08), transparent 60%),
    linear-gradient(180deg, #020812, #03101a 70%, #020912);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 72%, transparent 100%);
  opacity: 0.42;
}

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

.wrap,
main {
  width: min(1360px, calc(100% - 68px));
  margin: 0 auto;
}

.top {
  height: 58px;
  border-bottom: 1px solid rgba(95, 122, 145, 0.22);
  background: rgba(1, 7, 14, 0.58);
  backdrop-filter: blur(16px);
}

.nav-shell,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
}

.site-header {
  padding: 24px 0;
}

.brand,
.flogo {
  display: flex;
  gap: 15px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0;
}

.logo {
  width: 30px;
  height: 30px;
  position: relative;
  flex: 0 0 30px;
}

.logo::before,
.logo::after {
  content: "";
  position: absolute;
  background: linear-gradient(135deg, var(--cyan), #0a8ea5);
  clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%, 40% 50%);
}

.logo::before {
  inset: 0;
}

.logo::after {
  inset: 7px 8px;
  background: var(--bg);
  transform: scaleX(0.58);
}

.links,
.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.links a,
.right a,
.nav a {
  color: #dbe4ee;
  font-size: 15px;
}

.links a.active {
  color: var(--cyan);
  font-weight: 700;
  position: relative;
}

.links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -20px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.right {
  display: flex;
  align-items: center;
  gap: 19px;
}

.theme {
  width: 58px;
  height: 32px;
  border: 1px solid var(--line2);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: #e9eef7;
  background: #06111c;
  font-size: 12px;
}

.hero {
  border-bottom: 1px solid rgba(95, 122, 145, 0.25);
}

.home-hero {
  padding: 47px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 545px;
  gap: 80px;
  align-items: center;
}

.pill,
.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--cyan);
  background: #042a37;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin: 0 0 20px;
  font-size: 41px;
  line-height: 1.03;
  letter-spacing: 0;
}

.page-title {
  font-size: clamp(2.3rem, 6vw, 4.6rem);
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
}

h3 {
  margin-bottom: 12px;
}

.accent {
  color: #3bdaf2;
  text-shadow: 0 0 28px rgba(32, 215, 242, 0.25);
}

.lead {
  max-width: 600px;
  margin: 0 0 30px;
  color: #bac3d0;
  font-size: 16px;
  line-height: 1.65;
}

.btns,
.actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.actions {
  margin-top: 30px;
  gap: 12px;
}

.actions.compact {
  margin-top: 22px;
}

.btn,
.button,
.outline,
.smallbtn {
  min-height: 38px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  color: #fff;
  background: #07121f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}

.btn,
.button {
  min-height: 42px;
  padding: 0 22px;
}

.btn.primary,
.button.primary {
  color: #001017;
  border-color: #39dff5;
  background: linear-gradient(180deg, #39dff5, #13b6cf);
}

.button.secondary {
  background: rgba(7, 18, 31, 0.86);
}

.outline {
  padding: 0 17px;
  background: transparent;
}

.term,
.terminal {
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: #020812;
  box-shadow: 0 24px 70px var(--shadow);
}

.termbar,
.terminal-bar {
  height: 35px;
  border-bottom: 1px solid #1c2c3e;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 18px;
  background: linear-gradient(#111b27, #0b1420);
}

.dot,
.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.red {
  background: #ff5f57;
}

.yel {
  background: #ffbd2e;
}

.grn {
  background: #28c840;
}

.terminal-bar span {
  background: var(--cyan);
}

pre {
  margin: 0;
  padding: 18px 24px 15px;
  overflow-x: auto;
  color: #b7c3d2;
  font: 13.2px/1.85 Consolas, Monaco, monospace;
}

.cyan {
  color: #52eaff;
}

.ok {
  color: var(--green);
}

.main {
  padding: 17px 0 0;
}

.headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
}

.headrow h2 {
  margin: 0 0 5px;
}

.headrow p {
  margin: 0;
  color: #aab4c4;
  font-size: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card,
.project-card {
  min-height: 206px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(12, 25, 38, 0.88), rgba(6, 16, 27, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 20px 15px 16px;
}

.project-card {
  padding: 22px;
}

.ctop {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.ico {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #193d8d, #7c3aed);
}

.title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 5px 0 7px;
  font-weight: 800;
  white-space: nowrap;
}

.badge,
.status,
.tags span {
  border-radius: 5px;
  padding: 3px 6px;
  color: #49e883;
  background: #063c24;
  font-size: 11px;
  font-weight: 700;
}

.status {
  color: #cbd5e1;
  background: #142234;
}

.desc,
.project-card p {
  color: #c4ced9;
  font-size: 12.8px;
  line-height: 1.45;
}

.desc {
  min-height: 42px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0 20px;
}

.tag,
.tags span {
  color: #cbd5e1;
  background: #142234;
  padding: 6px 10px;
  font-size: 12px;
}

.card-actions {
  margin-top: auto;
  gap: 10px;
}

.smallbtn {
  flex: 1;
  min-width: 88px;
  background: #0a1725;
  font-size: 13px;
}

.card-topline,
.meta,
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-topline {
  justify-content: space-between;
  margin-bottom: 20px;
}

.meta {
  margin: 18px 0;
}

.meta.stacked {
  display: grid;
}

.meta div {
  min-width: 120px;
}

.meta dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.meta dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.stats {
  margin: 32px 0 24px;
  border: 1px solid #1f3142;
  border-radius: 9px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 17px 60px;
  background: linear-gradient(90deg, rgba(10, 24, 36, 0.85), rgba(8, 19, 31, 0.8));
}

.stat {
  display: flex;
  gap: 16px;
  align-items: center;
}

.sico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: #0b2030;
  font-size: 18px;
  font-weight: 800;
}

.sico.warm {
  color: var(--yellow);
}

.stat strong {
  font-size: 20px;
}

.stat span {
  display: block;
  color: #aab4c4;
  font-size: 13px;
}

.footer,
.site-footer {
  border-top: 1px solid rgba(95, 122, 145, 0.13);
}

.footer {
  padding: 0 0 20px;
}

.site-footer {
  justify-content: space-between;
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footgrid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 70px;
  padding: 0 0 22px;
}

.flogo {
  margin-bottom: 10px;
}

.foot p,
.foot a {
  display: block;
  color: #aab4c4;
  font-size: 14px;
  line-height: 1.7;
}

.foot h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.sub {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.sub input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid #273c4e;
  border-radius: 6px;
  padding: 0 17px;
  color: #cbd5e1;
  background: #07111c;
}

.sub button {
  border: 0;
  border-radius: 6px;
  padding: 0 20px;
  color: #001017;
  background: linear-gradient(#42e4f7, #13b7cf);
  font-weight: 800;
}

.copy {
  border-top: 1px solid rgba(95, 122, 145, 0.16);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #8f9bae;
  font-size: 12px;
}

.section {
  padding: 48px 0 72px;
}

.section-heading {
  margin-bottom: 24px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
  padding: 64px 0 96px;
}

.prose {
  max-width: 780px;
  padding: 64px 0 96px;
  color: var(--muted);
  line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3 {
  color: var(--text);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mirror {
  padding: 0 0 96px;
}

.project-gallery {
  padding: 0 0 64px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-trigger {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: zoom-in;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery-trigger:hover img {
  transform: scale(1.025);
}

.gallery-modal {
  width: min(94vw, 1400px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #080d13;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.gallery-modal::backdrop {
  background: rgba(2, 6, 10, 0.88);
  backdrop-filter: blur(4px);
}

.gallery-modal img {
  display: block;
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

.gallery-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.download-modal {
  width: min(92vw, 560px);
  max-width: none;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.download-modal::backdrop {
  background: rgba(2, 6, 10, 0.88);
  backdrop-filter: blur(4px);
}

.download-modal h2 {
  margin-top: 0;
}

.download-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--bg);
  font-size: 26px;
  cursor: pointer;
}

.download-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.download-list a {
  display: flex;
  justify-content: space-between;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.notice {
  margin-top: 18px;
  border: 1px solid rgba(255, 194, 102, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffd99b;
  background: rgba(255, 194, 102, 0.06);
}

.notice p {
  margin: 4px 0;
}

.empty {
  color: var(--muted);
}

.git-browser { max-width: 1080px; padding-top: 44px; }
.repo-summary, .git-panel, .git-mini-panel { border: 1px solid var(--line); border-radius: 12px; background: rgba(10, 20, 29, .86); box-shadow: 0 14px 42px rgba(0, 0, 0, .16); }
.repo-summary { overflow: hidden; }
.git-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding: 28px 30px 22px; }
.git-head h1 { margin: 5px 0 8px; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.035em; }
.git-head h1 a { color: inherit; text-decoration: none; }
.git-head p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.65; }
.clone-box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 30px 24px; border: 1px solid var(--line); border-radius: 8px; background: #070e15; }
.clone-box span { padding: 11px 0 11px 14px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.clone-box code { overflow: hidden; color: #d7e6ee; text-overflow: ellipsis; white-space: nowrap; }
.clone-box button { align-self: stretch; padding: 0 16px; border: 0; border-left: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; }
.clone-box button:hover { color: var(--accent); background: rgba(25, 211, 197, .06); }
.git-tabs { display: flex; gap: 4px; padding: 0 24px; border-top: 1px solid var(--line); background: rgba(3, 9, 14, .35); }
.git-tabs a { padding: 14px 12px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.git-tabs a:hover, .git-tree a:hover { color: var(--text); border-color: var(--accent); }
.git-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.git-mini-panel { padding: 18px 20px; }
.git-mini-panel h2 { display: flex; justify-content: space-between; margin: 0 0 14px; font-size: 15px; }
.git-mini-panel h2 span { color: var(--muted); font-size: 13px; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-chips a, .ref-chips span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #080f16; font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-decoration: none; }
.ref-chips a:hover { color: var(--accent); border-color: rgba(25, 211, 197, .45); }
.git-panel { margin-top: 18px; overflow: hidden; }
.git-panel-title { padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font: 700 13px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.git-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.git-panel-head h2 { margin: 0; font-size: 16px; }
.git-panel-head a { color: var(--accent); font-size: 13px; text-decoration: none; }
.markdown-body { padding: 24px 30px 32px; color: #c7d5dd; line-height: 1.72; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.6em 0 .65em; color: var(--text); line-height: 1.25; }
.markdown-body h1 { padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 28px; }
.markdown-body h2 { font-size: 21px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; color: #a9eee8; background: #071018; font: .9em ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body pre, .git-code { overflow: auto; padding: 17px 19px; border: 1px solid var(--line); border-radius: 8px; background: #060c12; white-space: pre; }
.markdown-body pre code { padding: 0; color: #c4d8e3; background: transparent; }
.markdown-body a { color: var(--accent); }
.markdown-body li { margin: 5px 0; }
.git-code { max-height: 720px; margin: 0; border: 0; border-radius: 0; }
.git-tree { display: grid; }
.git-tree a { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.git-tree a:first-child { border-top: 0; }
.git-tree small, .git-commits small { color: var(--muted); }
.git-commits { padding: 0 20px; }
.git-commits article { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.git-commits article:first-child { border-top: 0; }
.git-commits article > code { color: var(--accent); font-size: 12px; }
.git-commits article div { display: grid; gap: 4px; }
.git-commits strong { font-size: 14px; }

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .links {
    display: none;
  }

  .footgrid {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    padding: 17px 28px;
  }
}

@media (max-width: 820px) {
  .site-header,
  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
  }

  .top {
    height: auto;
  }

  .right {
    display: none;
  }

  .project-grid,
  .detail,
  .gallery-grid,
  .git-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .wrap,
  main {
    width: min(100% - 36px, 1360px);
  }

  .cards,
  .stats,
  .footgrid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .home-hero {
    padding-top: 35px;
  }

  .headrow,
  .copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .git-browser { padding-top: 26px; }
  .git-head { flex-direction: column; padding: 22px 20px 18px; }
  .clone-box { grid-template-columns: 1fr auto; margin: 0 20px 18px; }
  .clone-box span { display: none; }
  .clone-box code { padding-left: 12px; font-size: 11px; }
  .git-tabs { padding: 0 12px; overflow-x: auto; flex-wrap: nowrap; }
  .git-tabs a { white-space: nowrap; }
  .markdown-body { padding: 20px; }
  .git-commits article { grid-template-columns: 1fr; gap: 5px; }
}
