/* Custom cursor: a dot that follows exactly and a ring that trails behind.
   script.js moves them; this file decides how they look and react. */

.cursor {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  display: none; /* script.js shows it only for a real mouse */
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.has-cursor .cursor { display: block; }

/* Hide the system pointer only where the custom one replaces it.
   Text fields keep the text caret. */
.has-cursor,
.has-cursor a,
.has-cursor button { cursor: none; }
.has-cursor input,
.has-cursor textarea { cursor: text; }

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor__dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.cursor__ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
}

/* the visible ring is a child, so its scale does not fight the position */
.cursor__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid #fff;
  border-radius: 50%;
  mix-blend-mode: difference;
  transition:
    transform var(--duration-slow) var(--ease-enter),
    opacity var(--duration-fast) var(--ease-standard);
}

/* the labelled disc: its own layer, so only transform and opacity change */
.cursor__label {
  position: absolute;
  inset: -24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, #ff6a3d);
  color: var(--accent-ink, #160d08);
  font: 600 12px var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity var(--duration-fast) var(--ease-standard),
    transform var(--duration-slow) var(--ease-enter);
}

/* over something clickable: the ring grows */
.cursor.is-link .cursor__ring::before { transform: scale(1.6); }

/* over something with a label: the ring hands over to a solid disc with the word */
.cursor.has-label .cursor__ring::before { transform: scale(2.2); opacity: 0; }
.cursor.has-label .cursor__label { opacity: 1; transform: scale(1); }
.cursor.is-link .cursor__dot,
.cursor.has-label .cursor__dot { opacity: 0; }

/* pressed */
.cursor.is-down .cursor__ring::before { transform: scale(0.8); }

/* left the window */
.cursor.is-hidden { opacity: 0; }

/* Reduced motion: script.js removes the trail (the ring sits on the dot) and
   the states change by fading instead of growing. */
@media (prefers-reduced-motion: reduce) {
  .cursor__ring::before,
  .cursor__label { transition: opacity var(--duration-fast) var(--ease-standard); }
  .cursor.is-link .cursor__ring::before,
  .cursor.is-down .cursor__ring::before { transform: none; }
  .cursor.has-label .cursor__ring::before { transform: none; }
  .cursor__label { transform: none; }
}

/* demo layout */
.cc-stage { max-width: 1180px; margin: 0 auto; padding: 120px 28px 80px; }
.cc-title { margin: 16px 0 40px; font: 700 clamp(44px, 7vw, 96px)/1 var(--font-display, system-ui, sans-serif); letter-spacing: -0.035em; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.cc-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 5;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  font: 600 18px var(--font-display, system-ui, sans-serif);
  text-decoration: none;
  overflow: hidden;
}
.cc-tile--a { background: radial-gradient(circle at 30% 30%, #ffb38a, transparent 45%), linear-gradient(160deg, #ff6a3d, #5a1d0e); }
.cc-tile--b { background: repeating-linear-gradient(135deg, #2d2924 0 14px, #1f1c18 14px 28px), #1f1c18; }
.cc-tile--c { background: radial-gradient(circle at 70% 60%, #e9dcc6 0 18%, transparent 19%), linear-gradient(200deg, #3a332b, #0f0e0c); }
.cc-links { margin-top: 40px; color: var(--muted, #9c9488); }
