/*
 * Corner menu, after hover.dev's "Corner Nav". Built by custom/corner-nav.js.
 * The panel grows out of the top-right button; links, socials and actions
 * stagger in once it has opened.
 */

.av-corner {
  --av-ink: #17221c;
  --av-paper: #f6f2e9;
  --av-muted: rgba(246, 242, 233, 0.4);
  --av-mint: #86e7ae;
  --av-mint-soft: #e9f8ed;
  --av-blue: #245da8;
  --av-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, "Inter Placeholder", system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.av-corner-bg {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--av-ink);
  box-shadow: 0 1px 2px #17221c1a, 0 12px 32px #17221c29;
  transition: width 0.6s var(--av-ease), height 0.6s var(--av-ease), border-radius 0.6s var(--av-ease);
}
.av-corner.av-open .av-corner-bg {
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  border-radius: 18px;
}

.av-corner-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 62;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s var(--av-ease);
}
.av-corner-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.av-corner-toggle:focus-visible { outline: 2px solid var(--av-mint); outline-offset: 3px; }
.av-corner-toggle i {
  position: absolute;
  left: 50%;
  height: 2px;
  border-radius: 2px;
  background: var(--av-paper);
  transition: transform 0.45s var(--av-ease), width 0.45s var(--av-ease), top 0.45s var(--av-ease);
}
.av-corner-toggle i:nth-child(1) { top: 20px; width: 24px; transform: translateX(-50%); }
.av-corner-toggle i:nth-child(2) { top: 27px; width: 24px; transform: translateX(-50%); }
.av-corner-toggle i:nth-child(3) { top: 34px; width: 12px; transform: translateX(0); }
.av-corner.av-open .av-corner-toggle i:nth-child(1) { top: 27px; transform: translateX(-50%) rotate(45deg); }
.av-corner.av-open .av-corner-toggle i:nth-child(2) { top: 27px; transform: translateX(-50%) rotate(-45deg); }
.av-corner.av-open .av-corner-toggle i:nth-child(3) { top: 27px; width: 0; }

.av-corner-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 61;
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  overflow: hidden;
  pointer-events: none;
}
.av-corner.av-open .av-corner-panel { pointer-events: auto; }

/* Shared stagger: hidden until open, then each item rises in order. */
.av-corner-links a,
.av-corner-socials a,
.av-corner-actions a {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s, transform 0.2s, color 0.25s var(--av-ease), background 0.25s var(--av-ease);
}
.av-corner.av-open .av-corner-links a,
.av-corner.av-open .av-corner-socials a,
.av-corner.av-open .av-corner-actions a {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--av-ease), transform 0.6s var(--av-ease), color 0.25s var(--av-ease), background 0.25s var(--av-ease);
  transition-delay: calc(0.3s + var(--i, 0) * 0.07s), calc(0.3s + var(--i, 0) * 0.07s), 0s, 0s;
}

.av-corner-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(72px, 10vh, 120px) 24px 0 clamp(24px, 6vw, 88px);
}
.av-corner-links a {
  width: fit-content;
  color: var(--av-muted);
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 600;
  line-height: 1.05;
  text-decoration: none;
}
.av-corner-links a em { font-style: normal; color: var(--av-mint); }
.av-corner-links a:hover,
.av-corner-links a:focus-visible,
.av-corner-links a[aria-current] { color: var(--av-paper); outline: none; }

.av-corner-socials {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.av-corner-socials a { display: grid; place-items: center; color: var(--av-paper); }
.av-corner-socials a:hover,
.av-corner-socials a:focus-visible { color: var(--av-mint); outline: none; }
.av-corner-socials svg { width: 20px; height: 20px; fill: currentColor; }
.av-corner-socials a:nth-child(1) { --i: 4; }
.av-corner-socials a:nth-child(2) { --i: 5; }
.av-corner-socials a:nth-child(3) { --i: 6; }

.av-corner-actions {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: calc(100% - 80px);
}
.av-corner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--av-mint-soft);
  border-radius: 999px;
  background: var(--av-mint-soft);
  color: var(--av-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
}
.av-corner-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--av-ease); }
.av-corner-pill:hover svg { transform: translateX(3px); }
.av-corner-pill-ghost:hover svg { transform: translateY(2px); }
.av-corner-pill:hover { background: #c9f3d5; border-color: #c9f3d5; }
.av-corner-pill:focus-visible { outline: 2px solid var(--av-paper); outline-offset: 3px; }
.av-corner-pill-ghost { background: transparent; border-color: rgba(246, 242, 233, 0.3); color: var(--av-paper); }
.av-corner-pill-ghost:hover { background: rgba(246, 242, 233, 0.1); }
.av-corner-actions a:nth-child(1) { --i: 4; }
.av-corner-actions a:nth-child(2) { --i: 5; }

html.av-corner-locked { overflow: hidden; }
.av-corner-label { display: none; }
/* The site dock would sit over the panel's bottom row while the menu is open. */
.av-dock { transition: opacity 0.3s var(--av-ease, ease); }
html.av-corner-locked .av-dock { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .av-corner-actions { flex-direction: column; align-items: flex-end; }
  .av-corner-pill { height: 42px; padding: 0 16px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .av-corner *, .av-corner-bg { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}

/*
 * Trial view (?menu=bottom): the menu replaces the dock at the bottom centre
 * and opens upward from there.
 */
html.av-menu-bottom .av-dock { display: none !important; }

.av-corner-bottom .av-corner-bg,
.av-corner-bottom .av-corner-toggle {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 20px;
  translate: -50% 0;
  width: 128px;
  height: 52px;
  border-radius: 999px;
}
.av-corner-bottom .av-corner-bg {
  transition: width 0.6s var(--av-ease), height 0.6s var(--av-ease), border-radius 0.6s var(--av-ease),
    bottom 0.6s var(--av-ease), scale 0.35s var(--av-ease), box-shadow 0.35s var(--av-ease);
}
.av-corner-bottom.av-open .av-corner-bg {
  bottom: 16px;
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  border-radius: 18px;
}
/* Hover: the pill lifts a little and its shadow deepens. */
.av-corner-bottom:not(.av-open):has(.av-corner-toggle:hover) .av-corner-bg {
  scale: 1.06;
  box-shadow: 0 2px 4px #17221c1f, 0 18px 40px #17221c33;
}
.av-corner-bottom .av-corner-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px 0 52px;
  color: var(--av-paper);
  font: 600 14px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.01em;
  transition: bottom 0.6s var(--av-ease), background 0.25s var(--av-ease);
}
.av-corner-bottom .av-corner-toggle:hover { background: transparent; }
.av-corner-bottom.av-open .av-corner-toggle { bottom: 36px; }
.av-corner-bottom.av-open .av-corner-toggle:hover { background: rgba(246, 242, 233, 0.1); }
.av-corner-bottom .av-corner-label { display: block; }
.av-corner-bottom .av-corner-toggle i { left: 24px; }
.av-corner-bottom .av-corner-toggle i:nth-child(1) { top: 19px; width: 18px; transform: none; }
.av-corner-bottom .av-corner-toggle i:nth-child(2) { top: 25px; width: 18px; transform: none; }
.av-corner-bottom .av-corner-toggle i:nth-child(3) { top: 31px; width: 10px; transform: none; }
.av-corner-bottom .av-corner-toggle:hover i:nth-child(3) { width: 18px; }
.av-corner-bottom.av-open .av-corner-toggle i:nth-child(1) { top: 25px; transform: rotate(45deg); }
.av-corner-bottom.av-open .av-corner-toggle i:nth-child(2) { top: 25px; transform: rotate(-45deg); }
.av-corner-bottom.av-open .av-corner-toggle i:nth-child(3) { top: 25px; width: 0; }

.av-corner-bottom .av-corner-panel { top: auto; bottom: 16px; }
/* Links rise from below, matching the direction the panel opens. */
.av-corner-bottom .av-corner-links a { transform: translateY(28px); }
.av-corner-bottom .av-corner-links a:hover,
.av-corner-bottom .av-corner-links a:focus-visible { translate: 12px 0; }
.av-corner-bottom .av-corner-links a { transition-property: opacity, transform, color, background, translate; }
.av-corner-bottom.av-open .av-corner-links a { transition-property: opacity, transform, color, background, translate; }
.av-corner-bottom .av-corner-links a em { display: inline-block; transition: transform 0.35s var(--av-ease); }
.av-corner-bottom .av-corner-links a:hover em { transform: scale(1.6); }
.av-corner-bottom .av-corner-socials a:hover { translate: 3px 0; }
.av-corner-bottom .av-corner-socials a { transition-property: opacity, transform, color, translate; }
.av-corner-bottom .av-corner-pill:hover { translate: 0 -2px; }
.av-corner-bottom .av-corner-pill { transition-property: opacity, transform, background, translate; }

@media (max-width: 640px) {
  /* Keep the toggle clear of the stacked buttons on narrow screens. */
  .av-corner-bottom .av-corner-actions { bottom: 92px; }
  .av-corner-bottom .av-corner-socials { bottom: 92px; }
}
/* The hover nudge runs at once; only the entrance waits for the stagger. */
.av-corner-bottom.av-open .av-corner-links a {
  transition-duration: 0.5s, 0.6s, 0.25s, 0.25s, 0.35s;
  transition-delay: calc(0.3s + var(--i, 0) * 0.07s), calc(0.3s + var(--i, 0) * 0.07s), 0s, 0s, 0s;
}
.av-corner-bottom.av-open .av-corner-socials a,
.av-corner-bottom.av-open .av-corner-pill {
  transition-duration: 0.5s, 0.6s, 0.25s, 0.3s;
  transition-delay: calc(0.3s + var(--i, 0) * 0.07s), calc(0.3s + var(--i, 0) * 0.07s), 0s, 0s;
}

/*
 * Playful palette: the homepage's cursor and ribbon colours. The button is
 * brand purple and turns into the cream canvas as it opens; each page link
 * has its own colour.
 */
.av-corner {
  --av-purple: #8427de;
  --av-green: #039754;
  --av-yellow: #f4ac28;
  --av-orange: #f78d36;
  --av-sky: #008ff0;
  --av-canvas: #fffdf8;
  --av-muted: rgba(23, 34, 28, 0.28);
}
.av-corner-bg {
  background: var(--av-purple);
  box-shadow: 0 2px 4px #8427de33, 0 14px 34px #8427de4d;
}
.av-corner .av-corner-bg { transition-property: width, height, border-radius, bottom, scale, box-shadow, background-color; transition-duration: 0.6s; }
.av-corner.av-open .av-corner-bg {
  background-color: var(--av-canvas);
  background-image: radial-gradient(#17221c1c 0.8px, transparent 0.8px);
  background-size: 24px 24px;
  box-shadow: 0 0 0 1px #17221c14, 0 30px 80px #17221c2e;
}
.av-corner.av-open .av-corner-toggle i { background: var(--av-ink); }
.av-corner.av-open .av-corner-toggle { color: var(--av-ink); }
.av-corner.av-open .av-corner-toggle:hover { background: #8427de14; }
.av-corner-toggle:focus-visible { outline-color: var(--av-purple); }

.av-corner-links a:nth-child(1) { --c: var(--av-purple); }
.av-corner-links a:nth-child(2) { --c: var(--av-green); }
.av-corner-links a:nth-child(3) { --c: var(--av-orange); }
.av-corner-links a:nth-child(4) { --c: var(--av-sky); }
.av-corner-links a { color: var(--av-muted); }
.av-corner-links a em { color: var(--c); }
.av-corner-links a:hover,
.av-corner-links a:focus-visible,
.av-corner-links a[aria-current] { color: var(--c); }

.av-corner-socials a { color: var(--av-ink); }
.av-corner-socials a:nth-child(1):hover { color: var(--av-ink); }
.av-corner-socials a:nth-child(2):hover { color: var(--av-purple); }
.av-corner-socials a:nth-child(3):hover { color: var(--av-sky); }

.av-corner-pill {
  border: 0;
  background: linear-gradient(110deg, var(--av-orange), var(--av-yellow));
  color: var(--av-ink);
  box-shadow: 0 8px 22px #f78d3640;
}
.av-corner-pill:hover { background: linear-gradient(110deg, #f57d1f, var(--av-yellow)); border-color: transparent; }
.av-corner-pill-ghost {
  background: var(--av-canvas);
  color: var(--av-ink);
  box-shadow: inset 0 0 0 1.5px var(--av-ink);
}
.av-corner-pill-ghost:hover { background: var(--av-purple); color: #fff; box-shadow: inset 0 0 0 1.5px var(--av-purple); }
.av-corner-pill:focus-visible { outline-color: var(--av-purple); }

/* Bottom view: purple pill with a brighter hover glow. */
.av-corner-bottom:not(.av-open):has(.av-corner-toggle:hover) .av-corner-bg { box-shadow: 0 4px 8px #8427de40, 0 20px 44px #8427de66; }

/* Moving ball (built in corner-nav.js). The full stops become round
   placeholders that only mark where the ball can land. */
.av-corner-links { position: relative; }
.av-corner-links a em {
  display: inline-block;
  width: 0.17em;
  height: 0.17em;
  margin-left: 0.05em;
  border-radius: 50%;
  font-size: inherit;
  color: transparent;
  overflow: hidden;
  visibility: hidden;
  vertical-align: baseline;
}
.av-corner-bottom .av-corner-links a:hover em { transform: none; }
.av-corner-ball {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 100%;
  transition: background-color 0.45s var(--av-ease), opacity 0.3s;
}
.av-corner.av-open .av-corner-ball { opacity: 1; transition-delay: 0s, 0.55s; }
.av-corner-ball.av-jump { transition: opacity 0.3s 0.55s; }
@media (prefers-reduced-motion: reduce) { .av-corner-ball { transition: none; } }
/* The ball is the hover cue now; links stay put so it lands exactly on them. */
.av-corner-bottom .av-corner-links a:hover,
.av-corner-bottom .av-corner-links a:focus-visible { translate: none; }
