/* Glass integrations that float and can be flung: the Integrations section of a made-up workflow tool on a pale,
   watery page. The field holds the water canvas (ripples), the two orbit lines, the thread, the mark in the middle
   and the glass tiles; every tile is moved by script.js, one transform each frame (the sheen inside is CSS). */
:root {
  --page: #edeff2;          /* the page */
  --pool: #dfe6f3;          /* the pale pool of light behind the field */
  --ink: #15171c;           /* the words and the icons */
  --muted: #6b7080;         /* the small words */
  --line: rgba(21, 23, 28, 0.08); /* the orbit lines */
  --accent: #2f5bff;        /* the one colour: the mark, the thread, a part of every icon */
  --accent-deep: #1d3fd6;   /* the darker side of the mark */
  --glass: rgba(255, 255, 255, 0.62); /* the glass of the tiles */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  height: 100svh;
  min-height: 320px;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(14px, 4vh, 44px) clamp(14px, 4vw, 48px) clamp(8px, 2vh, 24px);
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 62%, var(--pool), transparent 70%),
    radial-gradient(120% 90% at 50% 120%, rgba(47, 91, 255, 0.06), transparent 60%),
    var(--page);
}

/* a whisper of grain so the page is not flat */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.55 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- the heading */
.head {
  position: relative;
  z-index: 3;
  text-align: center;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 clamp(4px, 1vh, 10px);
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  margin: 0 auto;
  max-width: 22ch;
  text-wrap: balance;
  font-size: clamp(17px, min(3.6vw, 4.6vh), 34px);
  line-height: 1.08;
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.02em;
}

.sub {
  margin: clamp(4px, 1vh, 10px) auto 0;
  max-width: 44ch;
  text-wrap: balance;
  font-size: clamp(11px, min(1.7vw, 2.1vh), 15px);
  line-height: 1.4;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the field */
.field {
  position: relative;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.field.is-over {
  cursor: grab;
}

.field.is-grabbing {
  cursor: grabbing;
}

.water,
.rings,
.threads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.ring--outer {
  stroke-dasharray: 2 5;
}

.thread {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-dasharray: 0 1;
  opacity: 0;
}

.glint {
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 0.07 1.2;
  stroke-dashoffset: 0.1;
  opacity: 0;
  filter: drop-shadow(0 0 3px rgba(47, 91, 255, 0.9));
}

/* ---------------------------------------------------------------- the mark in the middle */
.core {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--c, 80px);
  height: var(--c, 80px);
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

.core__halo {
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(47, 91, 255, 0.2), rgba(47, 91, 255, 0.06) 55%, transparent);
}

.core__face {
  position: absolute;
  inset: 0;
  border-radius: 30%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.38), transparent 45%),
    linear-gradient(150deg, var(--accent), var(--accent-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(10, 20, 90, 0.35),
    0 2px 4px rgba(29, 63, 214, 0.25),
    0 14px 30px -10px rgba(29, 63, 214, 0.55),
    0 30px 60px -30px rgba(20, 30, 80, 0.4);
}

.core__mark {
  width: 56%;
  height: 56%;
  overflow: visible;
}

.core__wave {
  fill: none;
  stroke: #fff;
  stroke-width: 3.2;
  stroke-linecap: round;
}

.core__wave--soft {
  opacity: 0.5;
}

/* ---------------------------------------------------------------- the glass tiles */
.tiles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--t, 56px);
  height: var(--t, 56px);
  border-radius: 28%;
  will-change: transform;
  opacity: 0;
}

/* the body of the glass: a frosted face, a bright rim on top, soft shadows in three layers */
.tile__glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.86), var(--glass) 55%, rgba(255, 255, 255, 0.44));
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(21, 23, 28, 0.05),
    0 1px 2px rgba(20, 30, 60, 0.08),
    0 8px 16px -6px rgba(20, 30, 60, 0.16),
    0 22px 36px -18px rgba(20, 30, 60, 0.22);
  transition: box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* the sheen that slides with the speed of the tile (moved by --sx, --sy from script.js) */
.tile__glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(70% 55% at calc(30% + var(--sx, 0) * 1%) calc(12% + var(--sy, 0) * 1%), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%);
  opacity: 0.75;
  mix-blend-mode: soft-light;
}

.tile.is-active .tile__glass {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(47, 91, 255, 0.28),
    inset 0 -1px 0 rgba(21, 23, 28, 0.05),
    0 1px 2px rgba(20, 30, 60, 0.08),
    0 12px 22px -8px rgba(29, 63, 214, 0.22),
    0 30px 44px -20px rgba(20, 30, 60, 0.28);
}

.tile.is-held .tile__glass {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(47, 91, 255, 0.36),
    inset 0 -1px 0 rgba(21, 23, 28, 0.05),
    0 2px 4px rgba(20, 30, 60, 0.08),
    0 22px 32px -10px rgba(29, 63, 214, 0.26),
    0 44px 60px -24px rgba(20, 30, 60, 0.34);
}

.tile__icon {
  position: absolute;
  inset: 24%;
  width: 52%;
  height: 52%;
  overflow: visible;
}

.i-ink {
  fill: var(--ink);
}

.i-acc {
  fill: var(--accent);
}

.i-line,
.i-acc-line,
.i-faint {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-line {
  stroke: var(--ink);
}

.i-acc-line {
  stroke: var(--accent);
}

.i-faint {
  stroke: var(--ink);
  opacity: 0.18;
  stroke-width: 1.2;
}

/* ---------------------------------------------------------------- the name tag */
.tag {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 1px;
  padding: 7px 11px 7px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 0 0 1px rgba(21, 23, 28, 0.06),
    0 6px 16px -6px rgba(20, 30, 60, 0.22);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.tag__name {
  font-size: clamp(11px, 1.8vh, 13px);
  font-weight: 620;
  letter-spacing: -0.01em;
}

.tag__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(9.5px, 1.5vh, 11px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag__check {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- the drawn pointer of the walk on its own */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  z-index: 6;
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(20, 30, 60, 0.3));
  pointer-events: none;
  opacity: 0;
  transform-origin: 5px 3.5px;
}

/* the icon lifts a pixel and grows a hair when its tile is under the pointer, with a small overshoot */
.tile__icon {
  transition: transform 0.45s cubic-bezier(0.34, 1.7, 0.5, 1);
}

.tile.is-active .tile__icon {
  transform: translateY(-1px) scale(1.06);
}

.tile.is-held .tile__icon {
  transform: translateY(-1.5px) scale(1.08);
}
