/* ─────────────────────────────────────────────────────────────────────
   Relations — styles.css
   OFlight Monument DNA · relations.oflight.club
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* Colors — inherited from OFlight parent */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-tint: #fafafa;
  --text: #171717;
  --text-secondary: #4d4d4d;
  --text-tertiary: #666666;
  --text-muted: #808080;
  --text-disabled: #b3b3b3;
  --link: #0072f5;
  --focus: hsla(212, 100%, 48%, 1);
  --focus-ring: rgba(147, 197, 253, 0.5);
  --border-soft: #ebebeb;
  --border-shadow: rgba(0, 0, 0, 0.08);
  --border-shadow-strong: rgba(0, 0, 0, 0.16);
  --edge: rgba(23, 23, 23, 0.15);
  --edge-highlight: rgba(23, 23, 23, 0.5);
  --edge-label: #808080;

  /* Fonts */
  --font-serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
  --font-sans: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* Shadows */
  --shadow-border: 0px 0px 0px 1px rgba(0, 0, 0, 0.08);
  --shadow-card: 0px 0px 0px 1px rgba(0, 0, 0, 0.06),
    0px 2px 2px rgba(0, 0, 0, 0.03),
    0px 8px 12px -8px rgba(0, 0, 0, 0.04),
    0px 0px 0px 1px #fafafa;
  --shadow-card-hover: 0px 0px 0px 1px rgba(0, 0, 0, 0.06),
    0px 4px 8px rgba(0, 0, 0, 0.04),
    0px 16px 20px -12px rgba(0, 0, 0, 0.06),
    0px 0px 0px 1px #fafafa;

  /* Spacing */
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-20: 80px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "liga" 1, "tnum" 1;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Page layout ─────────────────────────────────────────────────────── */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.ink-rule {
  height: 1px;
  width: 100%;
  margin: 0 auto;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(23, 23, 23, 0.18) 20%,
    rgba(23, 23, 23, 0.18) 80%,
    transparent 100%
  );
}

.ink-rule--top {
  margin-bottom: 16px;
  max-width: 720px;
}

.ink-rule--bottom {
  margin-top: 16px;
  margin-bottom: 0;
  max-width: 480px;
}

.kicker {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  margin: 0 0 16px;
}

.title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 12px;
  color: var(--text);
}

.tagline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* ── Stats bar ────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 16px;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-dot {
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 14px;
}

/* ── Section label ────────────────────────────────────────────────────── */

.section-label {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 12px;
}

/* ── Graph canvas ─────────────────────────────────────────────────────── */

.graph-section {
  margin-bottom: 48px;
}

.graph-canvas {
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.relations-graph {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  min-height: 400px;
}

/* ── SVG node & edge styling ──────────────────────────────────────────── */

.node-box {
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.node:hover .node-box {
  stroke: var(--border-shadow-strong);
  stroke-width: 1.5;
}

.node-name {
  pointer-events: none;
  user-select: none;
}

.node-meta {
  pointer-events: none;
  user-select: none;
}

.edge-line {
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.edge-label {
  pointer-events: none;
  user-select: none;
}

.edge-label-group {
  pointer-events: none;
}

/* Hover highlight: when hovering a node, highlight connected edges */
.node:hover ~ .edges .edge-line {
  opacity: 0.3;
}

/* ── Legend ───────────────────────────────────────────────────────────── */

.legend-section {
  margin-bottom: 48px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.legend-shape {
  display: inline-block;
}

.legend-shape--person {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-shadow);
}

.legend-shape--org {
  width: 24px;
  height: 20px;
  border-radius: 4px;
  background: var(--surface-tint);
  border: 1px solid var(--border-shadow);
}

.legend-line {
  width: 28px;
  height: 0;
  border-top: 1.2px solid var(--edge);
  position: relative;
}

.legend-line::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 6px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.legend-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0 0;
  font-size: 0.8125rem;
}

.footer-link {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #0056b3;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .page {
    padding: 48px 16px 32px;
  }

  .title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .tagline {
    font-size: 1rem;
  }

  .ink-rule--top {
    margin-bottom: 32px;
  }

  .stats-bar {
    gap: 4px;
  }

  .stat-num {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-dot {
    margin: 0 8px;
  }

  .graph-canvas {
    padding: 8px;
  }

  .legend {
    gap: 16px;
  }
}