/* =======================================================
   PURE HIERARCHY CSS (Glassmorphism + Cards)
   ======================================================= */

/* --- 1. GLASSMORPHISM STACK --- */
body.modal-open { overflow: hidden; }
.glass-hierarchy-core { max-width: 1200px; margin: 0 auto; padding: 0 10px; display: flex; flex-direction: column;  position: relative; z-index: 10; }

.glass-panel { 
  position: relative; height: 160px; border-radius: 20px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
  background: #0b0a08;
}
.glass-panel:hover, .glass-panel.active-hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255, 210, 74, 0.4);
}

.glass-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; transition: opacity 0.5s, transform 0.5s; z-index: 1; border-radius: 20px; }
.glass-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0.4) 100%); z-index: 2; transition: background 0.4s; border-radius: 20px; }
.glass-panel:hover .glass-bg, .glass-panel.active-hover .glass-bg { opacity: 0.5; transform: scale(1.03); }
.glass-panel:hover .glass-overlay, .glass-panel.active-hover .glass-overlay { background: linear-gradient(90deg, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0.2) 100%); }

.glass-header { position: absolute; left: 40px; bottom: 30px; z-index: 3; max-width: 60%; }
.glass-tag { font-family: 'Space Mono', monospace; font-size: 11px; color: #FFD24A; text-transform: uppercase; letter-spacing: 0.15em; display: block; margin-bottom: 10px; font-weight: bold; }
.glass-title { font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 5px; line-height: 1.1; letter-spacing: -0.5px; }
.glass-desc { font-size: 15px; color: rgba(255, 255, 255, 0.7); margin: 0; line-height: 1.4; }

.glass-hint { position: absolute; right: 40px; bottom: 30px; z-index: 4; font-family: 'Space Mono', monospace; font-size: 14px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; font-weight: bold; opacity: 0; transform: translateX(-10px); transition: all 0.4s ease; padding: 10px 20px; background: rgba(255,210,74,0.1); border-radius: 30px; border: 1px solid rgba(255,210,74,0.3); -webkit-backdrop-filter:blur(5px);
 backdrop-filter:blur(5px); width: 300px;}
.glass-panel:hover .glass-hint, .glass-panel.active-hover .glass-hint { opacity: 1; transform: translateX(0); }

.glass-peek-container { position: absolute; right: 40px; top: 100%; z-index: 3; width: 300px; transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); }
.glass-panel:hover .glass-peek-container, .glass-panel.active-hover .glass-peek-container { transform: translateY(-70px); }
.glass-peek-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.peek-card { height: 100px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; box-shadow: 0 -5px 15px rgba(0,0,0,0.5); -webkit-backdrop-filter:blur(4px);
 backdrop-filter:blur(4px); }
.peek-card:nth-child(1) { transform: translateY(20px); }
.peek-card:nth-child(2) { transform: translateY(10px); }
.peek-card:nth-child(3) { transform: translateY(15px); }
.peek-card:nth-child(4) { transform: translateY(25px); }
.glass-panel:hover .peek-card:nth-child(1), .glass-panel.active-hover .peek-card:nth-child(1) { transition: transform 0.4s 0.05s; transform: translateY(0); }
.glass-panel:hover .peek-card:nth-child(2), .glass-panel.active-hover .peek-card:nth-child(2) { transition: transform 0.4s 0.10s; transform: translateY(0); }
.glass-panel:hover .peek-card:nth-child(3), .glass-panel.active-hover .peek-card:nth-child(3) { transition: transform 0.4s 0.15s; transform: translateY(0); }
.glass-panel:hover .peek-card:nth-child(4), .glass-panel.active-hover .peek-card:nth-child(4) { transition: transform 0.4s 0.20s; transform: translateY(0); }

/* --- 2. FULLSCREEN MODAL --- */
.fullscreen-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; background: #0b0a08; -webkit-overflow-scrolling: touch; }
.fullscreen-modal.active { opacity: 1; pointer-events: auto; }

/* fixed so the backdrop covers the viewport at every scroll position,
   instead of ending after the first viewport-height of modal content */
.modal-bg { position: fixed; inset: 0; z-index: 1; }
.modal-bg-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.2; filter: blur(5px); transform: scale(1.05); }
.modal-overlay { position: absolute; inset: 0; background: rgba(5, 5, 5, 0.85); -webkit-backdrop-filter:blur(20px);
 backdrop-filter:blur(20px); }

.modal-close { position: fixed; top: 40px; right: 40px; z-index: 100; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; font-family: 'Space Mono', monospace; font-size: 13px; font-weight: bold; letter-spacing: 0.1em; padding: 12px 24px; border-radius: 30px; cursor: pointer; transition: background 0.3s, color 0.3s; -webkit-backdrop-filter:blur(10px);
 backdrop-filter:blur(10px); }
.modal-close:hover { background: #FFD24A; color: #0b0a08; border-color: #FFD24A; }

/* FIX: Allow natural vertical scrolling for the massive infographic injections */
.modal-inner-content { position: relative; z-index: 5; max-width: 1400px; margin: 0 auto; width: 100%; padding: 100px clamp(48px, 7vw, 140px); display: flex; flex-direction: column; overflow: visible; min-height: 100vh; justify-content: flex-start; }

.modal-header { text-align: center; margin-bottom: 60px; max-width: 800px; margin-left: auto; margin-right: auto; transform: translateY(30px); opacity: 0; transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s; }
.fullscreen-modal.active .modal-header { transform: translateY(0); opacity: 1; }

.modal-tag { font-family: 'Space Mono', monospace; font-size: 13px; color: #FFD24A; text-transform: uppercase; letter-spacing: 0.15em; display: block; margin-bottom: 15px; font-weight: bold; }
.modal-title { font-size: 48px; font-weight: 800; color: #fff; margin-bottom: 15px; line-height: 1.1; letter-spacing: -1px; }
.modal-desc { font-size: 18px; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }

.modal-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; transform: translateY(50px); opacity: 0; transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.4s; overflow: visible; }
.fullscreen-modal.active .modal-cards-grid { transform: translateY(0); opacity: 1; }


/* --- 3. OPTION 3 CARDS (Regular Level 1 & 2) --- */
.exp-path-card { position: relative; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; color: #f8f0e4; text-decoration: none; background: #0b0a08; display: flex; flex-direction: column; min-height: 250px; }
.exp-path-card .tag { position: absolute; top: 14px; left: 14px; font-family: "SF Mono", Menlo, monospace; color: #171006; background: #ffd24a; border-radius: 999px; padding: 7px 9px; font-size: 11px; font-weight: 950; text-transform: uppercase; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: opacity 0.3s ease, transform 0.3s ease; }
.front-content { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; z-index: 3; transition: all 0.4s ease; border-radius: 8px; overflow: hidden; }
.front-content::before { content: ""; position: absolute; inset: 0; background: var(--path-image) center / cover no-repeat; z-index: -2; }
.front-content::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,8,6,.1), rgba(8,8,6,.98)); z-index: -1; }
.front-content strong { font-family: Georgia, serif; font-size: 22px; line-height: 1.1; color: #fbfaf7; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.back-content { position: absolute; inset: 0; padding: 32px 24px; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left; z-index: 4; background: #0b0a08; border-radius: 8px; opacity: 0; transition: opacity 0.2s ease; overflow-y: auto; }

.exp-popout { overflow: visible; z-index: 1; }
.exp-popout .card-body { position: absolute; inset: 0; border-radius: 8px; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); background: #0b0a08; border: 1px solid rgba(255,255,255,0.16); display: flex; flex-direction: column; }
.exp-popout:hover { z-index: 50; }
.exp-popout:hover .card-body { top: -80px; bottom: -80px; left: -20px; right: -20px; box-shadow: 0 40px 80px rgba(0,0,0,0.9), 0 0 0 1px #FFD24A; z-index: 50; }
.exp-popout:hover .tag { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.exp-popout:hover .back-content { opacity: 1; transition-delay: 0.15s; }
.exp-popout:hover .front-content::before { opacity: 0; }

.sol-quote { color: #FFD24A; font-family: Georgia, serif; font-style: italic; font-size: 1.05rem; line-height: 1.4; margin-bottom: 20px; text-shadow: none; }
.sol-section { margin-bottom: 20px; }
.sol-section strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.4); margin-bottom: 6px; font-family: 'Space Mono', monospace; }
.sol-section p { font-size: 0.95rem; color: rgba(255,255,255,0.85); line-height: 1.5; margin: 0; }
.click-affordance { font-family: 'Space Mono', monospace; font-size: 12px; color: #FFD24A; text-transform: uppercase; letter-spacing: 0.1em; padding: 12px 24px; border: 1px solid rgba(255,210,74,0.3); border-radius: 4px; background: rgba(255,210,74,0.05); text-align: center; margin-top: auto; align-self: stretch; cursor: pointer; transition: background 0.3s, color 0.3s; }
.click-affordance:hover { background: #FFD24A; color: #0b0a08; }


/* --- 4. ACTION ENGINE MODAL & MYTH CARDS (Level 3) --- */
.integrated-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; background: #0b0a08; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; text-decoration: none; min-height: 250px; overflow: hidden; transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s, border-color 0.3s; }
.integrated-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255, 210, 74, 0.3); border-color: rgba(255, 210, 74, 0.5); z-index: 50;}
.int-pain { font-family: 'Space Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #FFD24A; position: absolute; top: 15px; left: 15px; background: rgba(255, 210, 74, 0.1); padding: 4px 8px; border-radius: 4px; }
.int-doorway { font-family: Georgia, serif; font-size: 20px; line-height: 1.2; color: #fff; margin-bottom: 10px; margin-top: 20px; }
.int-divider { height: 1px; width: 30px; background: rgba(255, 210, 74, 0.5); margin: 10px 0; }
.int-exit { font-size: 13px; color: rgba(255, 255, 255, 0.7); line-height: 1.4; margin-bottom: 15px; }
.int-action-clue { font-family: 'Space Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: #0b0a08; background: #FFD24A; padding: 6px 10px; border-radius: 4px; align-self: flex-start; margin-top: auto; font-weight: bold; }

/* The Action Engine Modal MUST sit above the .fullscreen-modal (z-index: 1000) */
#global-engine-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(5,5,5,0.95); -webkit-backdrop-filter:blur(10px);
 backdrop-filter:blur(10px); z-index: 999999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; padding: 40px 20px; }
#global-engine-modal.active { opacity: 1; pointer-events: auto; }
.modal-close-btn { position: fixed; top: 30px; right: 40px; background: none; border: none; color: #fff; font-size: 40px; cursor: pointer; opacity: 0.5; transition: opacity 0.3s; z-index: 10; }
.modal-close-btn:hover { opacity: 1; color: #FFD24A; }
.modal-content-area { max-width: 1000px; width: 100%; position: relative; }

.back-engine { display: grid; grid-template-columns: 350px 100px 350px; gap: 0; align-items: center; justify-content: center; width: 100%; position: relative; }
.engine-trigger { background: #0b0a08; border: 1px solid rgba(255, 210, 74, 0.3); padding: 30px; border-radius: 8px; position: relative; z-index: 2; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.engine-trigger h3 { font-family: Georgia, serif; font-size: 28px; color: #FFD24A; margin-bottom: 15px; }
.engine-tag { font-family: 'Space Mono', monospace; font-size: 11px; color: #0b0a08; background: #FFD24A; padding: 6px 12px; border-radius: 4px; display: inline-block; text-transform: uppercase; letter-spacing: 0.1em; font-weight: bold; }

.engine-flow { width: 100px; height: 300px; position: relative; }
.engine-svg { width: 100%; height: 100%; overflow: visible; }
.engine-path { fill: none; stroke: rgba(255, 210, 74, 0.2); stroke-width: 2; }
.engine-pulse { fill: none; stroke: #FFD24A; stroke-width: 3; stroke-dasharray: 10 20; animation: march 1.5s linear infinite; }
@keyframes march { to { stroke-dashoffset: -30; } }

.engine-impacts { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 2; }
.engine-node { background: #0b0a08; border: 1px solid rgba(255, 255, 255, 0.15); padding: 25px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: border-color 0.3s, transform 0.3s; transform: translateX(20px); opacity: 0; animation: slideIn 0.5s forwards; }
#global-engine-modal.active .engine-node:nth-child(1) { animation-delay: 0.2s; }
#global-engine-modal.active .engine-node:nth-child(2) { animation-delay: 0.4s; }
.engine-node:hover { border-color: rgba(255, 210, 74, 0.4); transform: translateX(25px); }
@keyframes slideIn { to { transform: translateX(0); opacity: 1; } }

/* =======================================================
   INFOGRAPHIC & ACTION ENGINE EXTENSIONS
   ======================================================= */

/* --- 1. VENN DIAGRAM --- */
.venn-wrapper {
  position: relative;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.venn-circle {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  position: absolute;
  mix-blend-mode: screen;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  border: 2px solid #FFD24A;
  background: rgba(255, 210, 74, 0.08);
  transition: background 0.3s;
}
.venn-circle:hover { background: rgba(255, 210, 74, 0.15); }
.venn-left { transform: translateX(-100px) translateY(-40px); }
.venn-right { transform: translateX(100px) translateY(-40px); }
.venn-bottom { transform: translateY(80px); }
.venn-label {
  position: absolute;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.v-label-1 { top: 20%; left: 50%; transform: translate(-50%, -50%); }

/* --- 2. TIMELINE FLOW --- */
.timeline-wrapper { max-width: 900px; margin: 0 auto; position: relative; }
.timeline-spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(255, 255, 255, 0.12); transform: translateX(-50%); }
.timeline-step { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; position: relative; width: 100%; }
/* the absolute spine div is the wrapper's first child, so steps start at
   nth-child(2) — even/odd here are swapped relative to step order */
.timeline-step:nth-child(odd) { flex-direction: row-reverse; }
.t-content { width: 42%; background: #151412; border: 1px solid rgba(255, 255, 255, 0.12); padding: 32px; border-radius: 8px; position: relative; }
.timeline-step:nth-child(even) .t-content { text-align: right; }
.timeline-step:nth-child(odd) .t-content { text-align: left; }
.t-content::after { content: ""; position: absolute; top: 50%; width: 8%; height: 2px; background: rgba(255, 255, 255, 0.12); }
.timeline-step:nth-child(even) .t-content::after { right: -8%; }
.timeline-step:nth-child(odd) .t-content::after { left: -8%; }
.t-number { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; background: #0b0a08; border: 2px solid #FFD24A; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Space Mono', monospace; color: #FFD24A; font-size: 1.2rem; font-weight: 700; z-index: 2; }
.t-title { font-family: Georgia, serif; font-size: 1.6rem; color: #fff; margin-bottom: 12px; margin-top: 0; }
.t-desc { font-size: 1rem; color: #a39c91; line-height: 1.5; margin: 0; }

/* --- 3. PHOTO CARDS --- */
.protocols-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.protocol-card { position: relative; height: 350px; border: 1px solid rgba(255, 255, 255, 0.1); overflow: hidden; display: flex; align-items: flex-end; text-decoration: none; color: white; border-radius: 8px; }
.p-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.5; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s; z-index: 1; }
.protocol-card:hover .p-bg { transform: scale(1.08); opacity: 0.8; }
.p-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%); z-index: 2; }
.p-content { position: relative; z-index: 3; padding: 30px; width: 100%; }
.p-num { font-family: 'Space Mono', monospace; font-size: 14px; color: #FFD24A; margin-bottom: 12px; }
.p-title { font-family: Georgia, serif; font-size: 1.8rem; margin-bottom: 12px; line-height: 1.1; margin-top: 0; }
.p-desc { font-size: 0.95rem; color: rgba(255, 255, 255, 0.7); transform: translateY(20px); opacity: 0; transition: transform 0.4s ease, opacity 0.4s ease; margin: 0; }
.protocol-card:hover .p-desc { transform: translateY(0); opacity: 1; }

/* --- 4. NEW ACTION ENGINE --- */
.action-engine { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 0; align-items: center; position: relative; width: 100%; max-width: 1000px; margin: 0 auto; }
.glass-card { background: rgba(20, 18, 15, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 32px; position: relative; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.trigger-action { cursor: pointer; z-index: 2; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.trigger-action::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,210,74,0.1), transparent 50%); opacity: 0; transition: opacity 0.4s ease; }
.trigger-action:hover { transform: translateY(-5px); border-color: rgba(255, 210, 74, 0.4); box-shadow: 0 15px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(255, 210, 74, 0.2); }
.trigger-action:hover::before { opacity: 1; }

.tag-local { display: inline-block; font-family: 'Space Mono', Consolas, monospace; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; padding: 6px 12px; border-radius: 4px; margin-bottom: 20px; background: rgba(255, 210, 74, 0.15); color: #FFD24A; border: 1px solid rgba(255, 210, 74, 0.3); }
.tag-warroom { display: inline-block; font-family: 'Space Mono', Consolas, monospace; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; padding: 6px 12px; border-radius: 4px; margin-bottom: 20px; background: rgba(255, 255, 255, 0.05); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }

.glass-card h3 { font-family: Georgia, serif; font-size: 2.2rem; margin: 0 0 16px 0; line-height: 1.2; color: #fff; }
.quote-box { border-left: 3px solid #FFD24A; padding-left: 20px; margin: 24px 0; }
.quote-box p { font-size: 1.2rem; line-height: 1.6; color: #fff; font-style: italic; margin: 0; }
.objective { font-size: 0.9rem; color: #d8cfc0; line-height: 1.6; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; margin-top: 24px; }

.flow-connector { height: 100%; width: 100%; display: flex; justify-content: center; align-items: center; z-index: 1; }
.flow-svg { width: 100%; height: 200px; overflow: visible; }
.flow-path { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 2; transition: stroke 0.4s ease; }
.flow-pulse { fill: none; stroke: #FFD24A; stroke-width: 3; stroke-dasharray: 10 10; stroke-dashoffset: 20; opacity: 0; transition: opacity 0.4s ease; }

.action-engine:has(.trigger-action:hover) .flow-path { stroke: rgba(255, 210, 74, 0.2); }
.action-engine:has(.trigger-action:hover) .flow-pulse { opacity: 1; animation: pulse-flow 1s linear infinite; }
@keyframes pulse-flow { to { stroke-dashoffset: 0; } }

.impact-stack { display: flex; flex-direction: column; gap: 24px; }
.impact-node { padding: 24px; background: rgba(11,10,8,0.4); border: 1px dashed rgba(255,255,255,0.1); opacity: 0.5; transform: translateX(-10px); transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.impact-node h4 { font-size: 1.2rem; margin: 0 0 10px 0; color: #fff; }
.impact-node p { font-size: 0.95rem; color: #d8cfc0; line-height: 1.5; margin: 0; }

.action-engine:has(.trigger-action:hover) .impact-node { opacity: 1; transform: translateX(0); border-color: rgba(255, 210, 74, 0.3); background: rgba(255, 210, 74, 0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.action-engine:has(.trigger-action:hover) .impact-node:nth-child(1) { transition-delay: 0.1s; }
.action-engine:has(.trigger-action:hover) .impact-node:nth-child(2) { transition-delay: 0.2s; }

.impact-icon { float: right; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.3); transition: all 0.4s ease; }
.action-engine:has(.trigger-action:hover) .impact-icon { background: rgba(255, 210, 74, 0.15); color: #FFD24A; }


.hierarchy-container {
    max-width: 1200px;
    margin: 40px auto;
    display: grid;
    gap: 40px;
}
@media (min-width: 900px) {
    .level-3-wrapper {
        grid-column: 3 / 12;
        z-index: 3;
		margin-bottom: -120px;
        transform: translateY(-160px);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    }
}

.hierarchy-flip-wrapper {
    perspective: 1200px;
    position: relative;
}
@media (min-width: 900px) {
    .level-2-wrapper {
        grid-column: 2 / 11;
        z-index: 2;
        transform: translateY(-80px);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    }
}
@media (min-width: 900px) {
    .level-1-wrapper {
        grid-column: 1 / 10;
        z-index: 1;
    }
}

@media (min-width: 900px) {
    .hierarchy-container {
     
        gap: 0;
        align-items: center;
    }
}


/* Action Engine Mobile */
@media (max-width: 800px) {
  .action-engine {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .action-engine .flow-connector {
    transform: rotate(90deg);
    margin: 10px auto;
  }
  .action-engine .impact-zone {
    align-items: center;
  }
  .action-engine .trigger-action {
    margin: 0 auto;
  }
}


/* Engine Cut Fixes for Mobile */
@media (max-width: 800px) {
  .inline-engine {
    padding: 40px 20px !important;
  }
  
  .back-engine {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }
  
  /* Fix bounding box issues with rotated SVGs */
  .action-engine .flow-connector,
  .back-engine .engine-flow {
    transform: rotate(90deg);
    width: 100px !important;
    height: 100px !important;
    margin: 10px auto !important;
    overflow: visible;
  }
  
  .action-engine .flow-svg,
  .back-engine .engine-svg {
    width: 100px !important;
    height: 100px !important;
  }
  
  .glass-card {
    padding: 24px !important;
  }
}


/* Fix myth card back clipping */
.myth-card-back {
  overflow-y: auto !important;
  scrollbar-width: thin;
  padding-bottom: 20px;
}
.myth-card-back::-webkit-scrollbar {
  width: 4px;
}
.myth-card-back::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 74, 0.5);
  border-radius: 4px;
}

/* Fix action engine upper clipping */
.action-engine {
  padding-top: 20px; /* Ensure top shadows/borders aren't clipped */
}

@media (max-width: 800px) {
  /* Let the SVG breathe so it's not cut off */
  .action-engine .flow-connector,
  .back-engine .engine-flow {
    width: 100% !important;
    height: auto !important;
    min-height: 100px;
  }
  
  .action-engine .flow-svg,
  .back-engine .engine-svg {
    width: 100px !important;
    height: 200px !important;
    max-width: 100%;
  }
}


/* Fix modal clipping for tall content */
#global-engine-modal,
[id^="global-engine-modal"] {
  align-items: flex-start !important;
  overflow-y: auto !important;
  padding-top: 60px !important;
  padding-bottom: 60px !important;
}
.modal-content-area {
  margin: 0 auto !important; /* ONLY horizontal center, fixes top-clipping scroll bug */
}

/* Mobile responsive timeline override */
@media (max-width: 800px) {
  .timeline-spine {
    left: 20px !important;
    transform: none !important;
  }
  
  .timeline-step {
    display: block !important;
    position: relative;
    padding-left: 60px !important;
    margin-bottom: 40px !important;
  }
  
  .t-number {
    left: 20px !important;
    top: 24px !important;
    transform: translateX(-50%) !important; 
  }
  
  .t-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 24px !important;
  }
  
  /* Hide the horizontal connector lines on mobile */
  .t-content::after {
    display: none !important;
  }
  
  /* Override the even/odd text alignment */
  .timeline-step:nth-child(even) .t-content,
  .timeline-step:nth-child(odd) .t-content,
  .t-content {
    text-align: left !important;
  }
}



/* Knowledge Engine Overlay (Minimalist Reading Pane) */
.knowledge-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 12, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.knowledge-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.knowledge-pane {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.knowledge-overlay.active .knowledge-pane {
  transform: translateY(0);
}
.knowledge-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #666;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}
.knowledge-close:hover { color: #fff; }
.knowledge-content {
  padding: 40px;
}
.knowledge-slide-clone {
  display: flex;
  flex-direction: column;
  height: auto !important;
  min-height: auto !important;
}
.knowledge-link {
  color: var(--gold, #FFD24A);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 210, 74, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}
.knowledge-link:hover {
  background: rgba(255, 210, 74, 0.1);
  border-bottom-style: solid;
}

/* Knowledge Engine Overlay (Minimalist Reading Pane) */
.knowledge-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 12, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.knowledge-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.knowledge-pane {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.knowledge-overlay.active .knowledge-pane {
  transform: translateY(0);
}
.knowledge-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #666;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}
.knowledge-close:hover { color: #fff; }
.knowledge-content {
  padding: 40px;
}
.knowledge-slide-clone {
  display: flex;
  flex-direction: column;
  height: auto !important;
  min-height: auto !important;
}
.knowledge-link {
  color: var(--gold, #FFD24A);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 210, 74, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}
.knowledge-link:hover {
  background: rgba(255, 210, 74, 0.1);
  border-bottom-style: solid;
}
