/* ─────────────────────────────────────────
   MICLOGS — Premium Dark Glassmorphism
   ───────────────────────────────────────── */

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

:root {
  --black:        #03030a;
  --surface:      rgba(255,255,255,0.032);
  --surface-h:    rgba(255,255,255,0.062);
  --border:       rgba(255,255,255,0.07);
  --border-h:     rgba(255,255,255,0.16);
  --text-hi:      rgba(255,255,255,0.88);
  --text-lo:      rgba(255,255,255,0.28);
  --accent:       #a78bfa;
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  width: 100%; min-height: 100vh;
  background: var(--black);
  font-family: var(--font-sans);
  color: var(--text-hi);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Canvas particle field ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── Background image ── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: url('assets/bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.6;
  pointer-events: none;
}

/* ── Noise grain ── */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── Wrapper ── */
.site-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 40px 40px;
  gap: 0;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  user-select: none;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.28em;
  color: rgba(255,255,255,0.60);
  text-transform: lowercase;
}

.logo-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
  box-shadow: 0 0 6px 2px rgba(167,139,250,0.5);
}

/* ── Thin rule ── */
.header-rule {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  margin-bottom: 36px;
}

/* ── Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 158px);
  grid-template-rows: repeat(2, 158px);
  gap: 16px;
}

/* ── Card wrapper (handles the external glow) ── */
.card-wrap {
  position: relative;
  width: 158px;
  height: 158px;
}

.card-wrap .card-glow-layer {
  position: absolute;
  inset: -12px;
  border-radius: 26px;
  background: radial-gradient(ellipse at 50% 100%, var(--card-glow, rgba(167,139,250,0.18)), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.card-wrap:hover .card-glow-layer {
  opacity: 1;
}

/* ── Card ── */
.card {
  width: 158px;
  height: 158px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-hi);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;

  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);

  transition:
    transform 0.4s var(--ease-out),
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.4s ease;

  box-shadow:
    0 2px 12px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Shimmer top edge */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.card-wrap:hover .card {
  transform: translateY(-5px) scale(1.03);
  background: var(--surface-h);
  border-color: var(--border-h);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.60),
    0 0 0 1px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

.card-wrap:hover .card::before {
  opacity: 1;
}

.card-wrap:active .card {
  transform: translateY(-2px) scale(1.01);
  transition-duration: 0.1s;
}

/* ── Card icon ── */
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: transform 0.35s var(--ease-out), filter 0.3s ease;
}

.card-icon svg {
  width: 100%; height: 100%;
}

.card-wrap:hover .card-icon {
  transform: scale(1.1) translateY(-1px);
  filter: drop-shadow(0 0 8px var(--card-glow, rgba(167,139,250,0.5)));
}

/* ── Card title ── */
.card-title {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.50);
  text-align: center;
  text-transform: uppercase;
  padding: 0 10px;
  transition: color 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.card-wrap:hover .card-title {
  color: rgba(255,255,255,0.82);
}

/* ── Arrow ── */
.card-arrow {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  opacity: 0;
  color: rgba(255,255,255,0.35);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}

.card-wrap:hover .card-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Remove any clipping so external glow is visible */
.card-grid { overflow: visible; }

/* ── Footer ── */
footer {
  margin-top: 36px;
}

.footer-text {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.14);
  text-transform: lowercase;
}

/* ── Responsive ── */
@media (max-width: 740px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    width: min(calc(100vw - 48px), 500px);
  }
  .card {
    width: auto;
    height: auto;
    aspect-ratio: 1;
  }
  .site-wrapper {
    padding: 40px 24px 32px;
  }
}

@media (max-width: 460px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: min(calc(100vw - 32px), 280px);
  }
}
