/* MetOcean Consult, "Chart puzzle" concept: the home page. */
:root {
  --navy: #002E41;
  --ink: #002E41;
  --ink-2: rgba(0, 46, 65, .74);
  --ink-3: rgba(0, 46, 65, .5);
  --grey: #808080;
  --blue: #AACCFF;
  --tint: #EAF1FB;
  --rule: #CBD8E6;
  --paper: #FBFAF5;
  --paper-2: #F4F1E8;
  --land: #F1E9D6;
  --table: #0D2B39;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --lift: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  background: var(--table);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--paper); padding: .5em .8em; border: 1px solid var(--navy); }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- */
/* the viewport and the world                                       */
/* ---------------------------------------------------------------- */
.vp {
  position: fixed; inset: 0;
  overflow: hidden;
  touch-action: none;              /* pan and pinch are ours; the page itself never zooms or bounces */
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(120% 90% at 50% 40%, #16394a 0%, var(--table) 70%);
}
.vp:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--blue); }
.vp.is-dragging { cursor: grabbing; }
.world {
  position: absolute; left: 0; top: 0;
  width: 2400px; height: 1600px;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.world.is-ready { opacity: 1; }
.vp.is-moving .world { will-change: transform; }

/* the tray under the pieces: what shows through a hole */
.tray {
  position: absolute; inset: 0;
  background: #173847;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .3);
}
.tray::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--chart); background-size: 2400px 1600px;
  opacity: .1; filter: grayscale(1) contrast(1.4);
  mix-blend-mode: screen;
}
.board { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- */
/* pieces                                                           */
/* ---------------------------------------------------------------- */
.pc {
  position: absolute;
  margin: 0; padding: 0; border: 0; background: none;
  pointer-events: none;           /* the face takes the pointer, through its clip-path */
  transform: translate3d(0, 0, 0);
  transition: transform .38s var(--lift), filter .38s var(--lift);
  z-index: 1;
  color: inherit; font: inherit;
}
.pc-face {
  position: absolute; inset: 0;
  pointer-events: auto;
  cursor: pointer;
  background-image: var(--chart);
  background-size: 2400px 1600px;
  background-repeat: no-repeat;
  backface-visibility: hidden;
}
.pc-face img { position: absolute; pointer-events: none; }
.pc:focus-visible { z-index: 5; }
/* hover only where there is a real hover (no sticky lifted piece after a tap on a phone) */
@media (hover: hover) {
  .pc:hover { z-index: 5; }
  .pc:hover {
    transform: translate3d(-1px, -4px, 0);
    filter: drop-shadow(0 5px 6px rgba(0, 20, 30, .34)) drop-shadow(0 1px 1px rgba(0, 20, 30, .3));
  }
}
.pc:focus-visible {
  outline: none;
  transform: translate3d(-1px, -4px, 0);
  filter: drop-shadow(0 0 0 var(--navy)) drop-shadow(0 0 1.5px var(--navy)) drop-shadow(0 0 1.5px var(--navy)) drop-shadow(0 6px 8px rgba(0, 20, 30, .35));
}
.vp.is-dragging .pc:hover { transform: none; filter: none; }

/* a service piece is lifted out while its note is open */
.pc.is-lifted {
  z-index: 20;
  transform: translate3d(-10px, -16px, 0) rotate(-2deg) scale(1.06);
  filter: drop-shadow(0 22px 22px rgba(0, 16, 24, .42)) drop-shadow(0 3px 3px rgba(0, 16, 24, .3));
  transition: transform .55s var(--lift), filter .55s var(--lift);
}
.pc.is-dropping { transition: transform .42s cubic-bezier(.5, 0, .3, 1.35), filter .42s ease; }

/* a glossary piece turns over: it rotates edge-on, the card takes over */
.pc.is-turning { z-index: 20; transform: perspective(900px) rotateY(90deg) scale(1.05); transition: transform .2s ease-in; }

/* intro: pieces drop onto the table, a few start out of place */
.board.is-intro .pc { animation: drop .62s var(--lift) both; animation-delay: var(--d, 0ms); }
@keyframes drop {
  from { opacity: 0; transform: translate3d(0, -26px, 0) scale(1.04); filter: drop-shadow(0 18px 14px rgba(0, 16, 24, .3)); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; filter: none; }
}
.board.is-intro .pc.is-away { animation: fadein .5s ease both; animation-delay: var(--d, 0ms); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.pc.is-away {
  z-index: 8;
  transform: translate3d(var(--ax), var(--ay), 0) rotate(var(--ar));
  filter: drop-shadow(0 12px 12px rgba(0, 16, 24, .38)) drop-shadow(0 2px 2px rgba(0, 16, 24, .3));
}
.pc.is-homing { z-index: 8; transition: transform .95s cubic-bezier(.3, .1, .2, 1), filter .95s ease; }

/* ---------------------------------------------------------------- */
/* fixed furniture: Index, hint, zoom                               */
/* ---------------------------------------------------------------- */
.index-btn {
  position: fixed; right: 18px; top: 18px; z-index: 30;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: .5rem .85rem .55rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--navy);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--navy), 0 10px 24px rgba(0, 10, 20, .28);
  font: inherit; cursor: pointer; text-align: left;
}
.index-btn__t { font-family: var(--serif); font-size: 1.35rem; line-height: 1.05; font-weight: 500; }
.index-btn__s { font-size: .78rem; color: var(--ink-2); }
.index-btn:hover .index-btn__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }

.hint {
  position: fixed; left: 18px; bottom: 16px; z-index: 30; margin: 0;
  max-width: calc(100% - 140px);
  padding: .4rem .7rem;
  background: rgba(251, 250, 245, .94);
  border: 1px solid rgba(0, 46, 65, .35);
  font-size: .82rem; color: var(--ink-2);
  transition: opacity .6s ease;
}
.hint.is-gone { opacity: 0; pointer-events: none; }
.zoom { position: fixed; right: 18px; bottom: 16px; z-index: 30; display: flex; border: 1px solid rgba(0, 46, 65, .5); background: var(--paper); }
.zoom button {
  width: 38px; height: 34px; border: 0; background: none; cursor: pointer;
  font: 500 1.2rem/1 var(--sans); color: var(--ink);
}
.zoom button + button { border-left: 1px solid rgba(0, 46, 65, .3); }
.zoom button:hover { background: var(--tint); }

/* ---------------------------------------------------------------- */
/* the glossary card                                                */
/* ---------------------------------------------------------------- */
.card {
  position: fixed; left: 0; top: 0; z-index: 25;
  width: min(320px, calc(100vw - 32px));
  perspective: 900px;
  pointer-events: none;
}
.card__in {
  background: var(--paper);
  border: 1px solid var(--navy);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(0, 46, 65, .5), 0 24px 40px rgba(0, 16, 24, .38);
  padding: 1.05rem 1.2rem 1rem;
  transform: rotateY(-90deg);
  transition: transform .26s cubic-bezier(.2, .7, .3, 1);
  pointer-events: auto;
}
.card.is-in .card__in { transform: rotateY(0); }
.card__k { margin: 0 0 .2rem; font-size: .74rem; color: var(--ink-3); }
.card__t { margin: 0 0 .45rem; font-family: var(--serif); font-style: italic; font-size: 1.6rem; line-height: 1.1; }
.card__d { margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; }
.card__h { margin: .75rem 0 0; font-size: .74rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- */
/* the chart note (service panel) and the index                     */
/* ---------------------------------------------------------------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: transparent; }
.index::backdrop { background: rgba(5, 25, 35, .2); }
.shade { position: absolute; inset: -2px; z-index: 15; background: rgba(8, 30, 42, .26); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.board.is-shaded .shade { opacity: 1; }
.note h2:focus { outline: none; }
.note, .index {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(640px, 52vw); height: 100%;
  background: var(--paper);
  box-shadow: -1px 0 0 var(--navy), -6px 0 0 var(--paper), -7px 0 0 rgba(0, 46, 65, .45), -30px 0 60px rgba(0, 12, 20, .35);
  transform: translateX(104%);
  transition: transform .5s var(--lift);
}
.note.is-open, .index.is-open { transform: none; }
.note__scroll, .index__in { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 clamp(22px, 4vw, 56px) 64px; }
.note__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 18px 0 12px; margin-bottom: 8px;
  background: linear-gradient(var(--paper) 78%, rgba(251, 250, 245, 0));
  font-size: .82rem; color: var(--ink-2);
}
.note__close {
  font: inherit; font-size: .9rem; color: var(--ink);
  background: none; border: 1px solid rgba(0, 46, 65, .45); padding: .3rem .65rem; cursor: pointer;
}
.note__close:hover { background: var(--tint); }

.nb-head { display: grid; grid-template-columns: auto 1fr; gap: 0 22px; align-items: center; margin: 4px 0 26px; }
.nb-plate { width: 108px; height: 108px; position: relative; grid-row: span 2; }
.nb-plate .pc-face { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; cursor: default; filter: drop-shadow(0 6px 7px rgba(0, 16, 24, .28)); }
.nb-letter { font-family: var(--sans); font-weight: 600; font-size: .84rem; color: var(--ink-2); margin: 0 0 .1rem; display: flex; gap: .55em; align-items: center; }
.nb-letter b { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--navy); color: var(--paper); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--navy); font-weight: 600; }
.note h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.02; letter-spacing: -.01em; }
.nb-place { margin: .45rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--ink-2); grid-column: 2; align-self: start; }
.nb-head h2 { align-self: end; }
.nb-lede { font-family: var(--serif); font-size: 1.28rem; line-height: 1.45; margin: 0 0 1.6rem; max-width: 34em; }
.nb-body p { font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; margin: 0 0 1rem; max-width: 34em; }
.nb-sec { border-top: 1px solid var(--rule); padding-top: .9rem; margin-top: 1.2rem; }
.nb-sec h3 { margin: 0 0 .55rem; font-family: var(--sans); font-weight: 600; font-size: .95rem; }
.nb-sec ul { list-style: none; margin: 0; padding: 0; }
.nb-sec li { position: relative; padding-left: 1.2em; margin: 0 0 .42rem; line-height: 1.45; }
.nb-sec li::before { content: ""; position: absolute; left: .1em; top: .68em; width: .55em; height: 1px; background: var(--navy); }
.nb-q li { font-family: var(--serif); font-style: italic; font-size: 1.08rem; }
.nb-q li::before { content: "?"; width: auto; height: auto; background: none; top: 0; font-style: normal; font-family: var(--sans); font-size: .8rem; color: var(--ink-3); }
.nb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.nb-cols .nb-sec { margin-top: 1.2rem; }

.fig { margin: 1.8rem 0 0; }
.fig__plate {
  position: relative; aspect-ratio: 16 / 9;
  border: 1px solid rgba(0, 46, 65, .45);
  outline: 4px solid var(--paper); box-shadow: 0 0 0 5px rgba(0, 46, 65, .25);
}
.fig__plate { background: repeating-linear-gradient(0deg, rgba(0, 46, 65, .05) 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, rgba(0, 46, 65, .05) 0 1px, transparent 1px 24px), #FDFCF8; }
.fig__plate::before { content: ""; position: absolute; left: 12%; right: 6%; top: 10%; bottom: 16%; border-left: 1px solid rgba(0, 46, 65, .45); border-bottom: 1px solid rgba(0, 46, 65, .45); }
.fig__plate span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: .98rem; }
.fig__plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fig figcaption { margin-top: .6rem; font-size: .86rem; color: var(--ink-2); }
.fig figcaption b { font-weight: 600; color: var(--ink); }

.nb-contact { font-family: var(--serif); font-size: 1.5rem; line-height: 1.45; margin: .4rem 0 1.4rem; }
.nb-contact a { text-decoration-thickness: 1px; }
.nb-foot { margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--navy); display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; font-size: .9rem; }
.nb-foot button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; color: var(--ink); }
.nb-reach { margin-top: 1.2rem; font-size: .86rem; color: var(--ink-2); }

/* the index: a chart catalogue */
.index { width: min(560px, 52vw); }
.index h2 { font-family: var(--serif); font-weight: 400; font-size: 2.6rem; margin: .2rem 0 .3rem; line-height: 1; }
.index h2:focus { outline: none; }
.index__lede { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 1.2rem; color: var(--ink-2); max-width: 30em; }
.cat { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--navy); }
.cat li { border-bottom: 1px solid var(--rule); }
.cat a { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0 .6rem; padding: .62rem 0 .58rem; text-decoration: none; }
.cat a:hover .cat__t, .cat a:focus-visible .cat__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.cat__l { grid-row: span 2; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .1rem; border-radius: 50%; background: var(--navy); color: var(--paper); font-weight: 600; font-size: .82rem; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px rgba(0, 46, 65, .7); }
.cat__t { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.cat__p { font-family: var(--serif); font-style: italic; font-size: .92rem; color: var(--ink-2); }
.index__more { margin: 1.3rem 0 0; font-size: .92rem; }
.index__contact { margin: 1.3rem 0 0; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }

.noscript { position: fixed; inset: 0; z-index: 60; background: var(--paper); padding: 40px 24px; font-family: var(--serif); font-size: 1.2rem; }
.noscript img { width: 240px; height: auto; display: block; margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- */
/* small screens                                                    */
/* ---------------------------------------------------------------- */
@media (max-width: 760px) {
  .note, .index {
    inset: auto 0 0 0; width: 100%; height: 92%; height: 92dvh;
    transform: translateY(104%);
    box-shadow: 0 -1px 0 var(--navy), 0 -5px 0 var(--paper), 0 -6px 0 rgba(0, 46, 65, .45), 0 -30px 60px rgba(0, 12, 20, .4);
  }
  .note.is-open, .index.is-open { transform: none; }
  .note__scroll, .index__in { padding: 0 20px 48px; }
  .nb-head { grid-template-columns: auto 1fr; gap: 0 14px; }
  .nb-plate { width: 76px; height: 76px; }
  .nb-cols { grid-template-columns: 1fr; }
  .nb-lede { font-size: 1.16rem; }
  .index-btn {
    top: auto; bottom: 14px; left: 50%; right: auto; transform: translateX(-50%);
    flex-direction: row; align-items: baseline; gap: .55rem;
    padding: .7rem 1.2rem;
  }
  .index-btn__t { font-size: 1.3rem; }
  .hint { bottom: 76px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; font-size: .78rem; text-align: center; }
  .zoom { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
/* ?shot and reduced motion: everything is simply placed */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* track record line (e.g. weather risk software) */
.nb-track { margin: 0 0 1.6rem; padding: .7rem 0 .7rem 1rem; border-left: 2px solid var(--ink, #002E41); font-family: var(--serif); font-style: italic; }
.nb-track span { display: block; font-style: normal; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: .2rem; }

/* the zoom tip is for mouse users; phones get the short hint */
@media (max-width: 759px), (pointer: coarse) { .hint__d { display: none; } }

/* ---------------------------------------------------------------- */
/* H: phones and tablets                                            */
/* ---------------------------------------------------------------- */
button, a { touch-action: manipulation; }

/* while the chart is drawn: an empty sheet, its neatline being ruled */
.loading {
  position: fixed; inset: 0; z-index: 4;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  pointer-events: none;
  transition: opacity .5s ease;
}
.loading.is-done { opacity: 0; }
.loading__sheet {
  position: relative; width: min(62vw, 420px, 75vh); aspect-ratio: 3 / 2;
  border: 1px solid rgba(251, 250, 245, .55);
  box-shadow: 0 0 0 5px rgba(251, 250, 245, .04), 0 0 0 6px rgba(251, 250, 245, .3);
  overflow: hidden;
}
.loading__rule {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 1px;
  background: rgba(251, 250, 245, .5);
  transform-origin: 0 50%;
  animation: rule 1.6s cubic-bezier(.5, 0, .3, 1) infinite;
}
@keyframes rule { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.loading__t { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: rgba(251, 250, 245, .78); }
.loading__k { font-style: normal; font-family: var(--sans); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

/* the pilot route strip */
.route {
  position: fixed; z-index: 30;
  left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(460px, calc(100% - 24px));
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: stretch;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--navy);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--navy), 0 12px 28px rgba(0, 10, 20, .32);
  touch-action: none;             /* horizontal swipe steps along the route */
  user-select: none; -webkit-user-select: none;
}
.route[hidden] { display: none; }
.route button { font: inherit; color: inherit; background: none; border: 0; margin: 0; cursor: pointer; touch-action: none; }
.route__nav { min-height: 56px; font: 400 2rem/1 var(--serif) !important; padding: 0 0 4px !important; }
.route__nav:first-child { border-right: 1px solid var(--rule) !important; }
.route__nav:last-child { border-left: 1px solid var(--rule) !important; }
.route__nav:active, .route__cur:active { background: var(--tint) !important; }
.route__cur { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; padding: 6px 12px !important; text-align: left; min-width: 0; }
.route__l {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: var(--paper); font-weight: 600; font-size: .95rem;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--navy);
}
.route__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.route__k { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.route__t { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route__p { font-family: var(--serif); font-style: italic; font-size: .86rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the stop on the chart: a ring round its marker, one ping, the piece raised a little */
.route-ring {
  position: absolute; z-index: 19; width: 50px; height: 50px; margin: -25px 0 0 -25px;
  border-radius: 50%; border: 3px solid var(--blue);
  box-shadow: 0 0 0 1.5px var(--navy), inset 0 0 0 1.5px var(--navy);
  pointer-events: none;
}
.route-ring[hidden] { display: none; }
.route-ring.is-ping::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--blue);
  animation: ping 1.1s ease-out 2 both;
}
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
.pc.is-route { z-index: 6; transform: translate3d(-1px, -4px, 0); filter: drop-shadow(0 5px 6px rgba(0, 20, 30, .34)); }
.pc.is-route.is-lifted { z-index: 20; transform: translate3d(-10px, -16px, 0) rotate(-2deg) scale(1.06); }

/* with the route showing: the hint sits above the strip */
.route-on .hint { left: 50%; right: auto; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; text-align: center; }
/* phones: the strip takes the bottom, so the Index moves to the top right, compact */
@media (max-width: 760px) {
  .route-on .index-btn {
    top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; bottom: auto; left: auto; transform: none;
    padding: .45rem .8rem; min-height: 44px; gap: .45rem;
  }
  .route-on .index-btn__t { font-size: 1.15rem; }
  .route-on .index-btn__s { font-size: .74rem; }
}
/* landscape phones: little height, so everything is compact */
@media (max-height: 500px) {
  .index-btn { top: 10px; right: 12px; padding: .35rem .7rem .4rem; }
  .index-btn__t { font-size: 1.1rem; }
  .route { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: min(420px, calc(100% - 200px)); }
  .route__nav { min-height: 48px; }
  .route__cur { padding: 4px 10px !important; }
  .route__k { display: none; }
  .route-on .hint { display: none; }
  .zoom { bottom: 10px; right: 12px; }
  .note, .index { width: min(520px, 62vw); }
  .note__scroll, .index__in { padding: 0 24px 40px; }
  .note h2 { font-size: 1.8rem; }
  .nb-plate { width: 76px; height: 76px; }
  .nb-cols { grid-template-columns: 1fr; }
}

/* touch devices: nothing per piece that costs a filter on 96 elements */
@media (pointer: coarse), (max-width: 760px) {
  .tray::after { filter: none; mix-blend-mode: normal; opacity: .05; }
  .board.is-intro .pc { animation-name: drop-lite; }
  .pc { transition: transform .38s var(--lift); }
}
@keyframes drop-lite {
  from { opacity: 0; transform: translate3d(0, -26px, 0) scale(1.04); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}

/* the Index button steps aside while a note or the Index itself is open */
html:has(dialog.note[open], dialog.index[open]) .index-btn { opacity: 0; pointer-events: none; }
/* phones: a compact Index button, so it does not cover the title cartouche */
@media (max-width: 760px) { .route-on .index-btn__s { display: none; } }

/* back to the main site */
.home-btn {
  position: fixed; left: 18px; top: 18px; z-index: 30;
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  padding: .45rem .9rem;
  background: var(--paper); color: var(--ink); text-decoration: none;
  font: 500 .95rem/1 "Familjen Grotesk", system-ui, sans-serif;
  border: 1px solid var(--navy);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--navy), 0 10px 24px rgba(0, 10, 20, .28);
}
.home-btn:hover { background: var(--navy); color: var(--paper); }
.home-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; }
@media (max-width: 760px) {
  .home-btn { left: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); padding: .45rem .8rem; font-size: .9rem; }
}
html:has(dialog.note[open], dialog.index[open]) .home-btn { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- */
/* site header on top of the chart (same look as the rest of the site) */
/* ---------------------------------------------------------------- */
:root { --top: 97px; }
@media (max-width: 760px) { :root { --top: 73px; } }
.sitehead { position: fixed; left: 0; right: 0; top: 0; z-index: 40; height: var(--top); box-sizing: border-box;
  background: #fff; border-bottom: 1px solid #CBD8E6; font: 15px/1.75 Verdana, Geneva, "DejaVu Sans", sans-serif; }
.sitehead .wrap { max-width: 72rem; height: 100%; margin: 0 auto; padding: 0 1.5rem; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sitehead .brand img { display: block; width: 220px; height: auto; }
.sitehead .nav { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.sitehead .nav a { display: block; padding: .6rem .9rem; color: #002E41; text-decoration: none; }
.sitehead .nav a:hover, .sitehead .nav a[aria-current="page"] { color: #1A5F80; box-shadow: inset 0 -2px 0 #AACCFF; }
.sitehead a:focus-visible, .sitehead summary:focus-visible { outline: 2px solid #1A5F80; outline-offset: 3px; }
.sitehead .menu { display: none; }
@media (max-width: 760px) {
  .sitehead .brand img { width: 170px; }
  .sitehead nav.main { display: none; }
  .sitehead .menu { display: block; }
  .sitehead .menu summary { cursor: pointer; list-style: none; padding: .5rem .8rem; border: 1px solid #CBD8E6; color: #002E41; }
  .sitehead .menu summary::-webkit-details-marker { display: none; }
  .sitehead .menu[open] summary { background: #EAF1FB; }
  .sitehead .menu-list { position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: .5rem 1.5rem 1rem; list-style: none;
    background: #fff; border-bottom: 1px solid #CBD8E6; }
  .sitehead .menu-list a { display: block; padding: .55rem 0; color: #002E41; text-decoration: none; border-bottom: 1px solid #EAF1FB; }
}
/* everything of the chart starts below the header */
.vp, .loading { top: var(--top); }
.note, .index { top: var(--top); height: calc(100% - var(--top)); }
.index-btn { top: calc(var(--top) + 18px); }
@media (max-width: 760px) { .route-on .index-btn { top: calc(var(--top) + 12px); } }
.home-btn { display: none; }
