/*
 * Shared interaction and typography layer. Loaded after the compiled
 * Tailwind bundle and mobile.css on every page, so equal-specificity
 * selectors here win.
 */

:root {
  /* The compiled bundle's grey (oklch 0.5348 at 85% alpha) is 3.1:1 on the
     page; this one is 4.8:1, past WCAG AA's 4.5:1 for body text. */
  --secondary: #616161;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-hover: 150ms;
  --duration-press: 160ms;
  --duration-enter: 420ms;
  --color-text-muted: var(--secondary);
  --color-image-outline: rgb(0 0 0 / 0.08);
  --shadow-chip:
    0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06),
    0 2px 4px rgb(0 0 0 / 0.04);
  --shadow-chip-hover:
    0 0 0 1px rgb(0 0 0 / 0.14), 0 1px 2px -1px rgb(0 0 0 / 0.08),
    0 3px 6px rgb(0 0 0 / 0.06);
  /* Fancy Components' underline timing: 0.4s with motion's "easeInOut". */
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --duration-underline: 400ms;
  /* Ruler ticks: decoration, so below the 3:1 a control would need. */
  --tick: #9c9d95;
}

/* Copy is written in normal case; the lowercase look is presentation only. */
body {
  text-transform: lowercase;
}

/* Anchored sections stop below the fixed nav (3.5rem) with room to spare.
   This padding is the one landing offset: the base styles also give headings
   and main a scroll margin, which would add to it, so that is cleared. */
html {
  scroll-padding-block-start: 5rem;
}

h1,
h2,
h3,
h4,
main {
  scroll-margin-top: 0;
}

/* A section the ruler moved focus to is a landing spot, not a control. */
main [data-toc][tabindex="-1"]:focus {
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

code,
.keep-case,
input,
textarea {
  text-transform: none;
}

code {
  font-family: inherit;
  font-size: inherit;
}

main {
  overflow-wrap: break-word;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Page shell: one width on every subpage ---------- */

.page-shell {
  max-width: none;
  margin-inline: 0;
}

.page-main {
  max-width: 42rem;
}

.page-main .prose-left,
.page-main .prose-left p {
  text-align: left;
}

/* ---------- Site nav ---------- */

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: -0.5rem;
}

.site-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-hover) ease-out;
}

.site-nav-links a[aria-current="page"] {
  color: var(--foreground);
}

@media (hover: hover) {
  .site-nav-links a:hover {
    color: var(--foreground);
  }
}

/* ---------- Inline text links ---------- */

.ulink {
  color: var(--foreground);
  text-decoration: none;
}

/* The underline comes in from the start of the text and leaves past its end
   (Fancy Components' "comes in, goes out" underline, done with a background
   so it follows a link across line breaks). At rest the anchor sits on the
   end; on hover it jumps to the start while the line has no width, so the
   line always grows forward and shrinks forward. */
.ulink-text {
  padding-bottom: 1px;
  border-bottom: 1px dotted var(--color-text-muted);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 100% calc(100% + 1px);
  background-size: 0% 1px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size var(--duration-underline) var(--ease-in-out);
}

.ulink:dir(rtl) .ulink-text {
  background-position: 0 calc(100% + 1px);
}

@media (prefers-reduced-motion: reduce) {
  .ulink-text {
    transition-duration: 0ms;
  }
}

.ulink-icon {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  margin-left: 0.25rem;
  vertical-align: -0.125em;
  color: var(--color-text-muted);
  transition:
    color var(--duration-hover) ease-out,
    transform 200ms var(--ease-out);
}

.ulink-logo {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 0.25rem;
  vertical-align: -0.125em;
  object-fit: contain;
}

.ulink:focus-visible .ulink-text {
  background-position: 0 calc(100% + 1px);
  background-size: 100% 1px;
}

.ulink:dir(rtl):focus-visible .ulink-text {
  background-position: 100% calc(100% + 1px);
}

@media (hover: hover) {
  .ulink:hover .ulink-text {
    background-position: 0 calc(100% + 1px);
    background-size: 100% 1px;
  }

  .ulink:dir(rtl):hover .ulink-text {
    background-position: 100% calc(100% + 1px);
  }

  .ulink:hover .ulink-icon {
    color: var(--foreground);
    transform: translateX(2px);
  }

  .ulink[target="_blank"]:hover .ulink-icon {
    transform: translate(1.5px, -1.5px);
  }
}

/* ---------- Section call-to-action links ("More about me ->") ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding-inline: 0.5rem 0.375rem;
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
  transition:
    opacity var(--duration-hover) ease-out,
    scale var(--duration-press) ease-out;
}

.cta svg {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform 200ms var(--ease-out);
}

.cta:active {
  scale: 0.97;
}

.cta:focus-visible svg {
  transform: translateX(3px);
}

@media (hover: hover) {
  .cta:hover {
    opacity: 0.7;
  }

  .cta:hover svg {
    transform: translateX(3px);
  }
}

/* ---------- Chips (project repo / site links) ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 28px;
  padding: 0.25rem 0.375rem 0.25rem 0.5rem;
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--foreground);
  background: #fff;
  box-shadow: var(--shadow-chip);
  transition:
    box-shadow var(--duration-hover) ease-out,
    scale var(--duration-press) ease-out;
}

.chip svg {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--color-text-muted);
  transition:
    color var(--duration-hover) ease-out,
    transform 200ms var(--ease-out);
}

.chip:active {
  scale: 0.97;
}

@media (hover: hover) {
  .chip:hover {
    box-shadow: var(--shadow-chip-hover);
  }

  .chip:hover svg {
    color: var(--foreground);
    transform: translateX(2px);
  }
}

/* Project titles: show the arrow on hover and on keyboard focus. */
.project-title svg {
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity var(--duration-hover) ease-out,
    transform 200ms var(--ease-out);
}

.project-title:focus-visible svg {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .project-title:hover svg {
    opacity: 1;
    transform: none;
  }
}

/* Rows that are entire links (projects on the home page, PRs, tracks). */
.row-link {
  transition: opacity var(--duration-hover) ease-out;
}

@media (hover: hover) {
  .row-link:hover {
    opacity: 0.7;
  }
}

/* Small icon-only link next to a heading: give it a real hit area. */
.icon-link {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--color-text-muted);
  transition: color var(--duration-hover) ease-out;
}

.icon-link svg {
  width: 12px;
  height: 12px;
}

@media (hover: hover) {
  .icon-link:hover {
    color: var(--foreground);
  }
}

/* ---------- Copy email button with icon swap ---------- */

.copy-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 0.125rem;
  vertical-align: middle;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out,
    scale var(--duration-press) ease-out;
}

html:not(.js) .copy-btn {
  display: none;
}

.copy-btn:active {
  scale: 0.96;
}

.copy-btn svg {
  grid-area: 1 / 1;
  width: 14px;
  height: 14px;
  transition:
    opacity 200ms var(--ease-out),
    scale 200ms var(--ease-out),
    filter 200ms var(--ease-out);
}

.copy-btn .icon-done,
.copy-btn[data-copied] .icon-idle {
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

.copy-btn[data-copied] .icon-done {
  opacity: 1;
  scale: 1;
  filter: blur(0);
}

.copy-btn[data-copied] {
  color: var(--foreground);
}

@media (hover: hover) {
  .copy-btn:hover {
    color: var(--foreground);
    background-color: rgb(0 0 0 / 0.05);
  }
}

/* ---------- Touch targets ---------- */

/* On touch screens every control that stands on its own gets a 44px target.
   Links inside a sentence keep their line height (WCAG 2.5.8 exempts inline
   links), since a taller box would cover the lines above and below. Small
   controls grow an invisible target instead of a bigger look. */
@media (pointer: coarse) {
  nav[aria-label="Site"] a,
  .cta,
  .project-title,
  .screensaver-toggle,
  #spotify-top-tracks > a {
    min-height: 44px;
  }

  .link-list .ulink,
  .ulink.standalone {
    display: inline-block;
    min-inline-size: 44px;
    padding-block: 13px;
    text-align: center;
  }

  .chip,
  .icon-link,
  .copy-btn {
    position: relative;
  }

  .chip::after,
  .icon-link::after,
  .copy-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    translate: -50% -50%;
  }

  /* Room for the copy button's wider target, so it never covers the address. */
  .copy-btn {
    margin-inline-start: 0.5rem;
  }
}

/* ---------- Missing cover art ---------- */

.cover-missing {
  display: inline-grid;
  flex: none;
  place-items: center;
  color: var(--color-text-muted);
  background: rgb(0 0 0 / 0.05);
  outline: 1px solid var(--color-image-outline);
  outline-offset: -1px;
}

.cover-missing svg {
  width: 45%;
  height: 45%;
}

/* ---------- Images ---------- */

img.object-cover {
  outline: 1px solid var(--color-image-outline);
  outline-offset: -1px;
}

/* Animated ascii scenes in place of hero photos (assets/js/ascii-hero.js).
   The canvas is sized to whole rows, a little taller than the box, and the
   box crops it from the middle. */
.page-main .hero-ascii {
  display: flex;
  align-items: center;
  overflow: hidden;
  outline: 1px solid var(--color-image-outline);
  outline-offset: -1px;
}

.hero-ascii canvas {
  flex: none;
  width: 100%;
}

/* ---------- Scroll reveal ---------- */

/* Static by default; only hide content when motion is welcome and JS runs. */
html.js section.reveal,
html.js hr.reveal,
html.js article.reveal {
  opacity: 1;
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  html.js section.reveal,
  html.js hr.reveal,
  html.js article.reveal {
    opacity: 0;
  }

  html.js section.reveal.visible,
  html.js article.reveal.visible {
    animation: reveal-in var(--duration-enter) var(--ease-out)
      var(--reveal-delay, 0ms) both;
  }

  html.js hr.reveal.visible {
    animation: reveal-fade var(--duration-enter) ease-out
      var(--reveal-delay, 0ms) both;
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes reveal-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ---------- Spotify widgets ---------- */

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #16a34a;
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: live-pulse 2s ease-in-out infinite;
  }
}

@keyframes live-pulse {
  50% {
    opacity: 0.35;
  }
}

.fade-img {
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.fade-img[data-loaded] {
  opacity: 1;
}

/* Every artist gets the same width, so the photos sit at even intervals
   however long each name is. A short last row stays centered. */
#spotify-top-artists {
  --artist-gap: 0.5rem;
  --artist-columns: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem var(--artist-gap);
}

#spotify-top-artists > a {
  flex: 0 0
    calc(
      (100% - (var(--artist-columns) - 1) * var(--artist-gap)) /
        var(--artist-columns)
    );
  min-width: 0;
}

#spotify-top-artists > a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading and error messages span the row. */
#spotify-top-artists > div {
  flex-basis: 100%;
}

@media (max-width: 374px) {
  #spotify-top-artists {
    --artist-columns: 3;
  }
}

/* ---------- Page titles settling out of ascii glyphs (craft/scramble.js) ---------- */

/* The rest of the title is laid out but hidden, so a centered heading keeps
   its place while the letters resolve. */
.scramble {
  white-space: pre-wrap;
}

.scramble-glyphs {
  color: var(--color-text-muted);
}

.scramble-rest {
  visibility: hidden;
}

/* ---------- Margin ruler on long pages (craft/ruler.js) ---------- */

/* It lives in the left margin, so it only appears once the margin can hold
   it beside the 42rem column; the page's own headings carry narrower screens. */
.ruler {
  display: none;
}

@media (min-width: 76rem) {
  .ruler {
    position: fixed;
    z-index: 40;
    top: 50%;
    inset-inline-start: max(
      calc(var(--spacing) * 6),
      calc((100% - 42rem) / 2 - 15rem)
    );
    display: block;
    width: 13rem;
    translate: 0 -50%;
  }
}

.ruler-list {
  max-height: calc(100dvh - 3.5rem - 4rem);
  margin: 0;
  padding: calc(var(--spacing) * 2) 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--tick) transparent;
  list-style: none;
  text-align: start;
}

/* Two inputs drive a mark: --p, the pointer's reach (0 to 1, set by
   craft/ruler.js), and --a, its own state (the section being read, or
   keyboard focus). The mark shows whichever is larger as --e, so the
   section being read stays the longest tick while the pointer roams. */
.ruler-link {
  --e: max(var(--p, 0), var(--a, 0));
  --ink: calc(min(var(--e), 1) * 100%);
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 3);
  min-height: 2.25rem;
  padding-inline-end: 2rem;
  color: color-mix(in oklab, var(--foreground) var(--ink), var(--color-text-muted));
  text-decoration: none;
}

/* The ruler shows beside the column on wide screens, which can be touch
   laptops: a finger still gets a 44px row. */
@media (pointer: coarse) {
  .ruler-link {
    min-height: 44px;
  }
}

/* The section being read: the longest tick. */
.ruler-link[aria-current] {
  --a: 1.4;
}

/* Keyboard focus: the longer tick, full ink and a solid underline, the same
   way other links on the site show focus. A ring would be clipped to two
   bars by the ruler's scroll box. */
.ruler-link:focus-visible {
  --a: 1;
  outline: none;
}

.ruler-link:focus-visible .ruler-label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.ruler-line {
  flex: none;
  width: 1rem;
  height: 1px;
  background: color-mix(in oklab, var(--foreground) var(--ink), var(--tick));
  transform-origin: left center;
  scale: calc(1 + var(--e) * 1.25) 1;
}

.ruler-link:dir(rtl) .ruler-line {
  transform-origin: right center;
}

/* Number and name sit on one baseline (12px and 14px text would otherwise
   centre 1.5px apart) and lean in together. */
.ruler-text {
  display: flex;
  align-items: baseline;
  gap: calc(var(--spacing) * 3);
  min-width: 0;
  translate: calc(var(--e) * 1.25rem) 0;
}

.ruler-link:dir(rtl) .ruler-text {
  translate: calc(var(--e) * -1.25rem) 0;
}

.ruler-num {
  flex: none;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.ruler-label {
  min-width: 0;
  overflow: hidden;
  font-size: var(--text-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* One short tick between rows. It reaches out with the pointer too, at
   half the ink. */
.ruler-minor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 3px;
}

.ruler-minor i {
  width: 0.5rem;
  height: 1px;
  background: color-mix(
    in oklab,
    var(--foreground) calc(min(var(--p, 0), 1) * 50%),
    var(--tick)
  );
  transform-origin: left center;
  scale: calc(1 + var(--p, 0) * 1.5) 1;
}

.ruler-link:dir(rtl) ~ .ruler-minor i {
  transform-origin: right center;
}

@media (prefers-reduced-motion: no-preference) {
  .ruler-link,
  .ruler-line,
  .ruler-text,
  .ruler-minor i {
    transition:
      scale 180ms var(--ease-out),
      translate 180ms var(--ease-out),
      background-color var(--duration-hover) ease-out,
      color var(--duration-hover) ease-out;
  }
}

/* ---------- Pixel loader (craft/pixel-loader.js) ---------- */

.pixel-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  color: var(--foreground);
}

.pixel-loader-grid {
  display: grid;
  grid-template-columns: repeat(var(--pixels), 2px);
  grid-auto-rows: 2px;
  gap: 2px;
}

/* Still, it reads as a soft dot: bright middle, fading edge. */
.pixel-loader-grid > span {
  background: currentColor;
  opacity: calc(0.85 - var(--d) * 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  .pixel-loader-grid > span {
    opacity: 0.12;
    animation: pixel-ripple 1.2s var(--ease-in-out) calc(var(--d) * 600ms)
      infinite both;
  }

  .pixel-loader[data-paused] .pixel-loader-grid > span {
    animation-play-state: paused;
  }
}

@keyframes pixel-ripple {
  0%,
  100% {
    opacity: 0.12;
  }

  35% {
    opacity: 1;
  }
}

/* ---------- Now playing card (spotify-page.js) ---------- */

#spotify-now-playing {
  container-type: inline-size;
}

.np-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(var(--spacing) * 4);
  padding: calc(var(--spacing) * 3);
  color: var(--foreground);
  text-align: start;
  text-decoration: none;
  background: #fff;
  box-shadow: var(--shadow-chip);
  transition: box-shadow var(--duration-hover) ease-out;
}

@media (hover: hover) {
  .np-card:hover {
    box-shadow: var(--shadow-chip-hover);
  }
}

.np-cover {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 4px;
  outline: 1px solid var(--color-image-outline);
  outline-offset: -1px;
}

.np-meta {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing) * 1.5);
  min-width: 0;
}

.np-title {
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.np-artist {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.np-status {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--spacing) * 1.5);
  align-self: start;
  padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 1.5);
  font-size: var(--text-xs);
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Narrow cards put the status under the song instead of squeezing the title. */
@container (max-width: 26rem) {
  .np-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .np-status {
    grid-column: 2;
    justify-self: start;
  }
}

/* ---------- Ascii heroes you can stir (scripts/ascii/hero.js) ---------- */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-ascii {
    cursor: crosshair;
  }
}

/* ---------- Section rules you can pluck (craft/elastic-line.js) ---------- */

/* The rule stays 1px in the page flow; the bend draws in a taller box around
   it that never takes pointer events. */
.elastic {
  position: relative;
  height: 1px;
}

.elastic svg {
  position: absolute;
  inset-inline: 0;
  top: -24px;
  width: 100%;
  height: 48px;
  overflow: visible;
  color: var(--border);
  pointer-events: none;
}

.elastic path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

/* ---------- Email pull cord (craft/pull-cord.js) ---------- */

.pull-cord {
  position: relative;
  align-self: center;
  width: 9rem;
  height: 5.5rem;
}

html:not(.js) .pull-cord {
  display: none;
}

.pull-cord-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--color-text-muted);
  pointer-events: none;
}

.pull-cord-line path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
}

/* The bead hangs at the cord's end: 7 links of 7px. */
.pull-cord-bead.copy-btn {
  position: absolute;
  top: 49px;
  left: calc(50% - 14px);
  margin: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-chip);
  cursor: grab;
  touch-action: none;
}

.pull-cord-bead.copy-btn:active {
  cursor: grabbing;
}

.pull-cord-hint {
  position: absolute;
  top: 55px;
  left: calc(50% + 22px);
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--color-text-muted);
  transition: opacity var(--duration-hover) ease-out;
}

/* The cord swings through the hint while held. */
.pull-cord.is-held .pull-cord-hint {
  opacity: 0;
}

/* ---------- Listening range dial (craft/detent-dial.js) ---------- */

.dial {
  position: relative;
  width: var(--dial-size);
  height: var(--dial-size);
  margin: calc(var(--spacing) * 6) auto calc(var(--spacing) * 2);
  user-select: none;
}

.dial svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.dial line {
  stroke: var(--tick);
  stroke-width: 1.5;
  transition: stroke var(--duration-hover) ease-out;
}

.dial line.is-lit {
  stroke: var(--foreground);
}

.dial line.is-current {
  stroke: var(--foreground);
  stroke-width: 2;
}

.dial-mark {
  position: absolute;
  translate: -50% -50%;
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--color-text-muted);
  transition: color var(--duration-hover) ease-out;
}

.dial-mark.is-current {
  color: var(--foreground);
}

.dial-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64%;
  height: 64%;
  translate: -50% -50%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.06),
    0 12px 32px -12px rgb(0 0 0 / 0.25);
  cursor: grab;
  touch-action: none;
}

.dial-knob.is-grabbing {
  cursor: grabbing;
}

.dial-knob:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 4px;
}

.dial-indicator {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dial-indicator::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 3px;
  height: 12px;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--foreground);
}

[aria-busy="true"] {
  opacity: 0.5;
  transition: opacity var(--duration-hover) ease-out;
}

/* ---------- Pull to refresh (craft/pull-refresh.js) ---------- */

/* The pull opens room above the card, so the sections below move down with
   it instead of sliding under it. */
.pull-box {
  position: relative;
  padding-top: var(--pull, 0px);
}

.pull-grip {
  position: relative;
  display: block;
  width: 2.5rem;
  height: 1rem;
  margin: 0 auto calc(var(--spacing) * 2);
  cursor: grab;
  touch-action: none;
}

.pull-grip::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 3px;
  translate: 0 -50%;
  border-radius: 999px;
  background: var(--color-text-muted);
  transition: background-color var(--duration-hover) ease-out;
}

/* A 44px target around the small grip. */
.pull-grip::after {
  content: "";
  position: absolute;
  inset: -14px -2px;
}

@media (hover: hover) {
  .pull-grip:hover::before {
    background: var(--foreground);
  }
}

.pull-hint {
  position: absolute;
  inset-inline: 0;
  top: 0;
  font-size: var(--text-xs);
  text-align: center;
  color: var(--color-text-muted);
  opacity: var(--pull-progress, 0);
  pointer-events: none;
}

.pull-box.is-loading .pull-hint {
  opacity: 1;
}


.pull-box.is-settling {
  transition: padding-top 320ms var(--ease-out);
}

/* ---------- Bouncing 404 (craft/screensaver.js) ---------- */

.screensaver {
  position: relative;
  height: 12rem;
  overflow: hidden;
  color: #e9e5d8;
  background: #0c0806;
  outline: 1px solid var(--color-image-outline);
  outline-offset: -1px;
}

.screensaver-item {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  font-size: 0.625rem;
  line-height: 1;
  text-transform: none;
}

.screensaver.is-still .screensaver-item {
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.screensaver-toggle {
  position: absolute;
  inset-inline-end: calc(var(--spacing) * 2);
  bottom: calc(var(--spacing) * 2);
  min-height: 28px;
  padding-inline: calc(var(--spacing) * 2);
  font-size: var(--text-xs);
  color: inherit;
  text-transform: inherit;
  background: rgb(255 255 255 / 0.08);
  border-radius: 4px;
}

@media (hover: hover) {
  .screensaver-toggle:hover {
    background: rgb(255 255 255 / 0.16);
  }
}
