/* ═══════════════ DRM Garden ═══════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050508;
  --rc: #45B7D1;
  --ds1: #4ECDC4;
  --ps: #FFEAA7;
  --ds2: #F1948A;
  --accent: #ff8c42;
  --text: #ffffff;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', ui-monospace, monospace;
  overflow: hidden;
}

.hidden { display: none !important; }

kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.85em;
}

/* ── Buttons ── */
.btn {
  font-family: inherit;
  cursor: pointer;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 13px;
  letter-spacing: 1px;
  border: 1px solid transparent;
  transition: all 0.25s;
}
.btn-sm { padding: 7px 16px; font-size: 11px; }
.btn-primary {
  background: rgba(255,140,66,0.18);
  border-color: rgba(255,140,66,0.5);
  color: var(--accent);
}
.btn-primary:hover { background: rgba(255,140,66,0.32); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Loader ── */
#loader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; background: var(--bg);
}
.loader-flower { font-size: 48px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.loader-title { font-size: 26px; letter-spacing: 10px; color: rgba(255,255,255,0.85); }
.loader-bar { width: 220px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.loader-bar-fill { width: 40%; height: 100%; background: var(--accent); border-radius: 2px; animation: load 1.4s ease-in-out infinite; }
@keyframes load { 0%{margin-left:-40%} 100%{margin-left:100%} }
.loader-sub { font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,0.3); }

/* ── Overlays ── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,20,40,0.55), rgba(5,5,8,0.95));
  backdrop-filter: blur(6px);
  padding: 20px;
}

/* ── Landing ── */
.landing-card {
  max-width: 620px; text-align: center;
  background: rgba(10,10,20,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.landing-eyebrow { font-size: 10px; letter-spacing: 5px; color: rgba(255,255,255,0.4); margin-bottom: 14px; }
.landing-title {
  font-size: 52px; letter-spacing: 4px; font-weight: 700;
  background: linear-gradient(120deg, var(--rc), var(--ds1), var(--ps), var(--ds2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}
.landing-lede { font-size: 14px; line-height: 1.8; color: rgba(255,255,255,0.65); margin-bottom: 26px; }
.landing-lede strong { color: rgba(255,255,255,0.9); }
.landing-flow {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 30px;
}
.flow-node {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; padding: 10px 14px;
  border-radius: 10px; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
}
.flow-node[data-stage="1"] { color: var(--rc); border-color: rgba(69,183,209,0.5); }
.flow-node[data-stage="2"] { color: var(--ds1); border-color: rgba(78,205,196,0.5); }
.flow-node[data-stage="3"] { color: var(--ps); border-color: rgba(255,234,167,0.5); }
.flow-node[data-stage="4"] { color: var(--ds2); border-color: rgba(241,148,138,0.5); }
.flow-arrow { color: rgba(255,255,255,0.3); font-size: 18px; }
.landing-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.landing-actions .btn { width: 100%; max-width: 360px; }
.landing-hint { margin-top: 18px; font-size: 10px; letter-spacing: 1px; color: rgba(255,255,255,0.3); }

/* ── Garden layout ── */
#garden-root { display: flex; width: 100%; height: 100%; }

#sidebar {
  width: 230px; min-width: 230px; height: 100%;
  background: rgba(10,10,18,0.95);
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto; padding: 16px; z-index: 10;
}
.sidebar-header { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo { font-size: 13px; letter-spacing: 2px; color: rgba(255,255,255,0.7); }
.sidebar-search {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  padding: 8px 12px; color: #fff; font-family: inherit; font-size: 11px;
  outline: none; margin-bottom: 10px;
}
.sidebar-search:focus { border-color: var(--accent); }
.sidebar-tour-btn {
  width: 100%; background: rgba(255,140,66,0.12);
  border: 1px solid rgba(255,140,66,0.4); color: var(--accent);
  border-radius: 6px; padding: 8px; font-family: inherit; font-size: 11px;
  letter-spacing: 1px; cursor: pointer; margin-bottom: 14px; transition: background 0.2s;
}
.sidebar-tour-btn:hover { background: rgba(255,140,66,0.25); }
.sidebar-section {
  font-size: 9px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,0.3); margin: 14px 0 8px;
}
.folder-list, .tag-list { display: flex; flex-direction: column; gap: 2px; }
.folder-item, .tag-item {
  font-size: 11px; padding: 6px 8px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.6);
  transition: background 0.2s;
}
.folder-item:hover, .tag-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.folder-item .stage-num {
  margin-left: auto; font-size: 9px; opacity: 0.5;
}
.tag-item { font-size: 10px; color: rgba(255,255,255,0.4); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-legend { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.legend-item { font-size: 9px; color: rgba(255,255,255,0.3); display: flex; align-items: center; gap: 6px; }

#main { flex: 1; position: relative; overflow: hidden; }
#canvas-wrap { width: 100%; height: 100%; }
#canvas-wrap canvas { display: block; }

/* ── Top controls ── */
#top-controls { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 16; }
.round-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(10,10,20,0.7); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); font-size: 16px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.round-btn:hover { color: var(--accent); border-color: rgba(255,140,66,0.5); }

/* ── Info panel (hover) ── */
.info-panel {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 15; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  padding: 13px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12);
  max-width: 440px; pointer-events: none; text-align: center;
}
.info-folder { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.6; margin-bottom: 3px; }
.info-panel h3 { font-size: 15px; letter-spacing: 1px; margin-bottom: 4px; }
.info-desc { font-size: 10px; color: rgba(255,255,255,0.5); line-height: 1.5; margin-top: 4px; }
.info-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 8px; }
.info-tag { font-size: 9px; padding: 2px 7px; border-radius: 3px; background: rgba(255,255,255,0.06); }
.info-hint { font-size: 8px; color: rgba(255,140,66,0.5); margin-top: 8px; letter-spacing: 2px; text-transform: uppercase; }

/* ── Link-hover (arc follow) ── */
.link-hover {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 15; background: rgba(5,5,12,0.92); backdrop-filter: blur(12px);
  padding: 13px 18px 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1);
  min-width: 320px;
}
.link-conn-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.3); text-align: center; margin-bottom: 9px; }
.link-conn-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.conn-node-btn {
  background: rgba(255,255,255,0.04); border: 1px solid; border-radius: 8px;
  padding: 7px 13px; font-family: inherit; font-size: 11px; cursor: pointer;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all 0.2s;
}
.conn-node-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.conn-arrow { font-size: 17px; color: rgba(255,255,255,0.4); }
.conn-close { position: absolute; top: 7px; right: 11px; font-size: 13px; cursor: pointer; color: rgba(255,255,255,0.3); }
.conn-close:hover { color: var(--accent); }

/* ── Note reading panel ── */
.note-panel {
  position: absolute; top: 0; right: 0; width: 420px; max-width: 92%; height: 100%;
  background: rgba(8,8,16,0.97); backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255,255,255,0.1); z-index: 20;
  overflow-y: auto; padding: 26px 24px;
}
.note-close {
  position: absolute; top: 12px; right: 16px; font-size: 18px; cursor: pointer;
  color: rgba(255,255,255,0.4); z-index: 21;
}
.note-close:hover { color: var(--accent); }
.note-folder-badge { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.7; margin-bottom: 6px; }
#note-content h1.note-title { font-size: 20px; letter-spacing: 1px; margin-bottom: 8px; line-height: 1.3; }
.note-desc { font-size: 12px; font-style: italic; color: var(--accent); line-height: 1.5; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.note-links-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.link-chip {
  background: rgba(255,255,255,0.04); border: 1px solid; border-radius: 18px;
  padding: 4px 12px; font-family: inherit; font-size: 10px; cursor: pointer; transition: all 0.2s;
}
.link-chip:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.link-chip.dead { opacity: 0.3; cursor: default; }

.note-body { font-size: 13px; line-height: 1.75; color: rgba(255,255,255,0.78); }
.note-body h1, .note-body h2, .note-body h3, .note-body h4 { color: rgba(255,255,255,0.9); margin: 18px 0 8px; line-height: 1.3; }
.note-body h1 { font-size: 17px; } .note-body h2 { font-size: 15px; } .note-body h3 { font-size: 13px; }
.note-body p { margin: 8px 0; }
.note-body ul, .note-body ol { padding-left: 20px; margin: 8px 0; }
.note-body li { margin-bottom: 4px; }
.note-body code { background: rgba(255,255,255,0.07); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.note-body pre { background: rgba(255,255,255,0.04); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 10px 0; }
.note-body pre code { background: none; padding: 0; }
.note-body blockquote { border-left: 2px solid rgba(255,140,66,0.5); padding-left: 12px; color: rgba(255,255,255,0.55); margin: 10px 0; font-style: italic; }
.note-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 11.5px; }
.note-body th, .note-body td { border: 1px solid rgba(255,255,255,0.12); padding: 6px 9px; text-align: left; }
.note-body th { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }
.note-body a.wl { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(255,140,66,0.4); cursor: pointer; }
.note-body a.wl:hover { border-bottom-style: solid; }
.note-body a.wl.dead { color: rgba(255,255,255,0.4); border-bottom: none; cursor: default; }
.note-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 16px 0; }
.note-open-row { display: flex; justify-content: center; margin-top: 22px; }

/* ── Guided tour panel ── */
.tour-panel {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: 560px; max-width: 94%; z-index: 30;
  background: rgba(8,8,18,0.96); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 16px;
  padding: 18px 22px 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.tour-progress { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.tour-step-pill {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; opacity: 0.4; transition: opacity 0.3s;
}
.tour-step-pill.active { opacity: 1; }
.tour-step-pill.done { opacity: 0.7; }
.tour-step-bar { width: 100%; height: 3px; border-radius: 2px; background: currentColor; }
.tour-step-label { font-size: 8.5px; letter-spacing: 1px; }
.tour-body { min-height: 92px; }
.tour-stage-num { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; opacity: 0.6; margin-bottom: 4px; }
.tour-title { font-size: 20px; letter-spacing: 1px; margin-bottom: 8px; }
.tour-text { font-size: 12.5px; line-height: 1.65; color: rgba(255,255,255,0.72); margin-bottom: 10px; }
.tour-text strong { color: rgba(255,255,255,0.95); }
.tour-meta { display: flex; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.tour-meta-block { flex: 1; min-width: 180px; }
.tour-meta-label { font-size: 8.5px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-bottom: 4px; }
.tour-meta-val { font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,0.7); }
.tour-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tour-chip {
  font-size: 10px; padding: 4px 11px; border-radius: 16px; cursor: pointer;
  border: 1px solid; background: rgba(255,255,255,0.04); transition: all 0.2s;
}
.tour-chip:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.tour-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }

/* ── Search overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(10px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.search-box {
  width: 560px; max-width: 92%;
  background: rgba(10,10,22,0.98); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.85);
}
.search-main {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid rgba(255,255,255,0.07); padding: 18px 20px;
  color: #fff; font-family: inherit; font-size: 13px; outline: none;
}
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.search-result-item:hover, .search-result-item.sel { background: rgba(255,255,255,0.07); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-desc { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-folder { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.6; }
.search-empty { text-align: center; padding: 20px; font-size: 11px; color: rgba(255,255,255,0.25); }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 720px) {
  #sidebar { display: none; }
  .note-panel { width: 100%; }
  .tour-panel { width: 96%; bottom: 12px; padding: 14px 16px; }
  .landing-title { font-size: 38px; }
  .landing-card { padding: 32px 22px; }
}
