/* Depth gauge (GRW-20). Sits in its own lane on the right: at wide widths the page content
   is padded so nothing runs under it. Narrow screens keep the small corner depth number. */

@media (min-width: 1200px) {
  html.ocean { --gauge-lane: 176px; }
  /* the same space on both sides, so the content sits in the middle of the screen */
  html.ocean body { padding-inline: var(--gauge-lane); }
  /* the top bar keeps its full-width backdrop */
  html.ocean .bar { margin-inline: calc(-1 * var(--gauge-lane)); padding-inline: var(--gauge-lane); }
  html.ocean .depth-pill { display: none; }

  html.ocean .spy {
    display: block !important; position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 40;
    width: 136px; height: min(64vh, 600px);
    --g-ink: var(--rds-ink); --g-quiet: #1F3A37; --g-line: rgba(23, 44, 45, .42); --g-pop: #C59B27; --g-on: #6A4E04; --g-halo: 0 0 4px rgba(236, 248, 245, .95), 0 0 12px rgba(236, 248, 245, .85);
  }
  html.ocean.is-deep-mid .spy { --g-ink: #F2F7F5; --g-quiet: #DCE8E5; --g-line: rgba(255, 255, 255, .42); --g-pop: #C59B27; --g-on: #F0C95A; --g-halo: 0 1px 3px rgba(2, 14, 18, .85), 0 0 12px rgba(2, 14, 18, .7); }
  html.ocean .spy ol { display: block; position: absolute; inset: 64px 22px 0 0; }
  html.ocean .spy li { position: absolute; right: 0; bottom: calc(var(--at, 0) * 100%); transform: translateY(50%); }
  html.ocean .spy a {
    display: flex; align-items: center; gap: 8px; padding: 4px 0; white-space: nowrap;
    font-size: .8rem; line-height: 1.2; font-weight: 500; color: var(--g-quiet); text-shadow: var(--g-halo); text-decoration: none; transition: color .4s ease;
  }
  html.ocean .spy a::after { content: ''; width: 8px; height: 1px; border-radius: 1px; background: var(--g-line); transition: width .25s ease, background-color .2s; }
  html.ocean .spy a:hover { color: var(--g-ink); }
  html.ocean .spy a[aria-current="true"] { color: var(--g-on); font-weight: 700; }
  html.ocean .spy a[aria-current="true"]::after { width: 14px; height: 2px; margin-block: -.5px; background: var(--g-pop); }

  .gauge-rail {
    position: absolute; right: 6px; top: 64px; bottom: 0; width: 2px; border-radius: 1px;
    background: linear-gradient(180deg, var(--rds-gold) 0, var(--g-line) 14%, var(--g-line) 100%);
  }
  .gauge-rail::before { content: ''; position: absolute; left: -7px; top: -1px; width: 16px; height: 2px; border-radius: 1px; background: var(--rds-gold); }
  .gauge-mark {
    position: absolute; left: -4px; bottom: calc(var(--gq, 0) * 100%); width: 10px; height: 10px; margin-bottom: -5px; border-radius: 50%;
    background: var(--g-pop); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-pop) 30%, transparent), 0 0 14px color-mix(in srgb, var(--g-pop) 70%, transparent);
    transition: background-color .4s ease;
  }
  .gauge-read { position: absolute; right: 0; top: 0; margin: 0; text-align: right; line-height: 1.2; font-family: var(--rds-mono); color: var(--g-ink); text-shadow: var(--g-halo); transition: color .4s ease; }
  .gauge-read small { display: block; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--g-quiet); }
  .gauge-read b { display: block; font-family: var(--rds-font); font-size: .86rem; font-weight: 600; white-space: nowrap; }
  .gauge-read i { display: block; font-style: normal; font-size: .68rem; color: var(--g-quiet); font-variant-numeric: tabular-nums; }

  /* The way up is the marker itself: a gold arrow node on the rail at the page's own height, so it rides up the
     gauge with the reader. It is the button. Its words sit over it, right-aligned to the rail, and show at the
     start (Start here) and at the last stop (Break the surface). The plain dot is under it and shows at the
     surface, when there is no further up to go. */
  html.ocean .spy .rise-next {
    position: absolute; right: -6px; bottom: calc((100% - 64px) * var(--gq, 0)); z-index: 2; translate: 0 50%;
    display: block; width: 26px; height: 26px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none;
    color: var(--g-on); font-size: .8rem; font-weight: 700; letter-spacing: 0; line-height: 1.2; text-shadow: var(--g-halo);
  }
  html.ocean .spy .rise-next[hidden] { display: none; }
  html.ocean .spy .rise-next::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; }   /* 44px hit area */
  html.ocean .spy .rise-next span { position: absolute; right: 0; bottom: calc(100% + 9px); white-space: nowrap; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
  html.ocean .spy .rise-next.has-word span { opacity: 1; }
  html.ocean .spy .rise-next.word-under span { bottom: auto; top: calc(100% + 9px); }
  html.ocean .spy .rise-next svg {
    display: block; box-sizing: border-box; width: 26px; height: 26px; padding: 6px; border-radius: 50%; background: #C59B27; stroke: #172C2D; stroke-width: 2.2;
    box-shadow: 0 0 0 3px color-mix(in srgb, #C59B27 28%, transparent), 0 2px 8px rgba(0, 0, 0, .35); transition: box-shadow .15s ease, scale .15s ease;
  }
  html.ocean .spy .rise-next:hover { box-shadow: none; }
  html.ocean .spy .rise-next:hover span, html.ocean .spy .rise-next:focus-visible span { opacity: 1; }
  html.ocean .spy .rise-next:hover svg { scale: 1.1; box-shadow: 0 0 0 3px color-mix(in srgb, #C59B27 45%, transparent), 0 0 0 6px var(--g-line), 0 2px 8px rgba(0, 0, 0, .35); }
  html.ocean .spy .rise-next:focus-visible { outline: 2px solid var(--g-on); outline-offset: 3px; }
  /* before the first press the node calls for it: a soft gold ring that keeps going out from it */
  html.ocean .spy .rise-next.is-calling svg { animation: gauge-call 1.9s ease-out infinite; }
  @keyframes gauge-call {
    0% { box-shadow: 0 0 0 0 rgba(197, 155, 39, .85), 0 2px 8px rgba(0, 0, 0, .35); }
    70%, 100% { box-shadow: 0 0 0 18px rgba(197, 155, 39, 0), 0 2px 8px rgba(0, 0, 0, .35); }
  }
  @media (prefers-reduced-motion: reduce) { html.ocean .spy .rise-next.is-calling svg { animation: none; } }
}
