/* ============================================================
   PORTFOLIO ATLAS — markers.css
   CHART FURNITURE that sits over the Konva stage as plain DOM:
   the compass rose, the legend cartouche, the zoom control, and
   the first-load intro hint.

   (Waypoints, routes and signposts themselves are drawn inside
   the canvas by map.js — they are not styled here.)

   Consumes tokens from style.css :root.
   ============================================================ */

/* ── Compass rose (bottom-left) — old-school survey rose ─── */
.compass {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: var(--z-ui);
  width: 116px;
  height: 116px;
  pointer-events: none;
  opacity: 0.96;
  filter: drop-shadow(0 3px 7px rgba(44, 24, 16, 0.34));
}

/* disc + rings */
.cz-disc { fill: var(--parchment-panel); }
.cz-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}
.cz-ring--accent {
  stroke: var(--seal);
  stroke-width: 0.7;
  opacity: 0.6;
}

/* graduated rim — tangential dashes read as compass graduations */
.cz-ticks { fill: none; stroke: var(--ink); }
.cz-ticks--minor {
  stroke-width: 3;
  stroke-dasharray: 0.5 3.03;   /* ~80 fine graduations */
  opacity: 0.5;
}
.cz-ticks--major {
  stroke-width: 5;
  stroke-dasharray: 1.3 34.0;   /* 8 cardinal/intercardinal marks */
  opacity: 0.85;
}

/* faceted two-tone star rays */
.cz-ray {
  stroke: var(--ink);
  stroke-width: 0.25;
  stroke-linejoin: round;
}
.cz-ray--light { fill: #e6d6ad; }      /* aged-cream gore */
.cz-ray--dark  { fill: var(--ink); }   /* shadow gore     */
.cz-ray--north { fill: var(--seal); }  /* north marked red */

/* hub */
.cz-hub {
  fill: var(--parchment-panel);
  stroke: var(--ink);
  stroke-width: 1;
}
.cz-hub-dot { fill: var(--seal); }

/* cardinal letters */
.cz-letter {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 9px;
  text-anchor: middle;
  dominant-baseline: central;
}
.cz-letter--n {
  fill: var(--seal);
  font-weight: 700;
}

/* ── Legend cartouche (bottom-right) ────────────────────── */
.legend {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-ui);
  min-width: 176px;
  padding: 12px 15px;
  background: var(--parchment-panel);
  background-image:
    repeating-linear-gradient(0deg, rgba(44,24,16,0.02) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(139, 26, 26, 0.32);
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(44, 24, 16, 0.22);
}

.legend__title {
  margin: 0 0 9px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  border-bottom: 1px solid rgba(139, 26, 26, 0.25);
  padding-bottom: 5px;
}

.legend__list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.legend__key {
  display: inline-block;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(44, 24, 16, 0.45);
  flex: 0 0 auto;
}
.legend__key--coastal        { background: var(--cat-coastal); }
.legend__key--remote-sensing { background: var(--cat-remote-sensing); }
.legend__key--gis            { background: var(--cat-gis); }
.legend__key--fieldwork      { background: var(--cat-fieldwork); }
.legend__key--page {
  background: var(--cat-page);
  border-radius: 2px;
  border-color: var(--seal-dark);
  transform: rotate(45deg);
}

/* ── Zoom control (right edge, vertically centred) ──────── */
.zoomctl {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-ui);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(139, 26, 26, 0.45);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(44, 24, 16, 0.25);
}

.zoomctl button {
  width: 38px;
  height: 38px;
  background: var(--parchment-panel);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease;
}
.zoomctl button + button { border-top: 1px solid rgba(139, 26, 26, 0.28); }
.zoomctl button:hover { background: var(--seal); color: var(--parchment); }
.zoomctl button:active { background: var(--seal-dark); color: var(--parchment); }

/* ── Intro title card (in frame on load; fades on first interaction) ── */
.atlas-intro {
  position: fixed;
  inset: 0;
  z-index: 700;                 /* above chrome (z-ui 600), below the panel */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;         /* never blocks the map underneath */
  transition: opacity 0.7s ease;
}
.atlas-intro.is-hidden { opacity: 0; }

.atlas-intro__card {
  text-align: center;
  max-width: min(88vw, 560px);
  padding: 28px 44px 24px;
  background: rgba(244, 239, 224, 0.82);
  border: 1px solid rgba(139, 26, 26, 0.32);
  border-radius: 6px;
  box-shadow: 0 10px 46px -12px rgba(44, 24, 16, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.atlas-intro__kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--seal);
}
.atlas-intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 54px;
  line-height: 1;
  color: var(--ink);
}
.atlas-intro__sub {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  color: var(--ink-soft);
}
.atlas-intro__hint {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
}

/* ── Loading veil (hidden once Konva has drawn the chart) ── */
.atlas-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  transition: opacity 0.6s ease;
}
.atlas-loading.is-hidden { opacity: 0; pointer-events: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .compass { width: 84px; height: 84px; left: 12px; bottom: 12px; }
  .legend  { right: 12px; bottom: 12px; min-width: 0; padding: 9px 11px; }
  .legend__title { font-size: 14px; }
  .legend__item  { font-size: 10px; }
  .zoomctl { right: 12px; }
  .zoomctl button { width: 34px; height: 34px; font-size: 20px; }
  .atlas-intro__card { padding: 22px 24px 20px; max-width: 90vw; }
  .atlas-intro__kicker { font-size: 11px; letter-spacing: 0.2em; }
  .atlas-intro__title { font-size: 34px; }
  .atlas-intro__sub { font-size: 17px; }
  .atlas-intro__hint { font-size: 11px; margin-top: 16px; }
}

/* Very small screens: drop the legend so the chart breathes. */
@media (max-width: 430px) {
  .legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-intro, .atlas-loading, .zoomctl button { transition: none !important; }
}
