/* A single row for the original signal wave and its two navigation icons. */
:root[data-signal-design] {
  --signal-ruler-height: 56px;
  --ruler-icon-column: clamp(32px, 6vw, 64px);
}

[data-signal-design] .project-ruler {
  grid-template-columns: var(--ruler-icon-column) repeat(var(--project-count), minmax(0, 1fr)) var(--ruler-icon-column);
  min-width: 0;
}

[data-signal-design] .project-ruler .ruler-item {
  padding: 0;
  align-items: center;
  justify-content: center;
}

[data-signal-design] .project-ruler .signal-scale {
  top: calc(50% - 23px);
  clip-path: inset(0 var(--ruler-icon-column));
}

/* Keep the project links named for keyboard and screen reader navigation. */
[data-signal-design] .project-ruler .ruler-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

[data-signal-design] .project-ruler .ruler-item:has(.ruler-label)::after {
  content: none;
}

:root[data-signal-design] .project-ruler .ruler-item .ruler-pearl-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  background: transparent;
  filter: none;
  opacity: .94;
  transition: opacity 160ms ease-out;
}
:root[data-signal-design] .project-ruler .ruler-item:is([aria-current], :hover, :focus-visible) .ruler-pearl-icon {
  filter: none;
  opacity: 1;
}

.project-ruler:not([data-reading-indicator]) .ruler-item:has(.ruler-label)::before {
  content: "";
  width: 2px;
  height: 18px;
  border-radius: 1px;
  background: #dedee0;
}

.project-ruler[data-reading-indicator="section"] .signal-wave-units path {
  fill: url("#ruler-frosted-face");
  stroke: none;
  shape-rendering: geometricPrecision;
}

:root[data-signal-design] .project-ruler .signal-wave-units {
  filter: none;
}

.ruler-hover-wash {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}
.project-ruler[data-project-preview] .ruler-hover-wash { opacity: .94; }

.ruler-project-card {
  display: none;
  position: fixed;
  inset: auto;
  margin: 0;
  overflow: visible;
  box-sizing: border-box;
  width: max-content;
  min-width: min(204px, calc(100vw - 16px));
  max-width: min(280px, calc(100vw - 16px));
  padding: 14px 18px 15px;
  border: 1px solid rgb(255 255 255 / .15);
  border-radius: 16px;
  background: #111113;
  color: #fff;
  box-shadow: 0 3px 6px #0003, 0 9px 20px -7px #0008;
  font: 400 13px/1.4 Inter, sans-serif;
  text-align: left;
  text-transform: none;
  white-space: normal;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ruler-project-card {
    background-color: rgb(9 9 12 / .48);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
  }
}
/* Reflect light along the rim without painting over the translucent face. */
.ruler-project-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background:
    radial-gradient(ellipse 47% 85% at 15% 0%, #e6deefa8, transparent 84%),
    radial-gradient(ellipse 43% 80% at 82% 100%, #d0baf4a3, transparent 87%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.ruler-project-card:popover-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 16px;
  animation: ruler-card-in 140ms ease-out both;
}
.ruler-project-card strong {
  grid-column: 1 / -1;
  font: 500 19px/1.16 Inter, sans-serif;
  letter-spacing: -.045em;
}
.ruler-project-card .ruler-audience { grid-area: 2 / 1; color: #d9d7dc; }
.ruler-project-card .project-platforms { grid-area: 2 / 2; gap: 5px; color: #d9d7dc; }
.ruler-project-card .project-platforms svg { width: 15px; height: 15px; }
@keyframes ruler-card-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  [data-landing-motion] .landing-word {
    display: inline-block;
    transform-origin: left center;
    animation: landing-word 320ms cubic-bezier(0, 0, 0, 1) backwards,
               landing-appear 75ms step-end backwards;
    animation-delay: calc(80ms + var(--word) * var(--word-stagger, 55ms));
  }
  .silver-name { --word-stagger: 180ms; }
  [data-landing-motion] .hero-byline,
  [data-landing-motion] .project-index-head,
  [data-landing-motion] .project-index li {
    animation: landing-row 290ms cubic-bezier(.18, .68, .18, 1) backwards;
  }
  [data-landing-motion] .hero-byline { animation-delay: 700ms; }
  [data-landing-motion] .project-index-head { animation-delay: 790ms; }
  [data-landing-motion] .project-index li { animation-delay: calc(845ms + var(--row) * 40ms); }
  [data-landing-motion] .project-index:focus-within :is(li, .project-index-head) { animation: none; }
}
@keyframes landing-word {
  from { transform: scale(.8); }
  to { transform: scale(1); }
}
@keyframes landing-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes landing-row {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ruler-hover-wash { transition: none; }
  :root[data-signal-design] .project-ruler .ruler-item .ruler-pearl-icon { transition: none; }
  .ruler-project-card:popover-open { animation: none; }
}
