/* Interactive "Holocene to 3000" temperature stripes — /phc2026/holocene-3000/
   Full-screen canvas with floating overlay UI. Dark, Alcyone. Self-contained (incl. gate). */

@font-face {
  font-family: "Alcyone";
  src: url("/fonts/alcyone/Alcyone-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alcyone";
  src: url("/fonts/alcyone/Alcyone-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Alcyone";
  src: url("/fonts/alcyone/Alcyone-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0c0e12;
  color: #e9e9ec;
  font-family: "Alcyone", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#h3k-canvas {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ── Overlay layer ─────────────────────────────────────────────── */
.h3k-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.h3k-overlay > * {
  pointer-events: auto;
}

/* PHC signature gradient — needed by the shared back-to-/phc2026/ logo mark
   (.phc-subhead-logo-band in phc-chrome.css). Mirrors figures.css. */
:root {
  --phc-grad: linear-gradient(
    to right,
    #006837 0%, #8cc63f 25%, #ffe657 25.01%, #fcce17 30%,
    #df711c 40%, #c31920 60%, #871e5e 80%, #3d1e5e 100%
  );
}

.h3k-title {
  position: fixed;
  top: 14px;
  left: 18px;
  max-width: min(58vw, 720px);
}
/* Back-to-/phc2026/ logo mark, stacked above the title (like other pages). */
.h3k-home {
  display: block;
  margin-bottom: 10px;
}
.h3k-title h1 {
  margin: 0;
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.h3k-title p {
  margin: 4px 0 0;
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 400;
  color: #9aa0a8;
  line-height: 1.3;
}

.h3k-credit {
  position: fixed;
  bottom: 8px;
  left: 18px;
  font-size: 10px;
  color: #6e747c;
  max-width: 62vw;
  line-height: 1.3;
}
.h3k-brand {
  position: fixed;
  bottom: 8px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9aa0a8;
}

/* ── Controls ──────────────────────────────────────────────────── */
.h3k-controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  background: rgba(18, 21, 27, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.h3k-controls button {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #cfd3d9;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.h3k-controls button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.h3k-divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 2px;
  background: rgba(255, 255, 255, 0.12);
}

/* Pathway segmented control (P1 | P2 | P3) */
.h3k-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
.h3k-seg button {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #cfd3d9;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.h3k-seg button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.h3k-seg button.is-active {
  color: #0c0e12;
}
.h3k-seg button[data-pw="p1"].is-active {
  background: #46b277;
}
.h3k-seg button[data-pw="p2"].is-active {
  background: #e89a3c;
}
.h3k-seg button[data-pw="p3"].is-active {
  background: #e0494a;
}

/* Curve on/off toggle */
.h3k-toggle.is-active {
  color: #0c0e12;
  background: #cfd3d9;
  border-color: #cfd3d9;
}
.h3k-toggle.is-active:hover {
  background: #fff;
  color: #0c0e12;
}

/* Hover tooltips on the floating controls (P1–P3, Curve) — appear above the button */
.h3k-tip {
  position: relative;
}
.h3k-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  width: max-content;
  max-width: 248px;
  padding: 9px 11px;
  background: rgba(14, 17, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #d7dade;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 12;
}
.h3k-tip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(14, 17, 22, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 12;
}
.h3k-tip:hover::after,
.h3k-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.h3k-tip:hover::before,
.h3k-tip:focus-visible::before {
  opacity: 1;
}

.h3k-zoom-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.h3k-zoom-wrap .h3k-mag {
  font-size: 10px;
  color: #9aa0a8;
  white-space: nowrap;
}
/* Minimal, refined range slider (custom track + thumb, no heavy accent fill) */
#h3k-zoom {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(110px, 20vw, 240px);
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  outline: none;
}
#h3k-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e9e9ec;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s, background 0.12s;
}
#h3k-zoom::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #fff;
}
#h3k-zoom::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
#h3k-zoom::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #e9e9ec;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
#h3k-zoom:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* ── Tooltip ───────────────────────────────────────────────────── */
#h3k-tooltip {
  position: fixed;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  min-width: 168px;
  padding: 9px 11px;
  background: rgba(14, 17, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  font-size: 12px;
}
.h3k-tt-year {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: #fff;
}
.h3k-tt-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  color: #b7bcc3;
}
.h3k-tt-row.is-strong {
  color: #fff;
  font-weight: 600;
}
.h3k-tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.h3k-tt-name {
  flex: 1;
  letter-spacing: 0.02em;
}
.h3k-tt-val {
  font-variant-numeric: tabular-nums;
}

/* ── Password gate ─────────────────────────────────────────────── */
#h3k-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 30%, #14181f 0%, #0a0c10 70%);
  transition: opacity 0.45s ease;
}
.h3k-gate-card {
  width: min(360px, 86vw);
  padding: 30px 28px 26px;
  text-align: center;
  background: rgba(20, 24, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}
.h3k-gate-band {
  height: 5px;
  border-radius: 4px;
  margin-bottom: 18px;
  background: linear-gradient(
    90deg,
    #11539a,
    #2ba6cf,
    #3aa45c,
    #5cb83a,
    #f2dd35,
    #f6a72c,
    #d12826,
    #8e1f57
  );
}
.h3k-gate-card h1 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}
.h3k-gate-card p {
  margin: 0 0 18px;
  font-size: 12px;
  color: #9aa0a8;
}
.h3k-gate-card input {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
.h3k-gate-card input:focus {
  border-color: rgba(232, 154, 60, 0.6);
}
.h3k-gate-card button {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #0c0e12;
  background: #e89a3c;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.h3k-gate-error {
  margin: 10px 0 0;
  font-size: 12px;
  color: #e0494a;
  opacity: 0;
}
.h3k-gate-error.is-shown {
  opacity: 1;
}

#h3k-app {
  display: none;
}

/* ── Info / references side panel ───────────────────────────────── */
.h3k-info-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(6, 8, 11, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.h3k-info-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.h3k-info-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 19;
  display: flex;
  flex-direction: column;
  width: min(420px, 92vw);
  height: 100%;
  background: rgba(16, 19, 25, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  box-shadow: -14px 0 44px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.h3k-info-panel.is-open {
  transform: translateX(0);
}
.h3k-info-band {
  height: 4px;
  flex: none;
  background: linear-gradient(
    90deg,
    #11539a,
    #2ba6cf,
    #3aa45c,
    #5cb83a,
    #f2dd35,
    #f6a72c,
    #d12826,
    #8e1f57
  );
}
.h3k-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.h3k-info-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f0f1f3;
}
.h3k-info-close {
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: #9aa0a8;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.h3k-info-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.h3k-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 26px;
}
.h3k-info-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #c4c8ce;
}
.h3k-info-note strong {
  color: #e9eaed;
  font-weight: 600;
}
.h3k-info-note em {
  color: #e9eaed;
  font-style: normal;
  font-weight: 600;
}
.h3k-info-subhead {
  margin: 20px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a9098;
}
.h3k-refs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.h3k-refs li {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  line-height: 1.45;
  color: #aeb3ba;
}
.h3k-refs li em {
  color: #c8ccd2;
  font-style: italic;
}
.h3k-refs a {
  color: #5fcec8;
  text-decoration: none;
  border-bottom: 1px solid rgba(95, 206, 200, 0.35);
  word-break: break-word;
}
.h3k-refs a:hover {
  color: #8fe0db;
  border-bottom-color: rgba(95, 206, 200, 0.7);
}
.h3k-info-foot {
  margin: 18px 0 0;
  font-size: 10.5px;
  color: #6e747c;
  line-height: 1.4;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .h3k-title {
    top: 10px;
    left: 12px;
    max-width: 78vw;
  }
  .h3k-title h1 {
    font-size: 15px;
  }
  .h3k-title p {
    display: none;
  }
  .h3k-credit {
    display: none;
  }
  .h3k-controls {
    bottom: 16px;
    gap: 8px 10px;
    padding: 8px 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 24px);
  }
  .h3k-zoom-wrap .h3k-mag {
    display: none;
  }
  .h3k-divider {
    display: none;
  }
  .h3k-seg button {
    padding: 5px 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #h3k-gate,
  #h3k-tooltip,
  .h3k-tip::after,
  .h3k-tip::before,
  .h3k-info-panel,
  .h3k-info-backdrop,
  #h3k-zoom::-webkit-slider-thumb {
    transition: none;
  }
  .h3k-tip:hover::after,
  .h3k-tip:focus-visible::after {
    transform: translateX(-50%);
  }
}
