@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ==========================================================================
   FLUID CYMATICS - STYLESHEET
   ========================================================================== */

:root {
  --color-cahier: #B7A07C;      /* B7A07C - Cahier - Headers & Assets */
  --color-accent-lo: #5F6B4E;   /* 5F6B4E - Moss - Accent Lo */
  --color-accent-hi: #4A7B7C;   /* 4A7B7C - Teal - Accent Hi */
  --color-canvas-bg: #171717;  /* 171717 - Black - Canvas Background */
  --color-callout-bg: #1F1F1D; /* 1F1F1D - Brown - Callouts & HZ Lines */
  --color-text-white: #ACACAC;  /* ACACAC - White - Text */
  --color-link: #D9D9D9;        /* D9D9D9 - Link */
  --color-visited: #5A5A5A;     /* 5A5A5A - vLink */
  --color-obsidian-div: #080808;/* 080808 - Obsidian Parent Div */

  --color-bright-white: #FFFFFF;
  --font-mono: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg-charcoal: #121212;
  --cahier-tan: #B7A07C;
  --moss-green: #5F6B4E;
  --cymatic-teal: #4A7B7C;

  --node-idle: var(--moss-green);
  --node-active: #00e5ff;
  --node-glow: rgba(0, 229, 255, 0.35);
}

.graph-node.active {
  fill: var(--node-active);
  filter: drop-shadow(0px 0px 8px var(--node-glow));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, #111111 0%, #1c1a17 100%);
  color: var(--color-text-white);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#scene-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ==========================================
   HEADER BANNER
   ========================================== */
#ui-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 16px 32px;
  background: var(--color-callout-bg);
  border-bottom: 1px solid #B7A07C;
  pointer-events: auto;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo-img {
  height: 60px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-line-2 {
  font-size: 14px;
  color: var(--color-text-white);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0px;
}

.brand-line-3 {
  font-size: 12px;
  color: var(--color-accent-hi);
  letter-spacing: 0.01em;
  padding-left: 1px;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  max-height: 24px;
  overflow: hidden;
}

@media (max-width: 960px) {
  .brand-line-3 {
    opacity: 0;
    max-height: 0;
  }
}

/* ==========================================
   FOOTER BAR
   ========================================== */
#ui-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 32px;
  background: var(--color-obsidian-div);
  border-top: 1px solid var(--color-callout-bg);
  pointer-events: auto;
}

.footer-quote {
  font-size: 14px;
  color: var(--color-visited);
  letter-spacing: 0.03em;
  text-align: center;
}

.footer-quote span {
  color: var(--color-cahier);
}

/* ==========================================
   PROJECTED HTML NODE LABELS
   ========================================== */
#labels-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.node-label {
  position: absolute;
  color: var(--color-text-white);
  font-size: 10px;
  letter-spacing: 0.05em;
  pointer-events: auto;
  text-shadow: 0 1px 4px rgba(8, 8, 8, 0.95);
  transform: translate(16px, -50%);
  white-space: nowrap;
  user-select: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.node-label:hover, .node-label.active {
  color: var(--color-bright-white);
  border-bottom: 1px dotted var(--color-bright-white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  opacity: 1 !important;
}

.node-label.adjacent {
  color: var(--color-cahier);
  opacity: 0.95 !important;
}

/* ==========================================
   WIDE READING TROUGH INSPECTOR PANEL
   ========================================== */
#inspector-panel {
  position: fixed;
  top: calc(var(--header-height, 93px) - 1px); 
  right: -800px;
  width: 720px;
  max-width: 85vw;
  height: calc(100vh - var(--header-height, 93px) - 39px);
  background: var(--color-callout-bg);
  backdrop-filter: none;
  border-left: 1px solid var(--color-cahier); 
  z-index: 9999;
  padding: 48px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 28px;
  pointer-events: auto;
  box-shadow: none;
  overflow-y: auto;
}

#inspector-panel.open {
  right: 0 !important;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-visited);
  padding-bottom: 16px;
}

.panel-title {
  color: var(--color-cahier);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-body {
  color: var(--color-text-white);
  font-size: 13px;
  line-height: 1.85;
  max-width: 65ch;
}

.close-btn {
  color: var(--color-visited);
  cursor: pointer;
  font-size: 20px;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--color-bright-white);
}

@media (max-width: 768px) {
  #inspector-panel {
    width: 100vw;
    max-width: 100vw;
    padding: 24px;
  }
}

/* ==========================================
   RESPONSIVE / MOBILE OVERRIDES
   ========================================== */

@media (max-width: 768px) {
  /* Header adjustments for small screens */
  #ui-header {
    padding: 12px 16px;
  }

  .brand-logo-img {
    height: 42px; /* Scales logo down slightly for mobile */
  }

  .brand-line-2 {
    font-size: 11px;
  }

  .brand-line-3 {
    display: none; /* Hides long description to keep header clean */
  }

  /* Inspector panel takes full screen on narrow phones */
  #inspector-panel {
    width: 100vw;
    max-width: 100vw;
    padding: 24px;
    right: -100vw;
  }

  #inspector-panel.open {
    right: 0 !important;
  }
}

/* Dual-screen / Foldable adjustment */
@media (min-width: 769px) and (max-width: 1024px) {
  #inspector-panel {
    width: 50vw;
    max-width: 50vw;
  }
}

/* ==========================================
   MOBILE & TABLET HEADER / SCROLL ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
  /* Pull header content all the way to the left edge */
  #ui-header {
    padding: 10px 16px;
  }

  .brand-wrapper {
    gap: 10px; /* Tightens space between logo and text */
  }

  /* Ensure smooth momentum scrolling on mobile devices */
  #inspector-panel {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }
}

@media (max-width: 768px) {
  /* Hide the footer quote on small screens */
  .footer-quote {
    display: none;
  }
}