/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color: #f4f5f7;
  background: #0b0d11;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- Background stack (one layer per service) ---------- */
.bg-stack {
  position: fixed;
  inset: -6%;                /* slightly larger than viewport for parallax */
  z-index: -2;
  pointer-events: none;
  transition: transform 200ms ease-out;
  will-change: transform;
}
.bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms ease;
  background-size: cover;
  background-position: center;
  filter: saturate(0.9);
}
.bg-layer.is-active { opacity: 1; }

/* Default (no card hovered) */
.bg-layer[data-default] { opacity: 1; }

/* Vignette + grain on top of the bg */
.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
}

/* ---------- Layout ---------- */
.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 1.5rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0,0,0,0.5);
}
.hero .dot { color: #6cc4ff; }
.tagline {
  margin: 0.5rem 0 0;
  opacity: 0.7;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;     /* expanded card grows downward, doesn't stretch siblings */
}

.card {
  position: relative;
  border-radius: 18px;
  padding: 1.4rem 1.4rem 1.2rem;
  background: rgba(20, 24, 32, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 196, 255, 0.45);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
.card:focus-visible {
  outline: 2px solid #6cc4ff;
  outline-offset: 3px;
}

.card-icon {
  font-size: 1.5rem;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 0.9rem;
}
.card-title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-url {
  margin: 0;
  opacity: 0.55;
  font-size: 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-all;
}

/* "i" info button */
.card-info {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 1.85rem; height: 1.85rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 200ms ease, transform 200ms ease;
  z-index: 2;
}
.card-info:hover { background: rgba(108, 196, 255, 0.25); }
.card.is-expanded .card-info {
  background: rgba(108, 196, 255, 0.35);
  transform: rotate(180deg);
}

/* Description: collapses with max-height */
.card-desc {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 350ms ease, margin-top 350ms ease;
  margin-top: 0;
}
.card-desc > div {
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.85;
}
.card.is-expanded .card-desc {
  grid-template-rows: 1fr;
  margin-top: 1rem;
}
.card-desc p { margin: 0 0 0.5rem; }
.card-desc p:last-child { margin-bottom: 0; }
.card-desc code {
  background: rgba(255,255,255,0.08);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.45;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-stack { transition: none; }
  .bg-layer { transition: opacity 200ms linear; }
  .card { transition: none; }
  .card-desc { transition: none; }
}
