:root {
  --space: 1rem;
  --bg: #09090b;
  --fg: #e3e3e3;
  --surface-1: #101012;
  --surface-2: #27272a;
  --surface-3: #52525b;
  --ease-out: cubic-bezier(0.5, 1, 0.89, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

* {
  box-sizing: border-box;
}

height,
body {
  height: 100%;
}

body {
  display: grid;
  color: var(--fg);
  background: var(--bg);
  padding: var(--space);
  min-height: 100vh;
  overflow: hidden;
}

main {
  display: grid;
  grid-template-columns: repeat(var(--count, 1), 1fr);
  gap: var(--space);
  margin: auto;
  inline-size: min(var(--max, 15rem), 100%);

  @media (min-width: 25rem) {
    --count: 2;
    --max: 30rem;
  }

  @media (min-width: 45rem) {
    --count: 4;
    --max: 60rem;
  }
}

.card {
  border-radius: 1rem; /* softer rounded corners */
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-areas: "card";
  place-items: center;
  aspect-ratio: 4/5;
  
  /* Glass look */
  background: rgba(255, 255, 255, 0.05); /* subtle semi-transparent */
  border: 1px solid rgba(255, 255, 255, 0.2); /* light frosted border */
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); /* soft shadow */
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  
  isolation: isolate;
  transition: border-color 200ms var(--ease-out), transform 300ms var(--ease-out);
  user-select: none;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom left, transparent 55%, rgba(255,255,255,0.05));
    pointer-events: none;
    box-shadow: inset -0.5cqi 0.5cqi 2.5cqi rgba(0,0,0,0.1);
    transition: opacity 900ms var(--ease-out);
  }

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 65%);
    opacity: 0;
    transition: opacity 800ms var(--ease-out);
  }

  > * {
    grid-area: card;
    z-index: 1;
  }

  svg {
    position: relative;
    z-index: 1;
    width: 30%;
    height: auto;
    color: var(--surface-3);
    transition: color 300ms var(--ease-out), transform 300ms var(--ease-out);
  }

  button {
    opacity: 0;
  }

  &:focus-within {
    outline: 5px auto Highlight;
    outline: 5px auto -webkit-focus-ring-color;
  }

  &:where(:hover, :focus-within) {
    border-color: var(--active-color, rgba(255,255,255,0.6));
    transform: translateY(-5px);
    transition: border-color 800ms var(--ease-in-out), transform 300ms var(--ease-in-out);
  }

  &:where(:hover, :focus-within) svg {
    color: var(--active-color, var(--fg));
    transform: scale(1.1);
  }

  &:where(:hover, :focus-within)::before {
    opacity: 0;
  }

  &:where(:hover, :focus-within)::after {
    opacity: 1;
  }
}

#sigil {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  filter: brightness(20%) opacity(30%) drop-shadow(0 0 0 #0000);
  transition: all 0.6s;
  cursor: pointer;
}

#sigil:hover {
  filter: brightness(50%) opacity(100%) drop-shadow(0 0 7px #3a3a3a);
  transition: all 0.6s;
}

#sigil.active {
  filter: brightness(100%) opacity(100%) drop-shadow(0 0 7px #fff);
  transition: all 0.6s;
}


#splash {
  position: fixed;
  inset: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}

/* This wrapper applies the shimmer *clipped to the logo* */
.logo-mask {
  position: relative;
  display: inline-block;
  width: 300px;
  height: 300px;

  /* Use SVG as masking area */
  -webkit-mask-image: var(--logo);
  mask-image: var(--logo);
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;

  /* Center mask */
  mask-position: center;
  -webkit-mask-position: center;
}

/* Real logo under the mask (static) */
.logo {
  width: 100%;
  height: 100%;
  filter: brightness(0);
}

/* Shimmer layer strictly clipped into the logo shape */
.logo-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255,255,255,0.7) 50%,
    transparent 80%
  );
  transform: translateX(-150%) skewX(-20deg);
  animation: shimmer 2s ease-out forwards;
}

@keyframes shimmer {
  to {
    transform: translateX(150%) skewX(-20deg);
  }
}
