# Nautical chart buoy tooltip

> A nautical chart with soundings and buoys that flash in their real rhythm; each one explains its light and which side to pass.

- Category: [Tooltips](https://library.aimran.es/components/tooltips)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tip-nautical-buoys
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A sea chart drawn in SVG with depth soundings, dashed contour lines, a recommended track and a sandy coast with a lighthouse. The port and starboard buoys, the north cardinal and the light each flash in their own rhythm with CSS keyframes. Hover or focus one and a chart-style label names it, says how to pass it and shows its light code.

The main color sets the focus ring, the second the water. Change the light codes and their timing for a real harbor, or reuse the label style for dive sites, moorings or beach services on a coastal map.

## Code

### HTML

```html
<div class="uvq08-sea" role="group" aria-label="Lúa estuary"><div class="cht"><svg viewBox="0 0 100 70" aria-hidden="true"><path class="c10" d="M50 0C46 14 56 26 54 36S50 50 62 58S68 66 70 70"/><path class="c5" d="M62 0C58 12 66 22 66 30S60 44 72 50S78 62 80 70"/><path class="ld" d="M72 0H100V70H86C82 60 88 52 80 46S70 36 74 28S68 12 72 0Z"/><path class="tk" d="M8 68L38 59L54 46L66 38"/><text x="12" y="12">24</text><text x="30" y="48">18</text><text x="46" y="30">12</text><text x="60" y="62">7</text><text x="14" y="58">21</text><text x="40" y="8">15</text><text x="60" y="16">6</text><text x="7" y="40">27</text><text x="28" y="22">19</text><text x="48" y="70">9</text></svg><span class="ca" aria-hidden="true"><b>Lúa estuary</b><span>Soundings in meters</span></span><button type="button" class="by red up hc" style="left:38%;top:64%;--t:6s" aria-label="Port buoy" aria-describedby="uvq08-sea-0"><i class="sh" aria-hidden="true"></i><i class="lt f2" aria-hidden="true"></i><span class="tt" role="tooltip" id="uvq08-sea-0"><b>Port buoy</b><span>Keep it to your left when entering</span><code>Fl(2) R 6s</code></span></button><button type="button" class="by grn up hc" style="left:54%;top:50%;--t:4s" aria-label="Starboard buoy" aria-describedby="uvq08-sea-1"><i class="sh" aria-hidden="true"></i><i class="lt f1" aria-hidden="true"></i><span class="tt" role="tooltip" id="uvq08-sea-1"><b>Starboard buoy</b><span>Keep it to your right when entering</span><code>Fl G 4s</code></span></button><button type="button" class="by car dn hc" style="left:22%;top:34%;--t:1s" aria-label="North cardinal" aria-describedby="uvq08-sea-2"><i class="sh" aria-hidden="true"></i><i class="lt q" aria-hidden="true"></i><span class="tt" role="tooltip" id="uvq08-sea-2"><b>North cardinal</b><span>Pass on its north side</span><code>Q</code></span></button><button type="button" class="by lh dn hr pk" style="left:84%;top:24%;--t:10s" aria-label="Punta Lúa lighthouse" aria-describedby="uvq08-sea-3"><i class="sh" aria-hidden="true"></i><i class="lt f3" aria-hidden="true"></i><span class="tt" role="tooltip" id="uvq08-sea-3"><b>Punta Lúa lighthouse</b><span>Visible from 18 miles</span><code>Fl(3) W 10s</code></span></button></div></div>
```

### CSS

```css
.uvq08-sea {
  --c1: #0e7490;
  --c2: #cfe8f3;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq08-sea {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}

.uvq08-sea .cht {
  position: relative;
  width: 18em;
  height: 12.6em;
  border-radius: .6em;
  background: radial-gradient(60% 70% at 100% 40%,color-mix(in srgb,var(--c2) 40%,#fff),transparent 70%),var(--c2);
  box-shadow: inset 0 0 0 .3em #fffef8,inset 0 0 0 calc(.3em + 1px) #1d3557,0 1.2em 2em -1em rgba(0,0,0,.5);
}

.uvq08-sea svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.uvq08-sea .c10,.uvq08-sea .c5 {
  fill: none;
  stroke: #1d3557;
  stroke-width: .35;
  stroke-dasharray: 1.5 1;
  opacity: .55;
}

.uvq08-sea .c5 {
  stroke-dasharray: .6 .8;
}

.uvq08-sea .ld {
  fill: #f1e2b6;
  stroke: #6b5b3a;
  stroke-width: .5;
}

.uvq08-sea .tk {
  fill: none;
  stroke: #1d3557;
  stroke-width: .4;
  stroke-dasharray: 2 1.2;
}

.uvq08-sea text {
  fill: #1d3557;
  font: italic 3.2px/1 Georgia,"Times New Roman",serif;
  opacity: .75;
}

.uvq08-sea .ca {
  position: absolute;
  left: .8em;
  top: .75em;
  display: grid;
  padding: .3em .55em;
  border: 1px solid #1d3557;
  font-family: Georgia,"Times New Roman",serif;
  color: #1d3557;
  background: rgba(255,254,248,.8);
}

.uvq08-sea .ca b {
  font-style: italic;
  font-size: .9em;
}

.uvq08-sea .ca span {
  font-size: .55em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq08-sea .by {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  translate: -50% -50%;
  border-radius: 50%;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .by:hover,.uvq08-sea .by.pk {
  background: rgba(255,255,255,.35);
}

.uvq08-sea .by:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-sea .by:active .sh {
  transform: scale(.88);
}

.uvq08-sea .sh {
  display: block;
  width: .8em;
  height: 1em;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-sea .red .sh {
  border-radius: .15em;
  background: linear-gradient(90deg,#9b1c1c,#e53e3e 45%,#9b1c1c);
  box-shadow: 0 .1em 0 #5a1010;
}

.uvq08-sea .grn .sh {
  clip-path: polygon(50% 0,100% 100%,0 100%);
  background: linear-gradient(90deg,#14532d,#22a35a 45%,#14532d);
}

.uvq08-sea .car .sh {
  width: .7em;
  height: 1.15em;
  border-radius: .1em;
  background: linear-gradient(#111 0 50%,#facc15 50%);
}

.uvq08-sea .lh .sh {
  width: .75em;
  height: 1.2em;
  clip-path: polygon(25% 0,75% 0,100% 100%,0 100%);
  background: linear-gradient(#fff 0 30%,#d62828 30% 50%,#fff 50% 75%,#d62828 75%);
}

.uvq08-sea .lt {
  position: absolute;
  left: 50%;
  top: .05em;
  width: .45em;
  height: .45em;
  translate: -50% 0;
  border-radius: 50%;
  opacity: .15;
  animation: var(--a) var(--t) steps(1,end) infinite;
}

.uvq08-sea .red .lt {
  background: #ff4d4d;
  box-shadow: 0 0 .5em .2em #ff4d4d;
}

.uvq08-sea .grn .lt {
  background: #4ade80;
  box-shadow: 0 0 .5em .2em #4ade80;
}

.uvq08-sea .car .lt {
  background: #fff;
  box-shadow: 0 0 .5em .2em #fff7c2;
}

.uvq08-sea .lh .lt {
  top: -.25em;
  background: #fff7c2;
  box-shadow: 0 0 .8em .35em #ffe08a;
}

.uvq08-sea .f1 {
  --a: uvq08-sea-f1;
}

.uvq08-sea .f2 {
  --a: uvq08-sea-f2;
}

.uvq08-sea .f3 {
  --a: uvq08-sea-f3;
}

.uvq08-sea .q {
  --a: uvq08-sea-q;
}

.uvq08-sea .tt {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: .15em;
  width: max-content;
  max-width: 11em;
  padding: .5em .7em;
  border: 1px solid #1d3557;
  border-radius: .2em;
  font-size: .72em;
  line-height: 1.3;
  text-align: left;
  color: #1d3557;
  background: #fffef8;
  box-shadow: .3em .3em 0 rgba(29,53,87,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .tt b {
  font: italic 700 1.1em/1.2 Georgia,"Times New Roman",serif;
}

.uvq08-sea .tt code {
  justify-self: start;
  margin-top: .15em;
  padding: .1em .4em;
  border-radius: .2em;
  font: 700 .92em/1.3 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1d3557;
}

.uvq08-sea .up .tt {
  bottom: calc(100% + .1em);
}

.uvq08-sea .dn .tt {
  top: calc(100% + .1em);
}

.uvq08-sea .hc .tt {
  left: 50%;
  translate: -50% 0;
}

.uvq08-sea .hr .tt {
  right: 0;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) {
  z-index: 4;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .tt {
  opacity: 1;
  visibility: visible;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .lt {
  scale: 1.5;
}

@keyframes uvq08-sea-f1 {
  0% {
    opacity: 1;
  }
  8% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f2 {
  0% {
    opacity: 1;
  }
  6% {
    opacity: .15;
  }
  12% {
    opacity: 1;
  }
  18% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f3 {
  0% {
    opacity: 1;
  }
  4% {
    opacity: .15;
  }
  9% {
    opacity: 1;
  }
  13% {
    opacity: .15;
  }
  18% {
    opacity: 1;
  }
  22% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-q {
  0% {
    opacity: 1;
  }
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-sea,.uvq08-sea *,.uvq08-sea *::before,.uvq08-sea *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq08-sea").forEach(el => {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-sea {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}

.uvq08-sea .cht {
  position: relative;
  width: 18em;
  height: 12.6em;
  border-radius: .6em;
  background: radial-gradient(60% 70% at 100% 40%,color-mix(in srgb,var(--c2) 40%,#fff),transparent 70%),var(--c2);
  box-shadow: inset 0 0 0 .3em #fffef8,inset 0 0 0 calc(.3em + 1px) #1d3557,0 1.2em 2em -1em rgba(0,0,0,.5);
}

.uvq08-sea svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.uvq08-sea .c10,.uvq08-sea .c5 {
  fill: none;
  stroke: #1d3557;
  stroke-width: .35;
  stroke-dasharray: 1.5 1;
  opacity: .55;
}

.uvq08-sea .c5 {
  stroke-dasharray: .6 .8;
}

.uvq08-sea .ld {
  fill: #f1e2b6;
  stroke: #6b5b3a;
  stroke-width: .5;
}

.uvq08-sea .tk {
  fill: none;
  stroke: #1d3557;
  stroke-width: .4;
  stroke-dasharray: 2 1.2;
}

.uvq08-sea text {
  fill: #1d3557;
  font: italic 3.2px/1 Georgia,"Times New Roman",serif;
  opacity: .75;
}

.uvq08-sea .ca {
  position: absolute;
  left: .8em;
  top: .75em;
  display: grid;
  padding: .3em .55em;
  border: 1px solid #1d3557;
  font-family: Georgia,"Times New Roman",serif;
  color: #1d3557;
  background: rgba(255,254,248,.8);
}

.uvq08-sea .ca b {
  font-style: italic;
  font-size: .9em;
}

.uvq08-sea .ca span {
  font-size: .55em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq08-sea .by {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  translate: -50% -50%;
  border-radius: 50%;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .by:hover,.uvq08-sea .by.pk {
  background: rgba(255,255,255,.35);
}

.uvq08-sea .by:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-sea .by:active .sh {
  transform: scale(.88);
}

.uvq08-sea .sh {
  display: block;
  width: .8em;
  height: 1em;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-sea .red .sh {
  border-radius: .15em;
  background: linear-gradient(90deg,#9b1c1c,#e53e3e 45%,#9b1c1c);
  box-shadow: 0 .1em 0 #5a1010;
}

.uvq08-sea .grn .sh {
  clip-path: polygon(50% 0,100% 100%,0 100%);
  background: linear-gradient(90deg,#14532d,#22a35a 45%,#14532d);
}

.uvq08-sea .car .sh {
  width: .7em;
  height: 1.15em;
  border-radius: .1em;
  background: linear-gradient(#111 0 50%,#facc15 50%);
}

.uvq08-sea .lh .sh {
  width: .75em;
  height: 1.2em;
  clip-path: polygon(25% 0,75% 0,100% 100%,0 100%);
  background: linear-gradient(#fff 0 30%,#d62828 30% 50%,#fff 50% 75%,#d62828 75%);
}

.uvq08-sea .lt {
  position: absolute;
  left: 50%;
  top: .05em;
  width: .45em;
  height: .45em;
  translate: -50% 0;
  border-radius: 50%;
  opacity: .15;
  animation: var(--a) var(--t) steps(1,end) infinite;
}

.uvq08-sea .red .lt {
  background: #ff4d4d;
  box-shadow: 0 0 .5em .2em #ff4d4d;
}

.uvq08-sea .grn .lt {
  background: #4ade80;
  box-shadow: 0 0 .5em .2em #4ade80;
}

.uvq08-sea .car .lt {
  background: #fff;
  box-shadow: 0 0 .5em .2em #fff7c2;
}

.uvq08-sea .lh .lt {
  top: -.25em;
  background: #fff7c2;
  box-shadow: 0 0 .8em .35em #ffe08a;
}

.uvq08-sea .f1 {
  --a: uvq08-sea-f1;
}

.uvq08-sea .f2 {
  --a: uvq08-sea-f2;
}

.uvq08-sea .f3 {
  --a: uvq08-sea-f3;
}

.uvq08-sea .q {
  --a: uvq08-sea-q;
}

.uvq08-sea .tt {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: .15em;
  width: max-content;
  max-width: 11em;
  padding: .5em .7em;
  border: 1px solid #1d3557;
  border-radius: .2em;
  font-size: .72em;
  line-height: 1.3;
  text-align: left;
  color: #1d3557;
  background: #fffef8;
  box-shadow: .3em .3em 0 rgba(29,53,87,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .tt b {
  font: italic 700 1.1em/1.2 Georgia,"Times New Roman",serif;
}

.uvq08-sea .tt code {
  justify-self: start;
  margin-top: .15em;
  padding: .1em .4em;
  border-radius: .2em;
  font: 700 .92em/1.3 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1d3557;
}

.uvq08-sea .up .tt {
  bottom: calc(100% + .1em);
}

.uvq08-sea .dn .tt {
  top: calc(100% + .1em);
}

.uvq08-sea .hc .tt {
  left: 50%;
  translate: -50% 0;
}

.uvq08-sea .hr .tt {
  right: 0;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) {
  z-index: 4;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .tt {
  opacity: 1;
  visibility: visible;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .lt {
  scale: 1.5;
}

@keyframes uvq08-sea-f1 {
  0% {
    opacity: 1;
  }
  8% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f2 {
  0% {
    opacity: 1;
  }
  6% {
    opacity: .15;
  }
  12% {
    opacity: 1;
  }
  18% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f3 {
  0% {
    opacity: 1;
  }
  4% {
    opacity: .15;
  }
  9% {
    opacity: 1;
  }
  13% {
    opacity: .15;
  }
  18% {
    opacity: 1;
  }
  22% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-q {
  0% {
    opacity: 1;
  }
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-sea,.uvq08-sea *,.uvq08-sea *::before,.uvq08-sea *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipNauticalBuoys() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0e7490",
          "--c2": "#cfe8f3",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-sea" role="group" aria-label="Lúa estuary"><div className="cht"><svg viewBox="0 0 100 70" aria-hidden="true"><path className="c10" d="M50 0C46 14 56 26 54 36S50 50 62 58S68 66 70 70" /><path className="c5" d="M62 0C58 12 66 22 66 30S60 44 72 50S78 62 80 70" /><path className="ld" d="M72 0H100V70H86C82 60 88 52 80 46S70 36 74 28S68 12 72 0Z" /><path className="tk" d="M8 68L38 59L54 46L66 38" /><text x="12" y="12">24</text><text x="30" y="48">18</text><text x="46" y="30">12</text><text x="60" y="62">7</text><text x="14" y="58">21</text><text x="40" y="8">15</text><text x="60" y="16">6</text><text x="7" y="40">27</text><text x="28" y="22">19</text><text x="48" y="70">9</text></svg><span className="ca" aria-hidden="true"><b>Lúa estuary</b><span>Soundings in meters</span></span><button type="button" className="by red up hc" style={{ left: "38%", top: "64%", "--t": "6s" } as CSSProperties} aria-label="Port buoy" aria-describedby="uvq08-sea-0"><i className="sh" aria-hidden="true"></i><i className="lt f2" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-0"><b>Port buoy</b><span>Keep it to your left when entering</span><code>Fl(2) R 6s</code></span></button><button type="button" className="by grn up hc" style={{ left: "54%", top: "50%", "--t": "4s" } as CSSProperties} aria-label="Starboard buoy" aria-describedby="uvq08-sea-1"><i className="sh" aria-hidden="true"></i><i className="lt f1" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-1"><b>Starboard buoy</b><span>Keep it to your right when entering</span><code>Fl G 4s</code></span></button><button type="button" className="by car dn hc" style={{ left: "22%", top: "34%", "--t": "1s" } as CSSProperties} aria-label="North cardinal" aria-describedby="uvq08-sea-2"><i className="sh" aria-hidden="true"></i><i className="lt q" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-2"><b>North cardinal</b><span>Pass on its north side</span><code>Q</code></span></button><button type="button" className="by lh dn hr pk" style={{ left: "84%", top: "24%", "--t": "10s" } as CSSProperties} aria-label="Punta Lúa lighthouse" aria-describedby="uvq08-sea-3"><i className="sh" aria-hidden="true"></i><i className="lt f3" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-3"><b>Punta Lúa lighthouse</b><span>Visible from 18 miles</span><code>Fl(3) W 10s</code></span></button></div></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Nautical chart buoy tooltip” block (Tooltips) from AIMRAN Library to my project.

## What it is
A nautical chart with soundings and buoys that flash in their real rhythm; each one explains its light and which side to pass.

## Chosen settings
- Main color: #0e7490
- Secondary color: #cfe8f3
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Ría de Lúa"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-sea {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}

.uvq08-sea .cht {
  position: relative;
  width: 18em;
  height: 12.6em;
  border-radius: .6em;
  background: radial-gradient(60% 70% at 100% 40%,color-mix(in srgb,var(--c2) 40%,#fff),transparent 70%),var(--c2);
  box-shadow: inset 0 0 0 .3em #fffef8,inset 0 0 0 calc(.3em + 1px) #1d3557,0 1.2em 2em -1em rgba(0,0,0,.5);
}

.uvq08-sea svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.uvq08-sea .c10,.uvq08-sea .c5 {
  fill: none;
  stroke: #1d3557;
  stroke-width: .35;
  stroke-dasharray: 1.5 1;
  opacity: .55;
}

.uvq08-sea .c5 {
  stroke-dasharray: .6 .8;
}

.uvq08-sea .ld {
  fill: #f1e2b6;
  stroke: #6b5b3a;
  stroke-width: .5;
}

.uvq08-sea .tk {
  fill: none;
  stroke: #1d3557;
  stroke-width: .4;
  stroke-dasharray: 2 1.2;
}

.uvq08-sea text {
  fill: #1d3557;
  font: italic 3.2px/1 Georgia,"Times New Roman",serif;
  opacity: .75;
}

.uvq08-sea .ca {
  position: absolute;
  left: .8em;
  top: .75em;
  display: grid;
  padding: .3em .55em;
  border: 1px solid #1d3557;
  font-family: Georgia,"Times New Roman",serif;
  color: #1d3557;
  background: rgba(255,254,248,.8);
}

.uvq08-sea .ca b {
  font-style: italic;
  font-size: .9em;
}

.uvq08-sea .ca span {
  font-size: .55em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq08-sea .by {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  translate: -50% -50%;
  border-radius: 50%;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .by:hover,.uvq08-sea .by.pk {
  background: rgba(255,255,255,.35);
}

.uvq08-sea .by:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq08-sea .by:active .sh {
  transform: scale(.88);
}

.uvq08-sea .sh {
  display: block;
  width: .8em;
  height: 1em;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-sea .red .sh {
  border-radius: .15em;
  background: linear-gradient(90deg,#9b1c1c,#e53e3e 45%,#9b1c1c);
  box-shadow: 0 .1em 0 #5a1010;
}

.uvq08-sea .grn .sh {
  clip-path: polygon(50% 0,100% 100%,0 100%);
  background: linear-gradient(90deg,#14532d,#22a35a 45%,#14532d);
}

.uvq08-sea .car .sh {
  width: .7em;
  height: 1.15em;
  border-radius: .1em;
  background: linear-gradient(#111 0 50%,#facc15 50%);
}

.uvq08-sea .lh .sh {
  width: .75em;
  height: 1.2em;
  clip-path: polygon(25% 0,75% 0,100% 100%,0 100%);
  background: linear-gradient(#fff 0 30%,#d62828 30% 50%,#fff 50% 75%,#d62828 75%);
}

.uvq08-sea .lt {
  position: absolute;
  left: 50%;
  top: .05em;
  width: .45em;
  height: .45em;
  translate: -50% 0;
  border-radius: 50%;
  opacity: .15;
  animation: var(--a) var(--t) steps(1,end) infinite;
}

.uvq08-sea .red .lt {
  background: #ff4d4d;
  box-shadow: 0 0 .5em .2em #ff4d4d;
}

.uvq08-sea .grn .lt {
  background: #4ade80;
  box-shadow: 0 0 .5em .2em #4ade80;
}

.uvq08-sea .car .lt {
  background: #fff;
  box-shadow: 0 0 .5em .2em #fff7c2;
}

.uvq08-sea .lh .lt {
  top: -.25em;
  background: #fff7c2;
  box-shadow: 0 0 .8em .35em #ffe08a;
}

.uvq08-sea .f1 {
  --a: uvq08-sea-f1;
}

.uvq08-sea .f2 {
  --a: uvq08-sea-f2;
}

.uvq08-sea .f3 {
  --a: uvq08-sea-f3;
}

.uvq08-sea .q {
  --a: uvq08-sea-q;
}

.uvq08-sea .tt {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: .15em;
  width: max-content;
  max-width: 11em;
  padding: .5em .7em;
  border: 1px solid #1d3557;
  border-radius: .2em;
  font-size: .72em;
  line-height: 1.3;
  text-align: left;
  color: #1d3557;
  background: #fffef8;
  box-shadow: .3em .3em 0 rgba(29,53,87,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-sea .tt b {
  font: italic 700 1.1em/1.2 Georgia,"Times New Roman",serif;
}

.uvq08-sea .tt code {
  justify-self: start;
  margin-top: .15em;
  padding: .1em .4em;
  border-radius: .2em;
  font: 700 .92em/1.3 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1d3557;
}

.uvq08-sea .up .tt {
  bottom: calc(100% + .1em);
}

.uvq08-sea .dn .tt {
  top: calc(100% + .1em);
}

.uvq08-sea .hc .tt {
  left: 50%;
  translate: -50% 0;
}

.uvq08-sea .hr .tt {
  right: 0;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) {
  z-index: 4;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .tt {
  opacity: 1;
  visibility: visible;
}

.uvq08-sea .by:is(:hover,:focus-visible,.pk) .lt {
  scale: 1.5;
}

@keyframes uvq08-sea-f1 {
  0% {
    opacity: 1;
  }
  8% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f2 {
  0% {
    opacity: 1;
  }
  6% {
    opacity: .15;
  }
  12% {
    opacity: 1;
  }
  18% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-f3 {
  0% {
    opacity: 1;
  }
  4% {
    opacity: .15;
  }
  9% {
    opacity: 1;
  }
  13% {
    opacity: .15;
  }
  18% {
    opacity: 1;
  }
  22% {
    opacity: .15;
  }
}

@keyframes uvq08-sea-q {
  0% {
    opacity: 1;
  }
  50% {
    opacity: .15;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-sea,.uvq08-sea *,.uvq08-sea *::before,.uvq08-sea *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipNauticalBuoys() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0e7490",
          "--c2": "#cfe8f3",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-sea" role="group" aria-label="Lúa estuary"><div className="cht"><svg viewBox="0 0 100 70" aria-hidden="true"><path className="c10" d="M50 0C46 14 56 26 54 36S50 50 62 58S68 66 70 70" /><path className="c5" d="M62 0C58 12 66 22 66 30S60 44 72 50S78 62 80 70" /><path className="ld" d="M72 0H100V70H86C82 60 88 52 80 46S70 36 74 28S68 12 72 0Z" /><path className="tk" d="M8 68L38 59L54 46L66 38" /><text x="12" y="12">24</text><text x="30" y="48">18</text><text x="46" y="30">12</text><text x="60" y="62">7</text><text x="14" y="58">21</text><text x="40" y="8">15</text><text x="60" y="16">6</text><text x="7" y="40">27</text><text x="28" y="22">19</text><text x="48" y="70">9</text></svg><span className="ca" aria-hidden="true"><b>Lúa estuary</b><span>Soundings in meters</span></span><button type="button" className="by red up hc" style={{ left: "38%", top: "64%", "--t": "6s" } as CSSProperties} aria-label="Port buoy" aria-describedby="uvq08-sea-0"><i className="sh" aria-hidden="true"></i><i className="lt f2" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-0"><b>Port buoy</b><span>Keep it to your left when entering</span><code>Fl(2) R 6s</code></span></button><button type="button" className="by grn up hc" style={{ left: "54%", top: "50%", "--t": "4s" } as CSSProperties} aria-label="Starboard buoy" aria-describedby="uvq08-sea-1"><i className="sh" aria-hidden="true"></i><i className="lt f1" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-1"><b>Starboard buoy</b><span>Keep it to your right when entering</span><code>Fl G 4s</code></span></button><button type="button" className="by car dn hc" style={{ left: "22%", top: "34%", "--t": "1s" } as CSSProperties} aria-label="North cardinal" aria-describedby="uvq08-sea-2"><i className="sh" aria-hidden="true"></i><i className="lt q" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-2"><b>North cardinal</b><span>Pass on its north side</span><code>Q</code></span></button><button type="button" className="by lh dn hr pk" style={{ left: "84%", top: "24%", "--t": "10s" } as CSSProperties} aria-label="Punta Lúa lighthouse" aria-describedby="uvq08-sea-3"><i className="sh" aria-hidden="true"></i><i className="lt f3" aria-hidden="true"></i><span className="tt" role="tooltip" id="uvq08-sea-3"><b>Punta Lúa lighthouse</b><span>Visible from 18 miles</span><code>Fl(3) W 10s</code></span></button></div></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
