:root {
  --bg: #0a0a08;
  --ink: #e8e2d5;
  --muted: #9a9488;
  --dim: #1a1916;
  --accent: #e8481a;
  --border: #3a3830;
  --mono: 'IBM Plex Mono', monospace;
  --display: 'Barlow Condensed', sans-serif;
  --body: 'Barlow', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  cursor: none;
  overflow-x: hidden;
  min-height: calc(100vh - 120px);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 999;
}

/* CURSOR */
#cur {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
}
#cur.big {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--accent);
}

/* ANIMATIONS */
@keyframes up {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
header         { animation: up 0.7s cubic-bezier(0.16,1,0.3,1) 0.05s both; }
.net-bar       { animation: up 0.7s cubic-bezier(0.16,1,0.3,1) 0.15s both; }
.network-grid  { animation: up 0.7s cubic-bezier(0.16,1,0.3,1) 0.25s both; }
.repos-section { animation: up 0.7s cubic-bezier(0.16,1,0.3,1) 0.35s both; }
footer         { animation: up 0.7s cubic-bezier(0.16,1,0.3,1) 0.45s both; }

/* HEADER */
header {
  border-bottom: 1px solid var(--border);
  padding: 72px 80px 60px;
  position: relative;
  overflow: hidden;
}

.h-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: 40px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.h-badge {
  flex-shrink: 0;
  width: clamp(360px, 35vw, 999px);
  height: clamp(360px, 35vw, 999px);
  margin-right: -40px;
}

.h-badge svg {
  width: 100%;
  height: 100%;
}

.h-right { flex:1; }

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(80px, 12vw, 160px);
  line-height: 0.88;
  letter-spacing: -1px;
  text-transform: uppercase;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

.h-meta {
  font-family: var(--mono);
  font-size: 14px;
  color: #8a8880;
  letter-spacing: 1px;
  line-height: 2.2;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.h-sub {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.h-sub::before {
  content: '';
  width: 28px; height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* BARS */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 80px;
  border-bottom: 1px solid var(--border);
}

.bar-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.bar-right {
  font-family: var(--mono);
  font-size: 10px;
  color: #6a6860;
  letter-spacing: 1px;
}

/* NETWORK GRID */
.network-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.site-card {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  height: 460px;
  overflow: hidden;
  cursor: none;
}

.site-card:nth-child(2n) { border-right: none; }

.site-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.45s cubic-bezier(0.16,1,0.3,1);
  z-index: 2;
}
.site-card:hover::before { width: 100%; }

/* FRONT */
.cf {
  position: absolute; inset: 0;
  padding: 28px;
  transition: opacity 0.5s ease, filter 0.5s ease;
}
.site-card:hover .cf {
  opacity: 0.03;
  filter: blur(10px);
}

.logo {
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 24px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  filter: grayscale(1) brightness(0.5);
  overflow: visible;
  z-index: 0;
}
.logo img {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 0;
}
.logo-fb {
  font-family: var(--display);
  font-weight: 900;
  font-size: 52px;
  color: var(--muted);
  letter-spacing: 1px;
}

.cname {
  font-family: var(--display);
  font-weight: 900;
  font-size: 72px;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
  position: absolute;
  width: 72%;
  z-index: 1;
}

/* per-card placements */
.c1 .logo  { top:20px; left:20px; transform:rotate(-3deg); }
.c1 .cname { bottom:24px; right:20px; text-align:right; }

.c2 .logo  { bottom:20px; right:20px; transform:rotate(4deg); }
.c2 .cname { top:24px; left:20px; }

.c3 .logo  { top:20px; right:20px; transform:rotate(-2deg); }
.c3 .cname { bottom:24px; left:20px; }

.c4 .logo  { bottom:20px; left:20px; transform:rotate(5deg); }
.c4 .cname { top:24px; right:20px; text-align:right; }

.c5 .logo  { top:20px; left:20px; transform:rotate(3deg); }
.c5 .cname { bottom:24px; right:20px; text-align:right; }

.c6 .logo  { bottom:20px; right:20px; transform:rotate(-4deg); }
.c6 .cname { top:24px; left:20px; }

.cnum {
  position: absolute;
  bottom:12px; right:14px;
  font-family: var(--mono);
  font-size: 10px;
  color: #6a6860;
  transition: opacity 0.3s;
}
.site-card:hover .cnum { opacity: 0; }

/* BACK */
.cb {
  position: absolute; inset: 0;
  padding: 34px 30px;
  display: flex; flex-direction: column;
  justify-content: center; gap: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.site-card:hover .cb { opacity: 1; }

.ccat {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

.cdesc {
  font-size: 15px;
  font-weight: 300;
  color: #a09c94;
  line-height: 1.65;
}

.curl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  margin-top: 4px;
  transition: color 0.2s;
}
.curl:hover { color: var(--accent); }

/* REPOS */
.repos-section { border-top: 1px solid var(--border); }

.repo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.repo-card {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 80px;
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}
.repo-card:nth-child(2n) { border-right: none; }
.repo-card:hover { background: #0d0d0b; }

.repo-card::before {
  content: '';
  position: absolute;
  top:0; left:0;
  width:0; height:2px;
  background: var(--accent);
  transition: width 0.45s cubic-bezier(0.16,1,0.3,1);
}
.repo-card:hover::before { width: 100%; }

.rtag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.rname {
  font-family: var(--display);
  font-weight: 900;
  font-size: 52px;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 16px;
}

.rdesc {
  font-size: 14px;
  font-weight: 300;
  color: #9a9488;
  line-height: 1.7;
  margin-bottom: 20px;
}

.rstack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.rstack span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
}

.rlink {
  font-family: var(--mono);
  font-size: 10px;
  color: #9a9488;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  display: block;
  margin-bottom: 8px;
}
.rlink:hover { color: var(--accent); }

.rnote {
  font-family: var(--mono);
  font-size: 9px;
  color: #6a6860;
  letter-spacing: 0.5px;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.f-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.f-links a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.f-links a:hover { color: var(--accent); }

.f-copy {
  font-family: var(--mono);
  font-size: 9px;
  color: #6a6860;
  letter-spacing: 1px;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .network-grid { grid-template-columns: 1fr 1fr; }
  header, .bar, footer { padding-left: 28px; padding-right: 28px; }
  .repo-card { padding: 32px 28px; }
}

@media (max-width: 620px) {
  .network-grid { grid-template-columns: 1fr; }
  .repo-grid { grid-template-columns: 1fr; }
  .site-card:nth-child(3n),
  .site-card:nth-child(2n) { border-right: none; }
  .repo-card:nth-child(2n) { border-right: none; }
  .h-meta { display: none; }
  footer { flex-direction: column; gap: 16px; align-items: flex-start; }
}