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

:root {
  --navy: #0a1a5c;
  --blue: #3d7bff;
  --line: #0f1733;
  --text: #e3e9ff;
  --muted: #6b7aa6;
}

html, body {
  background: #000;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Background ---------- */
.bg-glow {
  position: fixed;
  top: -260px; left: 50%;
  width: 1000px; height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(40, 90, 255, 0.22), rgba(10, 26, 92, 0.12) 55%, transparent);
  filter: blur(30px);
  pointer-events: none;
  z-index: -1;
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
  50% { opacity: 0.65; transform: translateX(-50%) scale(1.06); }
}
.bg-dots {
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(90, 130, 255, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14vh 24px 100px;
}

/* ---------- ASCII logo ---------- */
.logo {
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
  white-space: pre;
  user-select: none;
  background: linear-gradient(to bottom, var(--navy) 0%, var(--blue) 25%, var(--navy) 50%, var(--blue) 75%, var(--navy) 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: flow 3s linear infinite;
  filter: drop-shadow(0 0 14px rgba(40, 90, 255, 0.35));
}
@keyframes flow {
  from { background-position: 0 0%; }
  to   { background-position: 0 100%; }
}

/* ---------- Section label ---------- */
.label {
  width: 100%;
  max-width: 1120px;
  margin: 90px 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--muted);
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.label b { color: var(--blue); font-weight: 600; }

/* ---------- Grid ---------- */
.list {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ---------- Card ---------- */
.card {
  --mx: 50%; --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, #060a18, #03050c);
  border: 1px solid var(--line);
  isolation: isolate;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* glowing gradient border that follows the mouse */
.card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(61, 123, 255, 0.9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}
/* soft inner light */
.card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(61, 123, 255, 0.07), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 30px 60px -30px rgba(30, 70, 220, 0.55); }
.card:hover::before, .card:hover::after { opacity: 1; }

/* ---------- Thumbnail ---------- */
.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 15px 15px 0 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 15%, rgba(61, 123, 255, 0.3), transparent 55%),
    linear-gradient(135deg, #040820, var(--navy));
}
.thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.6s ease, filter 0.6s ease;
  filter: saturate(0.9) brightness(0.92);
}
.card:hover .thumb img { transform: scale(1.05); filter: saturate(1) brightness(1); }
.thumb::after { /* fade into the card */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(3, 5, 12, 0.85));
  z-index: 2;
  pointer-events: none;
}
.thumb-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800;
  letter-spacing: 0.15em;
  color: rgba(120, 160, 255, 0.18);
}

.badges {
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 6px;
  z-index: 3;
}
.badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 6px;
  color: #cfdcff;
  background: rgba(4, 8, 24, 0.7);
  border: 1px solid rgba(61, 123, 255, 0.35);
  backdrop-filter: blur(6px);
}
.badge-new {
  color: #fff;
  background: linear-gradient(180deg, #2f6bff, #1a3fb8);
  border-color: #5a8cff;
  box-shadow: 0 0 14px rgba(47, 107, 255, 0.6);
}
.index {
  position: absolute; right: 14px; bottom: 10px;
  z-index: 3;
  font-size: 0.72rem;
  color: rgba(180, 200, 255, 0.55);
  letter-spacing: 0.1em;
}

/* ---------- Body ---------- */
.body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}
.body h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desc {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.info { margin-bottom: 16px; }
.meta {
  display: flex; gap: 18px;
  margin: auto 0 18px;
  padding-top: 14px;
  border-top: 1px dashed #141f45;
  font-size: 0.72rem;
  color: var(--muted);
}
.meta span { display: inline-flex; align-items: center; gap: 7px; }
.meta svg { width: 13px; height: 13px; color: #3b5bb5; }
.meta em { font-style: normal; }

/* ---------- Download button ---------- */
.dl {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 16px;
  height: 44px;
  border-radius: 10px;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #2a62f5, #1736a3);
  border: 1px solid #4a84ff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px -12px rgba(47, 107, 255, 0.9);
  transition: box-shadow 0.25s, filter 0.25s, transform 0.15s;
}
.dl::before { /* shine sweep */
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.dl:hover::before { left: 130%; }
.dl:hover {
  filter: brightness(1.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 14px 30px -10px rgba(47, 107, 255, 1);
}
.dl:active { transform: translateY(1px); }

.dl-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.dl-icon svg { width: 16px; height: 16px; }
.dl:hover .dl-icon svg { animation: drop 0.9s ease infinite; }
@keyframes drop {
  0%   { transform: translateY(0); opacity: 1; }
  45%  { transform: translateY(14px); opacity: 0; }
  46%  { transform: translateY(-14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- Footer ---------- */
.foot {
  margin-top: 90px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #26335e;
}

@media (max-width: 720px) {
  .list { grid-template-columns: 1fr; }
  .logo { font-size: 8px; }
}

/* ---------- Announcements terminal ---------- */
.term {
  width: 100%;
  max-width: 640px;
  margin-top: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 6, 16, 0.85);
  box-shadow: 0 0 0 1px rgba(61, 123, 255, 0.04), 0 20px 50px -30px rgba(30, 70, 220, 0.5);
  overflow: hidden;
  animation: rise 0.6s ease both;
  position: relative;
}
.term::after { /* faint scanlines */
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 60, 0.25);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #13204a; }
.dots i:first-child { background: #2a4fc4; }
.term-title { font-size: 0.68rem; letter-spacing: 0.15em; color: var(--muted); }
.term-body {
  padding: 14px 16px 16px;
  font-size: 0.76rem;
  line-height: 1.75;
  color: #9fb4ea;
}
.prompt { color: #5a6b99; }
.prompt .user { color: #3d7bff; }
.prompt .path { color: #7d9bff; }
.line { white-space: pre-wrap; word-break: break-word; animation: fadein 0.3s ease both; }
.line .ts { color: #34447a; }
.line .lvl { color: #4b6fd6; font-weight: 700; }
.line.latest .lvl { color: #000; background: #3d7bff; padding: 0 5px; border-radius: 3px; }
.line.latest .msg { color: #e3e9ff; }
@keyframes fadein { from { opacity: 0; } }
.cursor {
  display: inline-block;
  width: 7px; height: 13px;
  vertical-align: -2px;
  background: #3d7bff;
  box-shadow: 0 0 8px #3d7bff;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.empty {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #2c3a66;
}

/* ---------- Telegram corner button ---------- */
.tg {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.tg-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #8fb0ff;
  background: rgba(3, 6, 16, 0.85);
  border: 1px solid var(--line);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tg-btn svg { width: 20px; height: 20px; transform: translateX(-1px); }
.tg-btn:hover, .tg-btn.open {
  color: #fff;
  border-color: #3d7bff;
  box-shadow: 0 0 0 1px rgba(61, 123, 255, 0.3), 0 8px 24px -8px rgba(47, 107, 255, 0.8);
}
.tg-btn:hover { transform: translateY(-1px); }

.tg-pop {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(3, 6, 16, 0.95);
  border: 1px solid #1a2a5e;
  box-shadow: 0 20px 50px -20px rgba(30, 70, 220, 0.6);
  backdrop-filter: blur(10px);
  animation: popin 0.2s ease both;
}
.tg-pop[hidden] { display: none; }
@keyframes popin { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.tg-label { font-size: 0.64rem; letter-spacing: 0.15em; color: #34447a; margin-bottom: 6px; }
.tg-handle {
  display: block;
  font-size: 1.05rem; font-weight: 700;
  color: #fff; text-decoration: none;
  text-shadow: 0 0 14px rgba(61, 123, 255, 0.6);
}
.tg-handle:hover { color: #8fb0ff; }
.tg-actions { display: flex; gap: 8px; margin-top: 12px; }
.tg-open, .tg-copy {
  font-family: inherit; font-size: 0.68rem;
  padding: 6px 10px;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s, border-color 0.2s, color 0.2s;
}
.tg-open { color: #fff; background: linear-gradient(180deg, #2a62f5, #1736a3); border: 1px solid #4a84ff; }
.tg-open:hover { filter: brightness(1.15); }
.tg-copy { color: #8fa3d8; background: transparent; border: 1px solid var(--line); }
.tg-copy:hover { color: #fff; border-color: #2a4fc4; }

/* ---------- Tagline ---------- */
.tagline {
  margin-top: 18px;
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #4d6bc9;
  text-shadow: 0 0 12px rgba(61, 123, 255, 0.35);
  animation: tagin 1.4s ease both 0.2s;
}
@keyframes tagin {
  from { opacity: 0; letter-spacing: 0.6em; filter: blur(4px); }
}

/* ---------- Card buttons: View + Download ---------- */
.actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.view {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px;
  border-radius: 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #9fb4ea; text-decoration: none;
  background: rgba(10, 26, 92, 0.25);
  border: 1px solid #1a2a5e;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.view svg { width: 16px; height: 16px; }
.view:hover { color: #fff; border-color: #3d7bff; background: rgba(10, 26, 92, 0.6); }

/* ---------- View page ---------- */
.v-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 90px; }
.v-top {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 0 70px 22px 0;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.v-back { font-size: 0.74rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.v-back:hover { color: #fff; }
.v-brand {
  font-size: 1.3rem; font-weight: 800; text-decoration: none;
  background: linear-gradient(to bottom, var(--navy) 0%, var(--blue) 25%, var(--navy) 50%, var(--blue) 75%, var(--navy) 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 3s linear infinite;
}
.v-tag { font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase; color: #34447a; }

.v-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.v-paste { max-width: none; margin-top: 0; }
.v-stats { margin-left: auto; font-size: 0.66rem; color: #34447a; }

.v-side { position: sticky; top: 24px; }
.v-card { animation-delay: 0.1s; }
.v-card .body h2 { white-space: normal; font-size: 1.05rem; line-height: 1.4; }
.v-rows { display: flex; flex-direction: column; margin-bottom: 16px; border-top: 1px dashed #141f45; }
.v-rows div {
  display: flex; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed #141f45;
  font-size: 0.74rem;
}
.v-rows span { color: var(--muted); }
.v-rows b { color: var(--text); font-weight: 600; }
.v-copy {
  margin-top: 10px; width: 100%; height: 34px;
  font-family: inherit; font-size: 0.7rem; letter-spacing: 0.05em;
  color: #6b7aa6; background: transparent;
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.v-copy:hover { color: #fff; border-color: #2a4fc4; }

/* ---------- Paste formatting (view page + dashboard preview) ---------- */
.paste {
  position: relative; z-index: 1;
  padding: 22px 24px 28px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: #b9c8f0;
  word-break: break-word;
  min-height: 300px;
}
.paste p { white-space: pre-wrap; }
.paste h2 { font-size: 1.15rem; color: #fff; margin: 18px 0 8px; }
.paste h3 { font-size: 0.95rem; color: #8fb0ff; margin: 14px 0 6px; }
.paste h2:first-child, .paste h3:first-child { margin-top: 0; }
.paste h2::before { content: "# "; color: #3d7bff; }
.paste h3::before { content: "## "; color: #2a4fc4; }
.paste strong { color: #fff; }
.paste code { color: #8fb0ff; background: rgba(61, 123, 255, 0.1); padding: 1px 6px; border-radius: 4px; }
.paste a { color: #6c9bff; text-decoration: underline; text-decoration-color: #1a3fb8; text-underline-offset: 3px; }
.paste a:hover { color: #fff; }
.paste ul { list-style: none; margin: 4px 0; }
.paste li { padding-left: 18px; position: relative; }
.paste li::before { content: ">"; position: absolute; left: 0; color: #3d7bff; }
.paste blockquote { border-left: 2px solid #3d7bff; padding: 2px 0 2px 14px; margin: 6px 0; color: #8fa3d8; background: rgba(10, 26, 92, 0.15); }
.paste .p-gap { height: 0.9em; }
.paste .p-code {
  margin: 10px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #02040b;
  border: 1px solid var(--line);
  color: #9fd0ff;
  font-size: 0.78rem;
  overflow-x: auto;
}
.paste .p-img { margin: 14px 0; }
.paste .p-img img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 8px;
  border: 1px solid #1a2a5e;
  cursor: zoom-in;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.paste .p-img img:hover { border-color: #3d7bff; box-shadow: 0 10px 30px -12px rgba(47, 107, 255, 0.7); }
.paste .p-empty { color: #2c3a66; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: fadein 0.2s ease both;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 0 60px rgba(30, 70, 220, 0.4); }

@media (max-width: 900px) {
  .v-cols { grid-template-columns: 1fr; }
  .v-side { position: static; order: -1; }
}

/* ---------- Download clicked → "Started" confirmation ---------- */
.dl.done {
  background: linear-gradient(180deg, #27a25f, #15713f);
  border-color: #34d07f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px -12px rgba(39, 162, 95, 0.9);
}
.dl.done::before { display: none; }           /* stop the shine sweep while confirming */
.dl.done .dl-icon svg { display: none; }
.dl.done .dl-icon::after {
  content: "✓";
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
