@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

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

:root {
  --bg: #0a0e27;
  --panel: rgba(10, 14, 39, 0.95);
  --panel-alt: #1a1f3a;
  --border: #00ff9c;
  --text: #00ff9c;
  --muted: #64748b;
  --secondary: #94a3b8;
  --shadow: rgba(0, 255, 156, 0.2);
}

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  line-height: 1.6;
  overflow-x: hidden;
}

body.page-home {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease;
}

body.fade-out {
  opacity: 0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 100;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridScroll 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes gridScroll {
  to { background-position: 40px 40px; }
}

.page-shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
  pointer-events: none;
}

body.is-loaded .page-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.terminal-window {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 0 40px var(--shadow);
  overflow: hidden;
}

.terminal-header {
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.container {
  text-align: center;
  z-index: 10;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.logo {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--border);
  animation: flicker 3s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  background: var(--text);
  animation: blink 1s infinite;
  margin-left: 4px;
  vertical-align: middle;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.status {
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.status::before {
  content: '> ';
  color: var(--text);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.flip-unit {
  text-align: center;
}

.flip-label {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.flip-card {
  position: relative;
  width: 80px;
  height: 100px;
  perspective: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  line-height: 100px;
  transform-style: preserve-3d;
}

.flip-card .top,
.flip-card .bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  text-shadow: 0 0 10px var(--border);
  backface-visibility: hidden;
}

.flip-card .top {
  top: 0;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid var(--bg);
  line-height: 100px;
  z-index: 1;
}

.flip-card .bottom {
  bottom: 0;
  border-radius: 0 0 6px 6px;
  line-height: 0;
  z-index: 1;
}

.flip-card .top-flip,
.flip-card .bottom-flip {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  text-shadow: 0 0 10px var(--border);
  backface-visibility: hidden;
}

.flip-card .top-flip {
  top: 0;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid var(--bg);
  line-height: 100px;
  transform-origin: bottom;
  z-index: 2;
}

.flip-card .bottom-flip {
  bottom: 0;
  border-radius: 0 0 6px 6px;
  line-height: 0;
  transform-origin: top;
  z-index: 2;
}

.flip-card.flipping .top-flip {
  animation: flipTop 0.5s ease-in forwards;
}

.flip-card.flipping .bottom-flip {
  animation: flipBottom 0.5s ease-out forwards;
}

@keyframes flipTop {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

@keyframes flipBottom {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

.info {
  margin-top: 30px;
  color: var(--secondary);
  font-size: 0.9rem;
  line-height: 1.8;
}

.info span { color: var(--text); }

.inline-link {
  color: var(--text);
  text-decoration: none;
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration: underline;
}

.ad-slot {
  margin: 24px auto 20px;
  max-width: 620px;
  text-align: left;
}

.ad-slot-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
}

.ad-slot-box {
  padding: 14px 16px;
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: linear-gradient(90deg, rgba(0, 255, 156, 0.08), rgba(26, 31, 58, 0.9));
  border-radius: 10px;
}

.ad-slot-box p {
  color: var(--text);
  margin-bottom: 4px;
}

.ad-slot-box small {
  color: var(--secondary);
}

.content-summary {
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 18px 20px;
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: rgba(10, 14, 39, 0.72);
  border-radius: 10px;
  text-align: left;
}

.content-summary h2 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.content-summary p {
  color: var(--secondary);
  line-height: 1.7;
}

.brand-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 860px;
  margin: 0 auto 24px;
}

.brand-strip > div {
  padding: 14px 16px;
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: rgba(10, 14, 39, 0.72);
  border-radius: 10px;
}

.brand-strip strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.brand-strip span {
  color: var(--secondary);
  font-size: 0.9rem;
}

.progress-line {
  margin: 30px 0 20px;
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  max-width: 500px;
  height: 20px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  margin: 10px auto;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--text),
    var(--text) 10px,
    #00cc7a 10px,
    #00cc7a 20px
  );
  width: 45%;
  animation: load 2s ease-out;
}

@keyframes load { from { width: 0; } }

.preloader {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(0, 255, 156, 0.08), transparent 35%),
    var(--bg);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.preloader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-shell {
  width: min(92vw, 560px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 26px 24px;
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: rgba(10, 14, 39, 0.78);
  box-shadow: 0 0 0 1px rgba(0, 255, 156, 0.04), 0 18px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.preloader.active .preloader-shell {
  transform: scale(1);
  opacity: 1;
}

.preloader-content {
  text-align: center;
  max-width: 520px;
  padding: 6px 2px;
  position: relative;
}

.preloader-content::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  width: 70px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--text), transparent);
  opacity: 0.7;
}

.preloader-badge {
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 255, 156, 0.15);
  color: var(--text);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  background: rgba(0, 255, 156, 0.04);
}

.preloader-title {
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  margin-bottom: 8px;
  color: var(--text);
  text-shadow: 0 0 6px rgba(0, 255, 156, 0.12);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.preloader-subtitle {
  color: var(--secondary);
  font-size: 0.82rem;
  margin-bottom: 16px;
  opacity: 0.82;
  letter-spacing: 0.03em;
}

.preloader-bar {
  width: 100%;
  height: 6px;
  background: rgba(100, 116, 139, 0.16);
  border: 1px solid rgba(0, 255, 156, 0.12);
  overflow: hidden;
  margin-bottom: 10px;
}

.preloader-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 255, 156, 0.15), var(--text), #00cc7a);
  box-shadow: 0 0 10px rgba(0, 255, 156, 0.2);
  animation: preloaderBar 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.preloader-status {
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.2em;
  opacity: 0.9;
}

.preloader-status::before {
  content: '> ';
  color: var(--text);
}

.preloader-svg {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.95;
}

.preloader-trace-bg {
  stroke: #1a1f3a;
  stroke-width: 2;
  fill: none;
}

.preloader-trace-flow {
  stroke: var(--border);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 40 400;
  stroke-dashoffset: 438;
  filter: drop-shadow(0 0 6px var(--border));
  animation: preloaderFlow 3s cubic-bezier(0.5, 0, 0.9, 1) infinite;
}

.preloader-trace-flow.delay1 { animation-delay: 0.6s; }
.preloader-trace-flow.delay2 { animation-delay: 1.2s; }

@keyframes preloaderFlow {
  to { stroke-dashoffset: 0; }
}

.preloader-loading-text {
  animation: preloaderBlink 1.5s infinite;
}

@keyframes preloaderBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.preloader-world {
  animation: preloaderPulse 2s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(0.98); }
}

@keyframes preloaderBar {
  from { width: 0; }
  to { width: 100%; }
}

.preloader-text {
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-shadow: 0 0 10px var(--border);
  animation: textGlitch 0.3s infinite;
}

@keyframes textGlitch {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.preloader-text::before {
  content: '> ';
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid var(--panel-alt);
  border-top: 3px solid var(--border);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px var(--border);
}

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

@media (max-width: 768px) {
  .preloader-shell { width: min(95vw, 460px); }
  .container { padding: 14px; }
  .logo { font-size: 2.1rem; }
  .countdown { gap: 8px; }
  .flip-card { width: 60px; height: 80px; }
  .flip-card .top, .flip-card .bottom, .flip-card .top-flip, .flip-card .bottom-flip { line-height: 80px; }
  .site-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 0 0 12px 12px;
  }
  .site-nav {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    padding: 6px 8px;
    border: 1px solid rgba(0, 255, 156, 0.16);
    border-radius: 999px;
    background: rgba(10, 14, 39, 0.7);
    white-space: nowrap;
  }
  .content { padding: 14px; }
  .featured-list, .posts-grid, .content-grid { grid-template-columns: 1fr; }
  .brand-strip { grid-template-columns: 1fr; }
  .ad-banner { flex-direction: column; align-items: flex-start; }
  .post-card { padding: 14px; }
  .subscribe-form button, .subscribe-form input { min-height: 44px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1100px; }
  .terminal-window { border-radius: 14px; }
  .content { padding: 30px; }
  .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .logo { font-size: 1.7rem; }
  .status { font-size: 0.82rem; }
  .flip-card { width: 52px; height: 70px; }
  .flip-card .top, .flip-card .bottom, .flip-card .top-flip, .flip-card .bottom-flip { line-height: 70px; font-size: 2.2rem; }
  .flip-label { font-size: 0.62rem; }
  .site-nav { font-size: 0.82rem; }
  .brand-strip > div, .hero-panel, .sidebar-card, .post-card, .ad-banner, .content-summary, .ad-slot-box {
    border-radius: 12px;
  }
  .content-summary, .hero-panel, .ad-slot-box { padding: 14px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: rgba(10, 14, 39, 0.94);
  border-bottom: 1px solid rgba(0, 255, 156, 0.25);
  backdrop-filter: blur(6px);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 10px var(--border);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  padding: 2px 0;
}

.site-nav a::before,
.site-nav a::after {
  content: '';
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.site-nav a:hover::before,
.site-nav a:focus-visible::before {
  content: '[';
  opacity: 1;
  margin-right: 4px;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  content: ']';
  opacity: 1;
  margin-left: 4px;
}

.content {
  padding: 24px;
}

.intro {
  margin-bottom: 20px;
  color: var(--secondary);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text);
  font-size: 0.74rem;
  margin-bottom: 8px;
}

.intro h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--text);
}

.intro p {
  margin-top: 8px;
  color: var(--muted);
}

.ad-banner {
  margin: 18px 0 24px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: linear-gradient(90deg, rgba(0, 255, 156, 0.08), rgba(26, 31, 58, 0.7));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ad-label {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
  border: 1px solid rgba(0, 255, 156, 0.3);
  padding: 4px 8px;
}

.ad-banner p {
  color: var(--secondary);
  font-size: 0.9rem;
  margin: 0;
}

.hero-panel {
  border: 1px solid rgba(0, 255, 156, 0.25);
  background: linear-gradient(135deg, rgba(0, 255, 156, 0.08), rgba(26, 31, 58, 0.9));
  padding: 20px;
  margin-bottom: 24px;
}

.hero-panel h2 {
  font-size: 1.08rem;
  margin-bottom: 8px;
  color: var(--text);
}

.hero-panel p {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.featured-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

.featured-card {
  border: 1px solid rgba(0, 255, 156, 0.2);
  padding: 14px;
  background: rgba(10, 14, 39, 0.7);
}

.featured-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.featured-card span {
  color: var(--secondary);
  font-size: 0.84rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 2.2fr 0.8fr;
  gap: 20px;
  align-items: start;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-btn {
  border: 1px solid rgba(0, 255, 156, 0.4);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(0, 255, 156, 0.12);
  border-color: var(--text);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-card {
  border: 1px solid rgba(0, 255, 156, 0.2);
  background: rgba(10, 14, 39, 0.7);
  padding: 14px;
}

.sidebar-card h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}

.sidebar-card p,
.sidebar-card li {
  color: var(--secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.sidebar-card ul {
  padding-left: 16px;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.subscribe-form input {
  border: 1px solid rgba(0, 255, 156, 0.25);
  background: rgba(26, 31, 58, 0.9);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.subscribe-form button {
  border: 1px solid var(--border);
  background: rgba(0, 255, 156, 0.12);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}

.post-card {
  background: rgba(26, 31, 58, 0.75);
  border: 1px solid rgba(0, 255, 156, 0.25);
  border-radius: 8px;
  padding: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--text);
  box-shadow: 0 0 18px rgba(0, 255, 156, 0.12);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-category {
  color: var(--text);
}

.post-card h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

.post-card h2::before {
  content: '$ ';
  color: var(--text);
}

.post-card p {
  color: var(--secondary);
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--secondary);
  padding: 4px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}

.post-link:hover {
  text-decoration: underline;
}

footer {
  padding: 24px;
  border-top: 1px solid rgba(0, 255, 156, 0.2);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .featured-list,
  .posts-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    margin-top: 8px;
  }

  .content {
    padding: 18px;
  }

  .logo { font-size: 2rem; }
  .flip-card { width: 60px; height: 80px; }
  .flip-card-inner { font-size: 2rem; line-height: 80px; }
  .flip-card .top, .flip-card .top-flip { line-height: 80px; }
}
