/* ── Reset & variables ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:      #0d0f0e;
  --surface: #141714;
  --border:  #1f231f;
  --dim:     #3a3f3a;
  --muted:   #6b736b;
  --text:    #c8d0c8;
  --bright:  #e8ede8;
  --accent:  #5af078;

  --bubble-size: 120px;
}

/* ── Page ── */
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 300;
}

/* scanline texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 100;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* ── Header ── */
header {
  text-align: center;
  padding: 2.5rem 0 1rem;
  flex-shrink: 0;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* back-link in the eyebrow on sub-pages */
.eyebrow a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.eyebrow a:hover { border-color: var(--accent); }

h1 {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

h1 span { color: var(--accent); }

.subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Bubble stage ── */
.bubble-stage {
  width: 100%;
  max-width: 780px;
}

/* dense absolute-positioned map (landing /all only) */
.bubble-stage--map {
  position: relative;
  height: 1400px;
}

/* responsive flow grid (landing + category pages) */
.bubble-stage--flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
  padding: 2.5rem 0;
  min-height: 40vh;
}

/* ── Individual bubble ── */
.bubble {
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 0 0 1px var(--accent-c, var(--border));
  transition:
    transform  0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s ease,
    z-index    0s;
  z-index: 1;
}

/* map placement */
.bubble-stage--map .bubble {
  position: absolute;
  left: var(--x);
  top:  var(--y);
  transform: translate(-50%, -50%) scale(1);
}
.bubble-stage--map .bubble:hover,
.bubble-stage--map .bubble.tapped {
  transform: translate(-50%, -50%) scale(2.4);
}

/* flow placement */
.bubble-stage--flow .bubble {
  position: relative;
  transform: scale(1);
}
.bubble-stage--flow .bubble:hover,
.bubble-stage--flow .bubble.tapped {
  transform: scale(1.85);
}

/* ── Content inside bubble (hidden by default) ── */
.bubble-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  gap: 6px;
  opacity: 0;
  transform: scale(0.75);
  transition:
    opacity   0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.bname {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-c, var(--accent));
  letter-spacing: -0.01em;
}

.bdesc {
  font-size: 0.68rem;
  color: var(--text);
  line-height: 1.4;
}

.btag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Hover (or tap, on touch): expand + reveal ── */
.bubble:hover,
.bubble.tapped {
  box-shadow:
    0 0 0 1px var(--accent-c, var(--accent)),
    0 8px 30px rgba(0,0,0,0.5);
  z-index: 10;
}

.bubble:hover .bubble-content,
.bubble.tapped .bubble-content {
  opacity: 1;
  transform: scale(0.65);
}

/* ── Dot label (visible at rest) ── */
.bubble::after {
  content: attr(data-label);
  position: absolute;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-c, var(--accent));
  transition: opacity 0.2s ease;
}

.bubble:hover::after,
.bubble.tapped::after {
  opacity: 0;
}

/* ── Dependency graph (libraries page) ── */
.graph-wrap {
  width: 100%;
  max-width: 780px;
  margin: 1.5rem auto 0;
}

.graph-wrap h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bright);
  text-align: center;
  margin-bottom: 0.4rem;
}

.graph-wrap p.graph-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.graph-wrap p.graph-note code {
  font-size: 0.7rem;
  color: var(--text);
}

#dep-graph {
  width: 100%;
  min-height: 460px;
}

#dep-graph svg {
  display: block;
  width: 100%;
  overflow: visible;
}

/* separator between the graph and the project bubbles below it */
.graph-wrap + .bubble-stage {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* ── Timeline (about page) ── */
.timeline {
  width: 100%;
  max-width: 680px;
  margin: 1rem auto 0;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.tl-entry {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.2rem;
  padding: 0.9rem 0;
  position: relative;
}

.tl-entry::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 4px);
  top: 1.25rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.tl-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
}

.tl-body h3 {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--bright);
  margin-bottom: 0.2rem;
}

.tl-body p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.prose {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}
.prose p { margin-bottom: 1rem; }

/* ── Footer ── */
footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

footer a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
footer a:hover { color: var(--text); border-color: var(--dim); }

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

@keyframes float {
  0%, 100% { margin-top: 0; }
  50%       { margin-top: -7px; }
}

.bubble.floating:not(:hover):not(.tapped) {
  animation: float 5s ease-in-out infinite;
}

/* ── Page fade-in ── */
header, .bubble-stage, footer, .graph-wrap, .timeline, .prose {
  opacity: 0;
  animation: fadein 0.5s ease forwards;
}
header         { animation-delay: 0.05s; }
.bubble-stage  { animation-delay: 0.2s; }
.graph-wrap, .timeline, .prose { animation-delay: 0.25s; }
footer         { animation-delay: 0.35s; }

@keyframes fadein {
  to { opacity: 1; }
}
