/* /kvarner-3d/: the scroll story and the tables under it. Only this page loads it. */
/* The skip link and the buttons jump past the story instead of playing it through. */
html { scroll-behavior: auto !important; }
.k3d-stage {
  --k3d-gutter: calc((100vw - var(--page, calc(100vw - 48px))) / 2);
  position: relative;
  margin-top: -74px; /* slides under the floating pill header */
  background: var(--rp-ink, #0c0d0b);
  color: var(--rp-paper, #f3efe4);
}
.k3d-stage.is-story { height: 620vh; }
.k3d-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.k3d-stage.is-story .k3d-sticky { cursor: grab; }
.k3d-sticky.is-drag { cursor: grabbing; }
.k3d-sticky picture { display: contents; }
.k3d-poster, .k3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.k3d-poster { object-fit: cover; }
.k3d-canvas { opacity: 0; transition: opacity 1.1s ease; touch-action: pan-y; }
.k3d-stage[data-state="live"] .k3d-canvas { opacity: 1; }
.k3d-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 13, 11, .82), rgba(12, 13, 11, 0) 60%),
    linear-gradient(0deg, rgba(12, 13, 11, .86), rgba(12, 13, 11, 0) 30%),
    linear-gradient(180deg, rgba(12, 13, 11, .6), rgba(12, 13, 11, 0) 18%);
}

.k3d-copy {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 104px var(--k3d-gutter) 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
  transition: opacity .5s ease, transform .7s ease;
}
.k3d-copy a { pointer-events: auto; }
.k3d-copy.off { opacity: 0; transform: translateY(-24px); }
.k3d-copy.off a { pointer-events: none; }
.k3d-copy .breadcrumbs { position: absolute; top: 96px; margin: 0; color: rgba(243, 239, 228, .72); }
.k3d-copy .section-subtitle { display: inline-flex; align-items: center; gap: 10px; }
.k3d-copy .section-subtitle::before { width: 28px; height: 2px; content: ""; background: var(--rp-coral, #ff5c7a); }
.k3d-copy h1 {
  margin: 16px 0 0;
  color: var(--rp-paper, #f3efe4);
  font: 800 clamp(2.3rem, 10.6vw, 7rem)/.98 "RP Syne", sans-serif;
  letter-spacing: -.075em;
  text-transform: uppercase;
  overflow-wrap: normal;
}
.k3d-copy h1 span { display: block; color: var(--rp-acid, #08c4e8); }
.k3d-lead { max-width: 560px; margin: 22px 0 0; color: #d8d5ca; font-size: clamp(1rem, 1.45vw, 1.18rem); line-height: 1.65; }
.k3d-if-story { display: none; }
.is-story .k3d-if-story { display: inline; }
.k3d-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.k3d-btn {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--rp-line, rgba(243, 239, 228, .14));
  border-radius: 999px;
  background: rgba(12, 13, 11, .55);
  color: var(--rp-paper, #f3efe4);
  font-size: .78rem;
  font-weight: 800;
  transition: transform .2s, background .2s, border-color .2s;
}
.k3d-btn:hover { border-color: var(--rp-cyan, #7ce5ff); }
.k3d-btn.is-primary { border-color: var(--rp-cyan, #7ce5ff); background: var(--rp-cyan, #7ce5ff); color: var(--rp-ink, #0c0d0b); }
.k3d-btn.is-primary:hover { background: #45d5ef; transform: translateY(-1px); }

.k3d-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.k3d-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 11px;
  border: 1px solid var(--rp-line, rgba(243, 239, 228, .14));
  border-radius: 999px;
  background: rgba(12, 13, 11, .78);
  color: var(--rp-paper, #f3efe4);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .35s;
}
.k3d-label b { color: var(--rp-cyan, #7ce5ff); font-weight: 800; font-variant-numeric: tabular-nums; }

.k3d-steps p {
  position: absolute;
  z-index: 3;
  left: var(--k3d-gutter);
  top: 50%;
  max-width: min(600px, calc(100vw - 48px));
  margin: 0;
  color: var(--rp-paper, #f3efe4);
  font: 800 clamp(1.7rem, 4.2vw, 3.3rem)/1.02 "RP Syne", sans-serif;
  letter-spacing: -.05em;
  text-transform: uppercase;
  text-shadow: 0 4px 40px rgba(12, 13, 11, .9);
  opacity: 0;
  transform: translateY(calc(-50% + 22px));
  transition: opacity .55s ease, transform .8s ease;
  pointer-events: none;
}
.k3d-steps p.on { opacity: 1; transform: translateY(-50%); }
.k3d-steps small {
  display: block;
  margin-top: 14px;
  color: #d8d5ca;
  font: 500 clamp(1rem, 1.5vw, 1.15rem)/1.5 "RP Jakarta", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
@media (pointer: coarse) { .k3d-for-mouse { display: none; } }

.k3d-hud {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 var(--k3d-gutter) max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 36px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s, transform .7s ease;
  pointer-events: none;
}
.k3d-stage.show-hud .k3d-hud { opacity: 1; transform: none; }
.k3d-month { min-width: 11ch; font: 800 clamp(1.1rem, 2.4vw, 1.8rem)/1.05 "RP Syne", sans-serif; letter-spacing: -.04em; text-transform: uppercase; }
.k3d-hud dl { margin: 0; display: flex; gap: 28px; }
.k3d-hud dt { color: var(--rp-cyan, #7ce5ff); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.k3d-hud dd { margin: 4px 0 0; font: 800 clamp(1.3rem, 2.6vw, 2rem)/1 "RP Syne", sans-serif; font-variant-numeric: tabular-nums; }
.k3d-legend { margin: 0 0 2px auto; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; color: #d8d5ca; font-size: .74rem; font-weight: 700; }
.k3d-legend li { display: inline-flex; align-items: center; gap: 7px; }
.k3d-legend i, .k3d-genre i, .k3d-months thead i { width: 11px; height: 11px; flex: none; border-radius: 3px; display: inline-block; }

.k3d-skip {
  position: absolute;
  z-index: 4;
  right: var(--k3d-gutter);
  top: 96px;
  color: rgba(243, 239, 228, .82);
  font-size: .76rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
.k3d-stage.is-story .k3d-skip { opacity: 1; pointer-events: auto; }

.k3d-credit {
  position: relative;
  margin: 0;
  padding: 14px var(--k3d-page-gutter, 24px);
  background: var(--rp-ink, #0c0d0b);
  color: var(--rp-muted, #9da296);
  font-size: .72rem;
  line-height: 1.5;
  text-align: center;
}
.k3d-credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.k3d-credit a:hover { color: var(--rp-cyan, #7ce5ff); }

.k3d-below { padding-bottom: 72px; }
.k3d-section { margin-top: clamp(56px, 8vw, 96px); scroll-margin-top: 84px; }
.k3d-section h2 {
  margin: 12px 0 0;
  color: var(--rp-paper, #f3efe4);
  font: 800 clamp(1.8rem, 4.4vw, 3.4rem)/1.02 "RP Syne", sans-serif;
  letter-spacing: -.06em;
  text-transform: uppercase;
}
.k3d-intro { max-width: 640px; margin: 14px 0 0; color: var(--rp-muted, #9da296); line-height: 1.6; }
.k3d-note { max-width: 760px; margin: 16px 0 0; color: var(--rp-muted, #9da296); font-size: .84rem; line-height: 1.55; }
.k3d-table-wrap { margin-top: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 18px; background: rgba(255, 255, 255, .025); }
.k3d-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.k3d-table th, .k3d-table td { padding: 13px 16px; border-bottom: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); text-align: left; vertical-align: baseline; }
.k3d-table tbody tr:last-child th, .k3d-table tbody tr:last-child td { border-bottom: 0; }
.k3d-table thead th { color: var(--rp-cyan, #7ce5ff); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.k3d-table tbody th { color: var(--rp-paper, #f3efe4); font-family: "RP Newsreader", Georgia, serif; font-size: 1.14rem; font-weight: 700; white-space: nowrap; }
.k3d-table .k3d-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k3d-next a { color: var(--rp-paper, #f3efe4); font-weight: 600; }
.k3d-next a span { margin-right: 6px; color: var(--rp-cyan, #7ce5ff); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.k3d-next a:hover { color: var(--rp-cyan, #7ce5ff); }
.k3d-none { color: var(--rp-muted, #9da296); }
.k3d-months { min-width: 760px; }
.k3d-months thead th:not(:first-child):not(:nth-child(2)) { text-align: right; letter-spacing: .04em; text-transform: none; font-size: .72rem; white-space: normal; }
.k3d-months thead i { margin-right: 6px; vertical-align: -1px; }
.k3d-months td { color: #d8d5ca; }
.k3d-genres { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.k3d-genre {
  min-height: 74px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--rp-line, rgba(243, 239, 228, .14));
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  color: var(--rp-paper, #f3efe4);
  font-weight: 700;
  transition: border-color .2s;
}
.k3d-genre:hover { border-color: var(--rp-cyan, #7ce5ff); }
.k3d-genre b { margin-left: auto; font: 800 1.5rem/1 "RP Syne", sans-serif; }
.k3d-below > .discovery-nav { margin-top: clamp(48px, 7vw, 80px); }

/* Dashboards */
.viz-card { position: relative; margin-top: 22px; padding: clamp(16px, 3vw, 30px); border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 24px; background: rgba(255, 255, 255, .025); }
.viz-filters { display: flex; flex-wrap: wrap; gap: 14px 30px; padding-bottom: 18px; border-bottom: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); }
.viz-filters[hidden], .viz-toggle[hidden], .k3d-city[hidden], [data-flat][hidden] { display: none; }
.viz-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.viz-filter__label { color: var(--rp-cyan, #7ce5ff); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.viz-pills, .viz-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.viz-toggle { margin-bottom: 12px; }
.viz-pills button, .viz-toggle button { min-height: 38px; padding: 0 14px; border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 999px; background: transparent; color: var(--rp-paper, #f3efe4); font: 700 .76rem/1 "RP Jakarta", sans-serif; cursor: pointer; transition: background .2s, border-color .2s; }
.viz-pills button:hover, .viz-toggle button:hover { border-color: var(--rp-cyan, #7ce5ff); }
.viz-pills button[aria-pressed="true"], .viz-toggle button[aria-pressed="true"] { border-color: var(--rp-paper, #f3efe4); background: var(--rp-paper, #f3efe4); color: var(--rp-ink, #0c0d0b); }
.viz-pills button:focus-visible, .viz-toggle button:focus-visible, .viz-card [tabindex="0"]:focus-visible { outline: 2px solid var(--rp-cyan, #7ce5ff); outline-offset: 2px; }
.viz-tiles { margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 18px; background: var(--rp-line, rgba(243, 239, 228, .14)); }
.viz-tile { min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; background: #121410; }
.viz-tile__label { color: var(--rp-cyan, #7ce5ff); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.viz-tile strong { color: var(--rp-paper, #f3efe4); font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.08 "RP Newsreader", Georgia, serif; }
.viz-tile span:last-child:not(.viz-tile__label) { color: var(--rp-muted, #9da296); font-size: .78rem; line-height: 1.35; }
.viz-grid { display: grid; gap: clamp(24px, 4vw, 44px); }
@media (min-width: 1000px) { .viz-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.viz-fig { min-width: 0; margin: 0; }
.viz-fig figcaption { margin-bottom: 12px; display: flex; flex-direction: column; gap: 3px; }
.viz-fig figcaption strong { color: var(--rp-paper, #f3efe4); font: 700 1.14rem/1.15 "RP Newsreader", Georgia, serif; }
.viz-fig figcaption span { color: var(--rp-muted, #9da296); font-size: .82rem; line-height: 1.4; }
.viz-chart { position: relative; min-width: 0; }
.viz-chart svg { display: block; overflow: visible; font-family: "RP Jakarta", sans-serif; }
.viz-chart text { fill: var(--rp-muted, #9da296); font-size: 12px; font-weight: 600; }
.viz-chart .t-ink { fill: var(--rp-paper, #f3efe4); font-size: 13px; font-weight: 800; }
.viz-chart .grid { stroke: rgba(243, 239, 228, .1); stroke-width: 1; }
.viz-chart .axis { stroke: rgba(243, 239, 228, .28); stroke-width: 1; }
.viz-chart .hit { fill: transparent; }
.viz-chart .m { transition: opacity .15s; }
.viz-chart g.on .m { opacity: .78; }
.viz-chart g.on .cell { opacity: 1; stroke: var(--rp-paper, #f3efe4); stroke-width: 1.5; }
.viz-chart .median { stroke: var(--rp-paper, #f3efe4); stroke-width: 2.5; }
.viz-chart .dot { stroke: #121410; stroke-width: 1; }
.viz-empty { padding: 44px 0; color: var(--rp-muted, #9da296); text-align: center; }
.viz-legend { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--rp-muted, #9da296); font-size: .78rem; font-weight: 600; }
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.key--past { background: #08c4e8; }
.key--next { background: #1f6c7f; }
.key--dot { border-radius: 50%; background: var(--rp-cyan, #7ce5ff); }
.key--med { width: 3px; border-radius: 1px; background: var(--rp-paper, #f3efe4); }
.viz-scale { margin-top: 12px; display: flex; align-items: center; gap: 10px; color: var(--rp-muted, #9da296); font-size: .76rem; font-weight: 600; }
.viz-scale:empty { display: none; }
.viz-scale i { width: 140px; height: 8px; display: block; border-radius: 4px; background: linear-gradient(90deg, #14343c, #14607a, #08c4e8, #7ce5ff, #fff); }
.viz-tip { position: absolute; z-index: 5; min-width: 140px; max-width: 260px; padding: 10px 12px; border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 12px; background: #151713; box-shadow: 0 14px 30px rgba(0, 0, 0, .4); color: var(--rp-muted, #9da296); font-size: .78rem; line-height: 1.35; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.viz-tip.on { opacity: 1; transform: none; }
.viz-tip b { display: block; color: var(--rp-paper, #f3efe4); font-size: .98rem; font-weight: 800; }
.viz-tip .row { display: flex; align-items: center; gap: 7px; }
.viz-tip .row i { width: 10px; height: 3px; flex: none; border-radius: 1px; }
.k3d-city { position: relative; height: clamp(280px, 30vw, 420px); overflow: hidden; border-radius: 18px; background: radial-gradient(circle at 50% 20%, rgba(124, 229, 255, .08), transparent 70%); cursor: grab; touch-action: pan-y; }
.k3d-city.is-drag { cursor: grabbing; }
.k3d-city canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.k3d-city-tip { position: absolute; z-index: 2; left: 0; top: 0; padding: 6px 10px; border: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); border-radius: 10px; background: #151713; color: var(--rp-paper, #f3efe4); font-size: .76rem; font-weight: 700; white-space: nowrap; pointer-events: none; }
.viz-table { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); }
.viz-table summary { color: var(--rp-paper, #f3efe4); font-size: .86rem; font-weight: 700; cursor: pointer; }
.viz-table .table-scroll { margin-top: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.viz-table table { border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.viz-table th, .viz-table td { padding: 7px 11px; border-bottom: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); color: #d8d5ca; text-align: right; white-space: nowrap; }
.viz-table th:first-child { text-align: left; }
.viz-table thead th { color: var(--rp-cyan, #7ce5ff); font-weight: 800; }
.viz-table caption { padding-bottom: 6px; color: var(--rp-paper, #f3efe4); font-weight: 700; text-align: left; }
.viz-source { margin: 16px 0 0; color: var(--rp-muted, #9da296); font-size: .76rem; line-height: 1.5; }

@media (max-width: 760px) {
  .k3d-stage.is-story { height: 520vh; }
  .k3d-shade { background: linear-gradient(0deg, rgba(12, 13, 11, .9), rgba(12, 13, 11, .12) 44%, rgba(12, 13, 11, .62)); }
  /* Plain text over the scene, no panel: the map stays visible. */
  .k3d-steps p { left: 14px; right: 14px; top: auto; bottom: 25%; max-width: none; font: 700 clamp(1.45rem, 6.4vw, 1.9rem)/1.1 "RP Newsreader", Georgia, serif; letter-spacing: -.01em; text-transform: none; text-shadow: 0 2px 18px rgba(12, 13, 11, .95), 0 0 2px rgba(12, 13, 11, .9); transform: translateY(22px); }
  .k3d-steps small { margin-top: 6px; color: #e4e1d8; font-size: .92rem; line-height: 1.4; }
  .k3d-steps p.on { transform: none; }
  .k3d-legend { margin-left: 0; width: 100%; gap: 5px 12px; font-size: .68rem; }
  .k3d-hud { gap: 8px 22px; }
  .k3d-copy { justify-content: flex-end; padding-bottom: 56px; }
  .k3d-stage.show-hud:not(.is-story) .k3d-copy { padding-bottom: 150px; }
  .k3d-skip { top: 88px; }
  .k3d-copy .breadcrumbs { top: 88px; }
  .k3d-genres { grid-template-columns: 1fr 1fr; }
  .k3d-towns th, .k3d-towns td { padding: 12px; }
  .k3d-towns tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px; border-bottom: 1px solid var(--rp-line, rgba(243, 239, 228, .14)); }
  .k3d-towns tbody tr:last-child { border-bottom: 0; }
  .k3d-towns tbody th, .k3d-towns tbody td { padding: 0; border: 0; }
  .k3d-towns thead { display: none; }
  .k3d-towns .k3d-next { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .k3d-genres { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .k3d-canvas, .k3d-copy, .k3d-hud, .k3d-steps p { transition: none; } }
